protected void DRRefNoDropDownList_SelectedIndexChanged(object sender, EventArgs e) { DataTable dtSaleInfoForDRF = unitSaleBLObj.dtGetSaleInfoForDemate(" AND SALE.REG_BK='" + fundCode + "' AND SALE.REG_BR='" + branchCode + "' AND SALE.DRF_REF_NO=" + DRRefNoDropDownList.SelectedValue.ToString()); long totalUnitsQty = unitSaleBLObj.getTotalUnitsForDRF(" AND SALE.REG_BK='" + fundCode + "' AND SALE.REG_BR='" + branchCode + "' AND SALE.DRF_REF_NO=" + DRRefNoDropDownList.SelectedValue.ToString()); if (dtSaleInfoForDRF.Rows.Count > 0) { SaleListGridView.DataSource = dtSaleInfoForDRF; SaleListGridView.DataBind(); FolioNoLabel.Text = dtSaleInfoForDRF.Rows[0]["DRF_REG_FOLIO_NO"].ToString(); CertNoLabel.Text = dtSaleInfoForDRF.Rows[0]["DRF_CERT_NO"].ToString(); DistinctNoToLabel.Text = dtSaleInfoForDRF.Rows[0]["DRF_DISTNCT_NO_TO"].ToString(); DistNoFromLabel.Text = dtSaleInfoForDRF.Rows[0]["DRF_DISTNCT_NO_FROM"].ToString(); TotalUnitLabel.Text = totalUnitsQty.ToString(); } else { SaleListGridView.DataSource = dtSaleInfoForDRF; SaleListGridView.DataBind(); DRFNoTextBox.Text = ""; DRNTextBox.Text = ""; DamateDateTextBox.Text = ""; FolioNoLabel.Text = ""; CertNoLabel.Text = ""; DistinctNoToLabel.Text = ""; DistNoFromLabel.Text = ""; TotalUnitLabel.Text = ""; ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('No Data Found');", true); } }
protected void SaleVoucherButton_Click(object sender, EventArgs e) { if (fundNameDropDownList.SelectedValue.ToString() != "0") { try { SaveSaleUniAccountVoucher(unitRepBLObj.GetaccountSchema(fundNameDropDownList.SelectedValue.ToString())); DataTable dtMoneyReceiptInfo = unitSaleBLObj.dtMoneyReceiptInfo(" AND RECEIPT_DATE BETWEEN '" + fromSaleDateTextBox.Text.Trim() + "' AND '" + toSaleDateTextBox.Text.Trim() + "' AND RECEIPT_TYPE='SL' "); dvGridSurrender.Visible = true; SaleListGridView.DataSource = dtUnitSaleForGrid(dtMoneyReceiptInfo); SaleListGridView.DataBind(); fundNameDropDownList.SelectedValue = "0"; VoucherNoTexBox.Text = ""; ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('Save Successfully');", true); } catch (Exception ex) { ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due to exception error');", true); } } else { ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Please Select a fund to voucher posting ');", true); } }
protected void DRRefNoDropDownList_SelectedIndexChanged(object sender, EventArgs e) { DataTable dtSaleInfoForDRF = unitSaleBLObj.dtGetSaleInfoForDemate(" AND SALE.REG_BK='" + fundCode + "' AND SALE.REG_BR='" + branchCode + "' AND SALE.DRF_REF_NO=" + DRRefNoDropDownList.SelectedValue.ToString()); long totalUnitsQty = unitSaleBLObj.getTotalUnitsForDRF(" AND SALE.REG_BK='" + fundCode + "' AND SALE.REG_BR='" + branchCode + "' AND SALE.DRF_REF_NO=" + DRRefNoDropDownList.SelectedValue.ToString()); long maxDistinctiveNo = commonGatewayObj.GetMaxNo("SALE", "DRF_DISTNCT_NO_TO", "SALE.REG_BK = '" + fundCode + "'"); if (dtSaleInfoForDRF.Rows.Count > 0) { SaleListGridView.DataSource = dtSaleInfoForDRF; SaleListGridView.DataBind(); DistinctNoFromTextBox.Text = Convert.ToString(maxDistinctiveNo + 1); DistinctNoToTextBox.Text = Convert.ToString(maxDistinctiveNo + totalUnitsQty); RegFolioNoTextBox.Text = Convert.ToString(commonGatewayObj.GetMaxNo("SALE", "TO_NUMBER(DRF_REG_FOLIO_NO)", "SALE.REG_BK = '" + fundCode + "'") + 1); CertNoTextBox.Text = Convert.ToString(commonGatewayObj.GetMaxNo("SALE", "TO_NUMBER(DRF_CERT_NO)", "SALE.REG_BK = '" + fundCode + "'") + 1); TotalUnitsTextBox.Text = totalUnitsQty.ToString(); } else { SaleListGridView.DataSource = dtSaleInfoForDRF; SaleListGridView.DataBind(); DistinctNoFromTextBox.Text = ""; DistinctNoToTextBox.Text = ""; RegFolioNoTextBox.Text = ""; CertNoTextBox.Text = ""; TotalUnitsTextBox.Text = ""; ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('No Data Found');", true); } }
protected void SubmitButton_Click(object sender, EventArgs e) { Hashtable htUpdate = new Hashtable(); try { bool isDupliacteDRF = unitSaleBLObj.CheckDuplicateSaleRelatedInfo(" AND SALE.REG_BK='" + fundCode + "' AND SALE.DRF_ACCEPT_NO='" + DRFNoTextBox.Text + "'"); bool isDupliacteDRN = unitSaleBLObj.CheckDuplicateSaleRelatedInfo(" AND SALE.REG_BK='" + fundCode + "' AND SALE.DRF_DRN ='" + DRNTextBox.Text + "'"); if (isDupliacteDRF) { ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due to Duplicate DRF No');", true); } else if (isDupliacteDRN) { ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due to Duplicate DRN');", true); } else { commonGatewayObj.BeginTransaction(); htUpdate = new Hashtable(); htUpdate.Add("DRF_ACCEPT_ENTRY_BY", userObj.UserID.ToString()); htUpdate.Add("DRF_ACCEPT_ENTRY_DATE", DateTime.Now); htUpdate.Add("DRF_ACCEPT_NO", DRFNoTextBox.Text.Trim().ToString()); htUpdate.Add("DRF_DRN", DRNTextBox.Text.Trim().ToString()); htUpdate.Add("DRF_ACCEPT_DATE", DamateDateTextBox.Text.Trim().ToString()); commonGatewayObj.Update(htUpdate, "SALE", "REG_BK='" + fundCode.ToUpper().ToString() + "' AND REG_BR='" + branchCode.ToUpper().ToString() + "' AND SALE.DRF_REF_NO=" + DRRefNoDropDownList.SelectedValue.ToString()); commonGatewayObj.CommitTransaction(); DRRefNoDropDownList.DataSource = unitSaleBLObj.dtDRRefNoListForDRN("AND SALE.REG_BK='" + fundCode + "'"); DRRefNoDropDownList.DataTextField = "NAME"; DRRefNoDropDownList.DataValueField = "ID"; DRRefNoDropDownList.DataBind(); DRFNoTextBox.Text = ""; DRNTextBox.Text = ""; DamateDateTextBox.Text = ""; FolioNoLabel.Text = ""; CertNoLabel.Text = ""; DistinctNoToLabel.Text = ""; DistNoFromLabel.Text = ""; TotalUnitLabel.Text = ""; DataTable dtSaleInfoForDRF = unitSaleBLObj.dtGetSaleInfoForDemate(" AND SALE.REG_BK='" + fundCode + "' AND SALE.REG_BR='" + branchCode + "' AND SALE.DRF_REF_NO=0"); SaleListGridView.DataSource = dtSaleInfoForDRF; SaleListGridView.DataBind(); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('Save Successfully');", true); } } catch (Exception ex) { commonGatewayObj.RollbackTransaction(); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due to Error:" + ex.Message.ToString() + "');", true); } }
protected void SubmitButton_Click(object sender, EventArgs e) { int countCheck = 0; int countUpdateRow = 0; bool isDupliacteDRRefNo = unitSaleBLObj.CheckDuplicateSaleRelatedInfo(" AND SALE.REG_BK='" + fundCode + "' AND DRF_REF_NO=" + Convert.ToInt64(DRFRefNoTextBox.Text.ToString())); if (!isDupliacteDRRefNo) { Hashtable htUpdate = new Hashtable(); try { commonGatewayObj.BeginTransaction(); foreach (GridViewRow Drv in SaleListGridView.Rows) { CheckBox leftCheckBox = (CheckBox)SaleListGridView.Rows[countCheck].FindControl("leftCheckBox"); if (leftCheckBox.Checked) { htUpdate = new Hashtable(); htUpdate.Add("DRF_REQ_BY", userObj.UserID.ToString()); htUpdate.Add("DRF_REQ_DATE", DateTime.Now); htUpdate.Add("HOLDER_BO", Drv.Cells[6].Text.ToUpper().ToString()); htUpdate.Add("DRF_REF_NO", Convert.ToInt64(DRFRefNoTextBox.Text.ToString())); commonGatewayObj.Update(htUpdate, "SALE", "REG_BK='" + Drv.Cells[1].Text.ToUpper().ToString() + "' AND REG_BR='" + Drv.Cells[2].Text.ToUpper().ToString() + "' AND REG_NO=" + Convert.ToInt32(Drv.Cells[3].Text.ToString()) + " AND SL_NO=" + Convert.ToInt32(Drv.Cells[4].Text.ToString())); countUpdateRow++; } countCheck++; } if (countUpdateRow == 0) { ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due No Sale Selection ');", true); } else { commonGatewayObj.CommitTransaction(); DataTable dtSaleInfoForDRF = unitSaleBLObj.dtGetSaleInfoForDRF(" AND SALE.REG_BK='" + fundCode + "' AND SALE.REG_BR='" + branchCode + "' AND SALE.SL_NO BETWEEN 0 AND 0"); SaleListGridView.DataSource = dtSaleInfoForDRF; SaleListGridView.DataBind(); DRFRefNoTextBox.Text = ""; toSaleNoTextBox.Text = ""; fromSaleNoTextBox.Text = ""; ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('Save Successfully');", true); } } catch (Exception ex) { commonGatewayObj.RollbackTransaction(); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed:" + ex.Message.ToString() + "');", true); } } else { ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed:Duplicate DR Reference Number ');", true); } }
protected void SubmitButton_Click(object sender, EventArgs e) { int countCheck = 0; Hashtable htUpdate = new Hashtable(); try { foreach (GridViewRow Drv in SaleListGridView.Rows) { TextBox TRSeqNoTextBox = (TextBox)SaleListGridView.Rows[countCheck].FindControl("TRSeqNoTextBox"); bool isDupliacteTrSeqNo = unitSaleBLObj.CheckDuplicateSaleRelatedInfo(" AND SALE.REG_BK='" + fundCode + "' AND SALE.DRF_TR_SEQ_NO='" + TRSeqNoTextBox.Text + "'"); if (isDupliacteTrSeqNo) { ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due to Duplicate Transfer Sequence Number:" + TRSeqNoTextBox.Text + "');", true); break; } else { commonGatewayObj.BeginTransaction(); htUpdate = new Hashtable(); htUpdate.Add("DRF_TR_ENTRY_BY", userObj.UserID.ToString()); htUpdate.Add("DRF_TR_ENTRY_DATE", DateTime.Now); htUpdate.Add("DRF_TR_SEQ_NO", TRSeqNoTextBox.Text.Trim().ToString()); htUpdate.Add("DRF_TR_DATE", TransferDateTextBox.Text.Trim().ToString()); commonGatewayObj.Update(htUpdate, "SALE", "REG_BK='" + fundCode.ToUpper().ToString() + "' AND REG_BR='" + branchCode.ToUpper().ToString() + "' AND SALE.DRF_REF_NO=" + DRRefNoDropDownList.SelectedValue.ToString()); } commonGatewayObj.CommitTransaction(); DRRefNoDropDownList.DataSource = unitSaleBLObj.dtDRRefNoListForFolioTransfer("AND SALE.REG_BK='" + fundCode + "'"); DRRefNoDropDownList.DataTextField = "NAME"; DRRefNoDropDownList.DataValueField = "ID"; DRRefNoDropDownList.DataBind(); TRSeqFromNoTextBox.Text = ""; TransferDateTextBox.Text = ""; DataTable dtSaleInfoForDRF = unitSaleBLObj.dtGetSaleInfoForDemate(" AND SALE.REG_BK='" + fundCode + "' AND SALE.REG_BR='" + branchCode + "' AND SALE.DRF_REF_NO=0"); SaleListGridView.DataSource = dtSaleInfoForDRF; SaleListGridView.DataBind(); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('Save Successfully');", true); countCheck++; } } catch (Exception ex) { commonGatewayObj.RollbackTransaction(); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due to Error:" + ex.Message.ToString() + "');", true); } }
protected void addToListButton_Click(object sender, EventArgs e) { bool isDupliacteTrSeqNo = unitSaleBLObj.CheckDuplicateSaleRelatedInfo(" AND SALE.REG_BK='" + fundCode + "' AND SALE.DRF_TR_SEQ_NO='" + TRSeqFromNoTextBox.Text + "'"); DataTable dtSaleInfoForDRF = unitSaleBLObj.dtGetSaleInfoForDemate(" AND SALE.REG_BK='" + fundCode + "' AND SALE.REG_BR='" + branchCode + "' AND SALE.DRF_REF_NO=" + DRRefNoDropDownList.SelectedValue.ToString()); DataTable dtSaleInfoWithTrSeq = dtSaleInfoForDRF.Clone(); // dtSaleInfoWithTrSeq.Columns.Add(" DRF_TR_SEQ_NO", typeof(long)); DataRow drSaleInfoForTrSeq; long trSeqNo = Convert.ToInt64(TRSeqFromNoTextBox.Text.Trim()); if (isDupliacteTrSeqNo) { SaleListGridView.DataSource = unitSaleBLObj.dtGetSaleInfoForDemate(" AND 1=2");; SaleListGridView.DataBind(); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Add to List Failed Due to Duplicate Transfer Sequence Number:" + TRSeqFromNoTextBox.Text + "');", true); } else if (dtSaleInfoForDRF.Rows.Count > 0) { for (int loop = 0; loop < dtSaleInfoForDRF.Rows.Count; loop++) { drSaleInfoForTrSeq = dtSaleInfoWithTrSeq.NewRow(); drSaleInfoForTrSeq["REG_BK"] = dtSaleInfoForDRF.Rows[loop]["REG_BK"]; drSaleInfoForTrSeq["REG_BR"] = dtSaleInfoForDRF.Rows[loop]["REG_BR"]; drSaleInfoForTrSeq["REG_NO"] = dtSaleInfoForDRF.Rows[loop]["REG_NO"]; drSaleInfoForTrSeq["SL_NO"] = dtSaleInfoForDRF.Rows[loop]["SL_NO"]; drSaleInfoForTrSeq["HNAME"] = dtSaleInfoForDRF.Rows[loop]["HNAME"]; drSaleInfoForTrSeq["HOLDER_BO"] = dtSaleInfoForDRF.Rows[loop]["HOLDER_BO"]; drSaleInfoForTrSeq["QTY"] = dtSaleInfoForDRF.Rows[loop]["QTY"]; drSaleInfoForTrSeq["DRF_TR_SEQ_NO"] = trSeqNo; dtSaleInfoWithTrSeq.Rows.Add(drSaleInfoForTrSeq); } if (dtSaleInfoWithTrSeq.Rows.Count > 0) { SaleListGridView.DataSource = dtSaleInfoWithTrSeq; SaleListGridView.DataBind(); } else { SaleListGridView.DataSource = dtSaleInfoForDRF; SaleListGridView.DataBind(); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('No Data Found');", true); } } else { SaleListGridView.DataSource = dtSaleInfoForDRF; SaleListGridView.DataBind(); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('No Data Found');", true); } }
protected void DRRefNoDropDownList_SelectedIndexChanged(object sender, EventArgs e) { DataTable dtSaleInfoForDRF = unitSaleBLObj.dtGetSaleInfoForFolioTransferPrint(" AND SALE.REG_BK='" + fundCode + "' AND SALE.REG_BR='" + branchCode + "' AND SALE.DRF_REF_NO=" + DRRefNoDropDownList.SelectedValue.ToString()); if (dtSaleInfoForDRF.Rows.Count > 0) { SaleListGridView.DataSource = dtSaleInfoForDRF; SaleListGridView.DataBind(); } else { SaleListGridView.DataSource = dtSaleInfoForDRF; SaleListGridView.DataBind(); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('No Data Found');", true); } }
protected void findButton_Click(object sender, EventArgs e) { VoucherNoTexBox.Text = ""; DataTable dtMoneyReceiptInfo = unitSaleBLObj.dtMoneyReceiptInfo(" AND RECEIPT_DATE BETWEEN '" + fromSaleDateTextBox.Text.Trim() + "' AND '" + toSaleDateTextBox.Text.Trim() + "' AND RECEIPT_TYPE='SL' "); if (dtMoneyReceiptInfo.Rows.Count > 0) { dvGridSurrender.Visible = true; SaleListGridView.DataSource = dtUnitSaleForGrid(dtMoneyReceiptInfo); SaleListGridView.DataBind(); } else { dvGridSurrender.Visible = false; ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "popup", "alert('No Data Found')", true); } }
protected void DRRefNoDropDownList_SelectedIndexChanged(object sender, EventArgs e) { DataTable dtSaleInfoForDRF = unitSaleBLObj.dtGetSaleInfoForDemate(" AND SALE.REG_BK='" + fundCode + "' AND SALE.REG_BR='" + branchCode + "' AND SALE.DRF_REF_NO=" + DRRefNoDropDownList.SelectedValue.ToString()); long totalUnitsQty = unitSaleBLObj.getTotalUnitsForDRF(" AND SALE.REG_BK='" + fundCode + "' AND SALE.REG_BR='" + branchCode + "' AND SALE.DRF_REF_NO=" + DRRefNoDropDownList.SelectedValue.ToString()); DataTable dtSaleInfoWithTrSeq = dtSaleInfoForDRF.Clone(); dtSaleInfoWithTrSeq.Columns.Add("TR_SEQ_NO", typeof(long)); if (dtSaleInfoForDRF.Rows.Count > 0) { SaleListGridView.DataSource = dtSaleInfoWithTrSeq; SaleListGridView.DataBind(); } else { SaleListGridView.DataSource = dtSaleInfoWithTrSeq; SaleListGridView.DataBind(); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('No Data Found');", true); } }
protected void addToListButton_Click(object sender, EventArgs e) { long nextDRReferenceNo = unitSaleBLObj.getNexDRReferenceNumber(" AND SALE.REG_BK='" + fundCode + "'"); DataTable dtSaleInfoForDRF = unitSaleBLObj.dtGetSaleInfoForDRF(" AND SALE.REG_BK='" + fundCode + "' AND SALE.REG_BR='" + branchCode + "' AND SALE.SL_NO BETWEEN " + fromSaleNoTextBox.Text.Trim() + " AND " + toSaleNoTextBox.Text.Trim()); if (dtSaleInfoForDRF.Rows.Count > 0) { SaleListGridView.DataSource = dtSaleInfoForDRF; SaleListGridView.DataBind(); DRFRefNoTextBox.Text = nextDRReferenceNo.ToString(); } else { SaleListGridView.DataSource = dtSaleInfoForDRF; SaleListGridView.DataBind(); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('No Data Found');", true); DRFRefNoTextBox.Text = ""; } }
protected void DRRefNoDropDownList_SelectedIndexChanged(object sender, EventArgs e) { DataTable dtSaleInfoForDRF = unitSaleBLObj.dtGetSaleInfoForDemate(" AND SALE.REG_BK='" + fundCode + "' AND SALE.REG_BR='" + branchCode + "' AND SALE.DRF_REF_NO=" + DRRefNoDropDownList.SelectedValue.ToString()); long totalUnitsQty = unitSaleBLObj.getTotalUnitsForDRF(" AND SALE.REG_BK='" + fundCode + "' AND SALE.REG_BR='" + branchCode + "' AND SALE.DRF_REF_NO=" + DRRefNoDropDownList.SelectedValue.ToString()); DataTable dtSaleInfoWithTrSeq = dtSaleInfoForDRF.Clone(); dtSaleInfoWithTrSeq.Columns.Add("TR_SEQ_NO", typeof(long)); if (dtSaleInfoForDRF.Rows.Count > 0) { DRFNoLabel.Text = dtSaleInfoForDRF.Rows[0]["DRF_ACCEPT_NO"].ToString(); DRNLabel.Text = dtSaleInfoForDRF.Rows[0]["DRF_DRN"].ToString(); DemateAcceptDateLabel.Text = Convert.ToDateTime(dtSaleInfoForDRF.Rows[0]["DRF_ACCEPT_DATE"]).ToString("dd-MMM-yyyy"); FolioNoLabel.Text = dtSaleInfoForDRF.Rows[0]["DRF_REG_FOLIO_NO"].ToString(); CertNoLabel.Text = dtSaleInfoForDRF.Rows[0]["DRF_CERT_NO"].ToString(); DistinctNoToLabel.Text = dtSaleInfoForDRF.Rows[0]["DRF_DISTNCT_NO_TO"].ToString(); DistNoFromLabel.Text = dtSaleInfoForDRF.Rows[0]["DRF_DISTNCT_NO_FROM"].ToString(); TotalUnitLabel.Text = totalUnitsQty.ToString(); SaleListGridView.DataSource = dtSaleInfoWithTrSeq; SaleListGridView.DataBind(); } else { DRFNoLabel.Text = ""; DRNLabel.Text = ""; DemateAcceptDateLabel.Text = ""; TRSeqFromNoTextBox.Text = ""; TransferDateTextBox.Text = ""; FolioNoLabel.Text = ""; CertNoLabel.Text = ""; DistinctNoToLabel.Text = ""; DistNoFromLabel.Text = ""; TotalUnitLabel.Text = ""; SaleListGridView.DataSource = dtSaleInfoWithTrSeq; SaleListGridView.DataBind(); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('No Data Found');", true); } }
protected void fundNameDropDownList_SelectedIndexChanged(object sender, EventArgs e) { if (fundNameDropDownList.SelectedValue.ToString() != "0") { DataTable dtMoneyReceiptInfo = unitSaleBLObj.dtMoneyReceiptInfo(" AND REG_BK='" + fundNameDropDownList.SelectedValue.ToString().ToUpper() + "' AND RECEIPT_DATE BETWEEN '" + fromSaleDateTextBox.Text.Trim() + "' AND '" + toSaleDateTextBox.Text.Trim() + "' AND RECEIPT_TYPE='SL' "); if (dtMoneyReceiptInfo.Rows.Count > 0) { dvGridSurrender.Visible = true; SaleListGridView.DataSource = dtUnitSaleForGrid(dtMoneyReceiptInfo); SaleListGridView.DataBind(); VoucherNoTexBox.Text = unitSaleBLObj.getNexAccountVoucherNo(unitRepBLObj.GetaccountSchema(fundNameDropDownList.SelectedValue.ToString()), "2"); } else { VoucherNoTexBox.Text = ""; dvGridSurrender.Visible = false; ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "popup", "alert('No Data Found')", true); } } else { VoucherNoTexBox.Text = ""; DataTable dtMoneyReceiptInfo = unitSaleBLObj.dtMoneyReceiptInfo(" AND RECEIPT_DATE BETWEEN '" + fromSaleDateTextBox.Text.Trim() + "' AND '" + toSaleDateTextBox.Text.Trim() + "' AND RECEIPT_TYPE='SL' "); if (dtMoneyReceiptInfo.Rows.Count > 0) { dvGridSurrender.Visible = true; SaleListGridView.DataSource = dtUnitSaleForGrid(dtMoneyReceiptInfo); SaleListGridView.DataBind(); } else { dvGridSurrender.Visible = false; ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "popup", "alert('No Data Found')", true); } } }
public void GetAllSaleList() { SaleListGridView.DataSource = _SalesRepository.GetAllSaleList(); SaleListGridView.DataBind(); }
protected void SubmitButton_Click(object sender, EventArgs e) { Hashtable htUpdate = new Hashtable(); try { bool isDupliacteDRFolioNo = unitSaleBLObj.CheckDuplicateSaleRelatedInfo(" AND SALE.REG_BK='" + fundCode + "' AND SALE.DRF_REG_FOLIO_NO='" + RegFolioNoTextBox.Text + "'"); bool isDupliacteDRCertNo = unitSaleBLObj.CheckDuplicateSaleRelatedInfo(" AND SALE.REG_BK='" + fundCode + "' AND SALE.DRF_CERT_NO ='" + CertNoTextBox.Text + "'"); bool isDupliacteDRDistinctiveNo = unitSaleBLObj.CheckDuplicateSaleRelatedInfo("AND ((SALE.DRF_DISTNCT_NO_FROM BETWEEN " + DistinctNoFromTextBox.Text.Trim().ToString() + " AND " + DistinctNoToTextBox.Text.Trim().ToString() + ") AND (SALE.REG_BK = '" + fundCode + "') OR (SALE.DRF_DISTNCT_NO_TO BETWEEN " + DistinctNoFromTextBox.Text.Trim().ToString() + " AND " + DistinctNoToTextBox.Text.Trim().ToString() + ") AND (SALE.REG_BK = '" + fundCode + "'))"); if (isDupliacteDRFolioNo) { ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due to Duplicate Folio number');", true); } else if (isDupliacteDRCertNo) { ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due to Duplicate Certificate number');", true); } else if (isDupliacteDRDistinctiveNo) { ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due to Duplicate Distinctive number');", true); } else if (((Convert.ToInt64(DistinctNoToTextBox.Text.Trim().ToString()) - Convert.ToInt64(DistinctNoFromTextBox.Text.Trim().ToString()) + 1)) != Convert.ToInt64(TotalUnitsTextBox.Text.Trim().ToString())) { ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due to Distinctive Range and Total Units is not Eqqaul');", true); } else { commonGatewayObj.BeginTransaction(); htUpdate = new Hashtable(); htUpdate.Add("DRF_CUST_REQ_BY", userObj.UserID.ToString()); htUpdate.Add("DRF_CUST_REQ_DATE", DateTime.Now); htUpdate.Add("DRF_REG_FOLIO_NO", RegFolioNoTextBox.Text.Trim().ToString()); htUpdate.Add("DRF_CERT_NO", CertNoTextBox.Text.Trim().ToString()); htUpdate.Add("DRF_DISTNCT_NO_FROM", DistinctNoFromTextBox.Text.Trim().ToString()); htUpdate.Add("DRF_DISTNCT_NO_TO", DistinctNoToTextBox.Text.Trim().ToString()); commonGatewayObj.Update(htUpdate, "SALE", "REG_BK='" + fundCode.ToUpper().ToString() + "' AND REG_BR='" + branchCode.ToUpper().ToString() + "' AND SALE.DRF_REF_NO=" + DRRefNoDropDownList.SelectedValue.ToString()); commonGatewayObj.CommitTransaction(); DRRefNoDropDownList.DataSource = unitSaleBLObj.dtDRRefNoListForCustodian("AND SALE.REG_BK='" + fundCode + "'"); DRRefNoDropDownList.DataTextField = "NAME"; DRRefNoDropDownList.DataValueField = "ID"; DRRefNoDropDownList.DataBind(); RegFolioNoTextBox.Text = ""; CertNoTextBox.Text = ""; DistinctNoFromTextBox.Text = ""; DistinctNoToTextBox.Text = ""; TotalUnitsTextBox.Text = ""; DataTable dtSaleInfoForDRF = unitSaleBLObj.dtGetSaleInfoForDemate(" AND SALE.REG_BK='" + fundCode + "' AND SALE.REG_BR='" + branchCode + "' AND SALE.DRF_REF_NO=0"); SaleListGridView.DataSource = dtSaleInfoForDRF; SaleListGridView.DataBind(); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('Save Successfully');", true); } } catch (Exception ex) { commonGatewayObj.RollbackTransaction(); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due to Error:" + ex.Message.ToString() + "');", true); } }