private void BindEquityTransactionGrid(int ProcessId) { Dictionary <string, string> genDictIsRejected = new Dictionary <string, string>(); Dictionary <string, string> genDictRejectReason = new Dictionary <string, string>(); rejectedRecordsBo = new RejectedRecordsBo(); dsRejectedRecords = rejectedRecordsBo.GetRejectedMFTransactionStaging(adviserId, int.Parse(hdnProcessIdFilter.Value)); if (dsRejectedRecords.Tables[0].Rows.Count > 0) { // If Records found, then bind them to grid trMessage.Visible = false; trReprocess.Visible = true; trGridView.Visible = true; //gvWERPTrans_Sort.DataSource = dsRejectedRecords.Tables[0]; if (Cache["MFTransactionDetails" + adviserId.ToString()] == null) { Cache.Insert("MFTransactionDetails" + adviserId.ToString(), dsRejectedRecords); } else { Cache.Remove("MFTransactionDetails" + adviserId.ToString()); Cache.Insert("MFTransactionDetails" + adviserId.ToString(), dsRejectedRecords); } gvWERPTrans.DataSource = dsRejectedRecords; gvWERPTrans.DataBind(); Panel2.ScrollBars = ScrollBars.Horizontal; trGridView.Visible = true; imgBtnrgHoldings.Visible = true; } else { //hdnRecordCount.Value = "0"; Panel2.ScrollBars = ScrollBars.None; trGridView.Visible = false; gvWERPTrans.DataSource = null; gvWERPTrans.DataBind(); trMessage.Visible = true; trReprocess.Visible = false; imgBtnrgHoldings.Visible = false; } //this.GetPageCount(); }
private void BindEquityTransactionGrid(int ProcessId) { Dictionary <string, string> genDictIsRejected = new Dictionary <string, string>(); Dictionary <string, string> genDictRejectReason = new Dictionary <string, string>(); if (hdnCurrentPage.Value.ToString() != "") { mypager.CurrentPage = Int32.Parse(hdnCurrentPage.Value.ToString()); hdnCurrentPage.Value = ""; } int Count; rejectedRecordsBo = new RejectedRecordsBo(); dsRejectedRecords = rejectedRecordsBo.GetRejectedMFTransactionStaging(adviserVo.advisorId, mypager.CurrentPage, out Count, hdnSort.Value, int.Parse(hdnProcessIdFilter.Value), hdnRejectReasonFilter.Value, hdnFileNameFilter.Value, hdnFolioFilter.Value, hdnTransactionTypeFilter.Value, hdnInvNameFilter.Value, hdnSourceTypeFilter.Value, hdnSchemeNameFilter.Value); lblTotalRows.Text = hdnRecordCount.Value = Count.ToString(); if (Count > 0) { DivPager.Style.Add("display", "visible"); } if (dsRejectedRecords.Tables[0].Rows.Count > 0) { // If Records found, then bind them to grid trMessage.Visible = false; trReprocess.Visible = true; gvWERPTrans.DataSource = dsRejectedRecords.Tables[0]; gvWERPTrans.DataBind(); if (dsRejectedRecords.Tables[2].Rows.Count > 0) { // Get the Reject Reason Codes Available into Generic Dictionary foreach (DataRow dr in dsRejectedRecords.Tables[2].Rows) { if (dr["RejectReasonCode"].ToString() != "7") { genDictRejectReason.Add(dr["RejectReason"].ToString(), dr["RejectReasonCode"].ToString()); } } DropDownList ddlRejectReason = GetRejectReasonDDL(); if (ddlRejectReason != null) { ddlRejectReason.DataSource = genDictRejectReason; ddlRejectReason.DataTextField = "Key"; ddlRejectReason.DataValueField = "Value"; ddlRejectReason.DataBind(); ddlRejectReason.Items.Insert(0, new ListItem("Select", "Select")); } if (hdnRejectReasonFilter.Value != "") { ddlRejectReason.SelectedValue = hdnRejectReasonFilter.Value.ToString().Trim(); } } BindProcessId(dsRejectedRecords.Tables[3]); BindInvName(dsRejectedRecords.Tables[6]); BindFileName(dsRejectedRecords.Tables[4]); BindSourceType(dsRejectedRecords.Tables[5]); BindFolioNumber(dsRejectedRecords.Tables[7]); BindSchemeName(dsRejectedRecords.Tables[8]); BindTransactionType(dsRejectedRecords.Tables[9]); } else { hdnRecordCount.Value = "0"; gvWERPTrans.DataSource = null; gvWERPTrans.DataBind(); trMessage.Visible = true; trReprocess.Visible = false; } this.GetPageCount(); }