﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ICaiBan.IBLL;
using ICaiBan.Remoting.Client;
using ICaiBan.ModelBL.Merchant;

using System.Web.Security;

using System.IO;
using ICaiBan.ModelAPI;
using ICaiBan.BLL.Common;
using ICaiBan.ModelBL.Enums;
using ICaiBan.ModelAPI.Merchant;
using ICaiBan.BLL.Components;
using System.Text;
/// <summary>
/// 添加操作人员
/// author:邓俊龙
/// update:2013-6-27
/// </summary>
namespace merchant.setting
{
    public partial class operators : FatherPage
    {
        IMerchant merchant = (Merchant)InvokeRemoting.GetObj<IMerchant>();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (base.IsFirstLoad)
            {
                BindShow();
            }
        }

        #region 绑定显示
        /// <summary>
        /// 显示操作人员列表
        /// </summary>
        protected void BindShow()
        {
            int count = 0;
            ReturnListData<GetEmployeeListOutPut> employees =
                merchant.GetEmployeeList(new ParamContext<ICaiBan.ModelAPI.Merchant.GetEmployeeListParam>
                    (new ICaiBan.ModelAPI.Merchant.GetEmployeeListParam() { MerchantId = this.CompanyID, PageIndex = Paging.CurrentPageIndex, PageSize = Paging.PageSize }));
            RepeaterAll.DataSource = employees.listdata.rows;
            RepeaterAll.DataBind();
            if (employees != null && employees.listdata.totalcount > 0)
            {
                Paging.RecordCount = count;
            }
            else
            {
                Page.ClientScript.RegisterStartupScript
                        (Page.GetType(), "myscript", "<script language='javascript'>NoData()</script>");
            }
            Paging.RecordCount = employees.listdata.totalcount != null ? (int)employees.listdata.totalcount : 0;
            Paging.TextBeforePageIndexBox = "共&nbsp;" + Paging.PageCount + "&nbsp;页&nbsp;&nbsp;&nbsp;到第";
        }
        /// <summary>
        /// 翻页
        /// </summary>

        protected void Paging_PageChanged(object sender, EventArgs e)
        {
            BindShow();
        }

        /// <summary>
        /// 刷新
        /// </summary>
        protected void btnRef_Click(object sender, EventArgs e)
        {
            BindShow();
        }

        #endregion
    }
}