protected void showReportButton_Click(object sender, EventArgs e) { StringBuilder sbFilter = new StringBuilder(); sbFilter.Append(" 1=1 "); commonGatewayObj.DeleteByCommand(" ASSET_VALUE", sbFilter.ToString()); commonGatewayObj.CommitTransaction(); InsertAssetValue(); dvGridFund.Visible = false; string transactionDate = transactionDateTextBox.Text.ToString(); string percentageCheck = percentageTextBox.Text.ToString(); StringBuilder sb = new StringBuilder(); sb.Append("window.open('ReportViewer/AssetPercentageCheckReportViewer.aspx?transactionDate=" + transactionDate + "&percentageCheck=" + percentageCheck + "');"); ClientScript.RegisterStartupScript(this.GetType(), "ReportViwer", sb.ToString(), true); }
public void DeleteSaleEditInfo(UnitHolderRegistration unitRegObj, UnitSale unitSaleObj, DataTable dtDinomination, UnitUser unitUserObj) { Hashtable htUnitSale = new Hashtable(); Hashtable htUnitSaleCert = new Hashtable(); Hashtable htCertNoTemp = new Hashtable(); string certificate = ""; try { commonGatewayObj.BeginTransaction(); htCertNoTemp.Add("REG_BK", unitRegObj.FundCode.ToString().ToUpper()); htCertNoTemp.Add("REG_BR", unitRegObj.BranchCode.ToString()); htCertNoTemp.Add("REG_NO", unitRegObj.RegNumber.ToString()); htCertNoTemp.Add("SL_NO", Convert.ToInt32(unitSaleObj.SaleNo.ToString())); htCertNoTemp.Add("SL_DT", Convert.ToDateTime(unitSaleObj.SaleDate).ToString("dd-MMM-yyyy")); htCertNoTemp.Add("SL_PRICE", Convert.ToDecimal(unitSaleObj.SaleRate.ToString())); htCertNoTemp.Add("QTY", Convert.ToInt32(unitSaleObj.SaleUnitQty.ToString())); htCertNoTemp.Add("SL_TYPE", unitSaleObj.SaleType.ToString().ToUpper()); if (!(unitSaleObj.MoneyReceiptNo.ToString() == "0")) { htCertNoTemp.Add("MONY_RECT_NO", Convert.ToInt32(unitSaleObj.MoneyReceiptNo)); } else { htCertNoTemp.Add("MONY_RECT_NO", DBNull.Value); } if (unitSaleObj.PaymentType != null) { htCertNoTemp.Add("PAY_TYPE", unitSaleObj.PaymentType); } else { htCertNoTemp.Add("PAY_TYPE", DBNull.Value); } if (unitSaleObj.ChequeNo != null) { htCertNoTemp.Add("CHQ_DD_NO", unitSaleObj.ChequeNo); } else { htCertNoTemp.Add("CHQ_DD_NO", DBNull.Value); } if (unitSaleObj.ChequeDate == null || unitSaleObj.ChequeDate == "") { htCertNoTemp.Add("CHEQUE_DT", DBNull.Value); } else { htCertNoTemp.Add("CHEQUE_DT", Convert.ToDateTime(unitSaleObj.ChequeDate).ToString("dd-MMM-yyyy")); } if (!(unitSaleObj.BankCode.ToString() == "0")) { htCertNoTemp.Add("BANK_CODE", Convert.ToInt16(unitSaleObj.BankCode)); } else { htCertNoTemp.Add("BANK_CODE", DBNull.Value); } if (!(unitSaleObj.BranchCode.ToString() == "0")) { htCertNoTemp.Add("BRANCH_CODE", Convert.ToInt16(unitSaleObj.BranchCode)); } else { htCertNoTemp.Add("BRANCH_CODE", DBNull.Value); } if (!(unitSaleObj.CashAmount.ToString() == null)) { htCertNoTemp.Add("CASH_AMT", Convert.ToDecimal(unitSaleObj.CashAmount)); } else { htCertNoTemp.Add("CASH_AMT", DBNull.Value); } if (unitSaleObj.MultiPayType != null) { htCertNoTemp.Add("MULTI_PAY_REMARKS", unitSaleObj.MultiPayType); } else { htCertNoTemp.Add("MULTI_PAY_REMARKS", DBNull.Value); } if (dtDinomination.Rows.Count > 0) { for (int looper = 0; looper < dtDinomination.Rows.Count; looper++) { if (certificate == "") { certificate = SaleCertNo(Convert.ToInt32(dtDinomination.Rows[looper]["CERT_NO"].ToString()), dtDinomination.Rows[looper]["CERT_TYPE"].ToString().ToUpper()); } else { certificate = certificate + "," + SaleCertNo(Convert.ToInt32(dtDinomination.Rows[looper]["CERT_NO"].ToString()), dtDinomination.Rows[looper]["CERT_TYPE"].ToString().ToUpper()); } } } if (certificate != "") { htCertNoTemp.Add("CERTIFICATE", certificate); } else { htCertNoTemp.Add("CERTIFICATE", DBNull.Value); } htCertNoTemp.Add("USER_NM", unitUserObj.UserID.ToString()); htCertNoTemp.Add("ENT_TM", DateTime.Now.ToShortTimeString().ToString()); htCertNoTemp.Add("ENT_DT", DateTime.Now.ToString()); htCertNoTemp.Add("EDIT_TYPE", "D"); commonGatewayObj.Insert(htCertNoTemp, "SALE_ED_INFO"); commonGatewayObj.DeleteByCommand("SALE", " SL_NO=" + unitSaleObj.SaleNo + " AND REG_BR='" + unitRegObj.BranchCode.ToString() + "' AND REG_BK='" + unitRegObj.FundCode.ToString() + "' AND REG_NO=" + Convert.ToInt32(unitRegObj.RegNumber)); commonGatewayObj.DeleteByCommand("SALE_CERT", " SL_NO=" + unitSaleObj.SaleNo + " AND REG_BR='" + unitRegObj.BranchCode.ToString() + "' AND REG_BK='" + unitRegObj.FundCode.ToString() + "' AND REG_NO=" + Convert.ToInt32(unitRegObj.RegNumber)); commonGatewayObj.CommitTransaction(); } catch (Exception ex) { commonGatewayObj.RollbackTransaction(); throw ex; } }