private DataTable GetDataTable() { CommissionClaimDAL commClaimDAL = new CommissionClaimDAL(); DataTable dtCommissionClaim = new DataTable("dtCommissionClaim"); dtCommissionClaim.Columns.Add(new DataColumn("SaleStatementTransNo", typeof(string))); dtCommissionClaim.Columns.Add(new DataColumn("TotalFaceValue", typeof(string))); dtCommissionClaim.Columns.Add(new DataColumn("TotalOrgCommission", typeof(string))); dtCommissionClaim.Columns.Add(new DataColumn("TotalNonOrgCommission", typeof(string))); string saleTransNos = ""; foreach (GridViewRow gvr in gvData.Rows) { CheckBox chk = (CheckBox)gvr.FindControl("chkSelected"); if (chk != null) { if (chk.Checked) { saleTransNos += "," + (gvr.FindControl("hdnSalesStatementTranNo") as HiddenField).Value; } } } if (!string.IsNullOrEmpty(saleTransNos)) { saleTransNos = saleTransNos.Substring(1); Result oResult; oResult = commClaimDAL.LoadReferenceDetailsData(saleTransNos); if (oResult.Status) { dtCommissionClaim = oResult.Return as DataTable; } } return(dtCommissionClaim); }
private void FillReferenceDetailGrid(string sCommissionClaimTransNo) { CommissionClaimDAL commClaimDAL = new CommissionClaimDAL(); Config oConfig = (Config)Session[Constants.SES_USER_CONFIG]; Result oResult = commClaimDAL.LoadReferenceDetailsData(ddlSpType.SelectedValue, Util.GetDateTimeByString(txtDateFrom.Text), Util.GetDateTimeByString(ddlDateTo.SelectedValue), sCommissionClaimTransNo, oConfig.DivisionID, oConfig.BankCodeID); if (oResult.Status) { DataTable dtCommClaim = oResult.Return as DataTable; if (dtCommClaim != null && dtCommClaim.Rows.Count > 0) { dtCommClaim.Columns.Remove("OrgCount"); gvData.DataSource = dtCommClaim; gvData.DataBind(); if (!string.IsNullOrEmpty(sCommissionClaimTransNo)) { foreach (GridViewRow gvr in gvData.Rows) { CheckBox chk = (CheckBox)gvr.FindControl("chkSelected"); if (chk != null) { chk.Checked = true; chk.Enabled = false; } } CalculateCommissionClaim(); } else { LoadCurrencyData(); } } } }