using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TopWinCMS.Model;
using TopWinCMS.Common;
using TopWinCMS.BLL;

public partial class Admin_Member_Business : System.Web.UI.Page
{
    BusinessManage MyClassBLL = new BusinessManage();
    SQLModel s_model = new SQLModel();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            RightsCheck.CheckWorkPower("MM_5");
            BindList();
        }
    }
    private void BindList()
    { 
        GV_List.EmptyDataTemplate = TopWinCMS.WebFactory.PageBase.GetTemplate(this);
        string Action = Request["Action"];

        if (Action == "XiaoFei")
        {
            L_Path.Text = Config.SiteName + " → 会员管理 → 交易明细 → <a href=\"Business.aspx?Action=XiaoFei\">扣点数</a>";
            this.Title = "扣点数";
            s_model.WHERE = " flag=1";
            GV_List.Columns[5].Visible = false; 
            GV_List.Columns[6].Visible = false;
        }
        else if (Action == "HuiKuan")
        {
            L_Path.Text = Config.SiteName + " → 会员管理 → 交易明细 → <a href=\"Business.aspx?Action=HuiKuan\">汇款确认</a>";
            this.Title = "汇款确认";
            s_model.WHERE = " flag=0";
            GV_List.Columns[4].Visible = false;
        }
        else
        {
            ErrClass.Redirect("参数错误！");
        }


        MyClassBLL.BindList(GV_List, PageNavigation1, s_model);

        if (GV_List.Rows.Count <= 0)
        {
            BT_DelSelected.Enabled = false;
        }
    }



    protected void BT_DelSelected_Click(object sender, EventArgs e)
    {
        MyClassBLL.Del(GetSelectedRow.IDs(GV_List), "Business.aspx?Action=" + Request["Action"]);
    }

    protected void PageNavigation1_PageChanging(object src, TopWinCMS.WebControls.PageChangingEventArgs e)
    {
        s_model.PageNo = e.NewPageIndex;

        BindList();
    }
}
