protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { HYCashierDAL.CahierMgrDAL dal = new HYCashierDAL.CahierMgrDAL(); string clientID = string.Empty; if (Session["ClientID"].ToString() == "180000") { clientID = null; } else { clientID = Session["ClientID"].ToString(); } int oprCount = dal.GetOprCount(clientID, "", "", ""); int clientCount = dal.GetClientCount(clientID, ""); lblClientCount.Text = clientCount.ToString(); lblOprCount.Text = oprCount.ToString(); } }
void LoadData() { string clientName = txtMerchantName.Value.Trim(); string oprName = txtUsrName.Value.Trim(); HYCashierDAL.CahierMgrDAL dal = new HYCashierDAL.CahierMgrDAL(); int? count = 0; string clientID = string.Empty; if (!string.IsNullOrEmpty(txtMerchantID.Value.Trim())) { clientID = txtMerchantID.Value; } //if (Session["ClientID"].ToString() == "180000") //{ // clientID = null; //} //else //{ // clientID = Session["ClientID"].ToString(); //} count = dal.GetOprCount(clientID, clientName, null, oprName); if (count == null) { AspNetPager1.RecordCount = 0; } else { AspNetPager1.RecordCount = (int)count; } DataTable dt = dal.GetOprList(clientID, clientName, null, oprName, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize); dataGrid.DataSource = dt; dataGrid.DataBind(); }