private void BindCustomer(int CurrentPage) { int count; DataSet dsCustomerFolio; AdvisorBranchBo adviserBranchBo = new AdvisorBranchBo(); DataTable dtCustomerFolio = new DataTable(); try { if (hdnCurrentPage.Value.ToString() != "") { mypager.CurrentPage = Int32.Parse(hdnCurrentPage.Value.ToString()); hdnCurrentPage.Value = ""; } dsCustomerFolio = adviserBranchBo.GetAdviserCustomerFolioMerge(adviserVo.advisorId, mypager.CurrentPage, hdnNameFilter.Value.ToString(), out count); lblTotalRows.Text = hdnRecordCount.Value = count.ToString(); dtCustomerFolio.Columns.Add("CustomerId"); dtCustomerFolio.Columns.Add("CustomerName"); dtCustomerFolio.Columns.Add("AMCName"); dtCustomerFolio.Columns.Add("AMCCode"); dtCustomerFolio.Columns.Add("Count"); dtCustomerFolio.Columns.Add("portfilionumber"); dtCustomerFolio.Columns.Add("mergerstatus"); if (dsCustomerFolio.Tables[0].Rows.Count == 0) { //hdnRecordCount.Value = "0"; ErrorMessage.Visible = true; trPager.Visible = false; lblTotalRows.Visible = false; lblCurrentPage.Visible = false; } else { //trPager.Visible = true; //lblTotalRows.Visible = true; //lblCurrentPage.Visible = true; DataRow drCustomerFolio; DataTable dtCustomer = dsCustomerFolio.Tables[0]; ErrorMessage.Visible = false; trPager.Visible = true; lblTotalRows.Visible = true; lblCurrentPage.Visible = true; for (int i = 0; i < dtCustomer.Rows.Count; i++) { drCustomerFolio = dtCustomerFolio.NewRow(); drCustomerFolio["CustomerId"] = dtCustomer.Rows[i]["customerid"]; drCustomerFolio["CustomerName"] = dtCustomer.Rows[i]["name"]; drCustomerFolio["AMCName"] = dtCustomer.Rows[i]["amcname"]; drCustomerFolio["AMCCode"] = dtCustomer.Rows[i]["amccode"]; drCustomerFolio["Count"] = dtCustomer.Rows[i]["number"]; drCustomerFolio["portfilionumber"] = dtCustomer.Rows[i]["portfilionumber"]; drCustomerFolio["mergerstatus"] = dtCustomer.Rows[i]["mergerstatus"]; dtCustomerFolio.Rows.Add(drCustomerFolio); } gvCustomerFolioMerge.DataSource = dtCustomerFolio; gvCustomerFolioMerge.DataBind(); //Customer search //TextBox txtBranch = GetBranchTextBox(); //if (txtBranch != null) //{ // if (hdnBranchFilter.Value != "") // { // txtBranch.Text = hdnBranchFilter.Value.ToString(); // } //} this.GetPageCount(); } } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "CustomerFolioMerge.ascx.cs:BindCustomer()"); object[] objects = new object[3]; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }