protected void btnDelete_Click(object sender, EventArgs e) { Result oResult = null; try { if (string.IsNullOrEmpty(hdnClaimTransNo.Value)) { ucMessage.OpenMessage("Please select a valid Interest Claim for delete.", Constants.MSG_TYPE_INFO); ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true); } else { InterestClaimDAL iClaimDAL = new InterestClaimDAL(); oResult = iClaimDAL.DeleteInterestClaim(hdnClaimTransNo.Value); if (oResult.Status) { ucMessage.OpenMessage("Interest Claim data deleted successfully.", Constants.MSG_APPROVED_SAVE_DATA); ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true); btnReset_Click(sender, e); } else { ucMessage.OpenMessage("Error: " + oResult.Message, Constants.MSG_TYPE_INFO); ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true); } } } catch (Exception ex) { ucMessage.OpenMessage("Error: " + ex.Message, Constants.MSG_TYPE_INFO); ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true); } }
public bool IsValidateData() { bool bResult = false; InterestClaimDAL oIcDAL = new InterestClaimDAL(); Result oResult = new Result(); oResult = oIcDAL.GetReportFormat(ddlSpType.SelectedValue); int iRepFrmt = -1; if (oResult.Status) { iRepFrmt = (int)oResult.Return; } if (iRepFrmt == (int)SBM_BLV1.baseCommon.enmInterestClaimReportFormat.WDB || iRepFrmt == (int)SBM_BLV1.baseCommon.enmInterestClaimReportFormat.DollarBond) { // single Trans ID is needed bResult = IsSingleSelected(true); } else if (iRepFrmt == (int)SBM_BLV1.baseCommon.enmInterestClaimReportFormat.SP || iRepFrmt == (int)SBM_BLV1.baseCommon.enmInterestClaimReportFormat.SP1) { // no need to single Trans data bResult = true; } return(bResult); }
public bool SaveAndPreviewAction() { Config oConfig = (Config)Session[Constants.SES_USER_CONFIG]; if (oConfig != null) { if (IsValidateData()) { pnlMsg.Visible = false; DataTable dtInterestClaim = GetDataTable(); if (dtInterestClaim.Rows.Count > 0) { CalculateInterestClaim(); #region 03. GetObject ... Get Value SBM_BLC1.Entity.Claim.InterestClaim oIClaim = GetObject(); #endregion 03. GetObject ... Get Value #region 04. Call and verify.. InterestClaimDAL iClaimDAL = new InterestClaimDAL(); Result oResult = iClaimDAL.InsertData(oIClaim, dtInterestClaim); if (!oResult.Status) { ucMessage.OpenMessage(Constants.MSG_ERROR_SAVE, Constants.MSG_TYPE_ERROR); ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true); return(false); } txtReferenceNo.Text = oResult.Return as string; #endregion 04. Call and varify.. #region 05. for preview Preview(oIClaim); #endregion 05. for preview } else { ucMessage.OpenMessage("Select at least one registration to save & print Interest claim.", Constants.MSG_TYPE_INFO); ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true); return(false); } } else { ucMessage.OpenMessage("Please select a single transaction for Interest claim.", Constants.MSG_TYPE_INFO); ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true); return(false); } return(true); } return(false); }
public double CalculateRemuneration(bool status) { string sTransNos = GetInterestPaymentTransNo("", status); double dRemuneration = 0; if (sTransNos.Length > 0) { InterestClaimDAL icDAL = new InterestClaimDAL(); dRemuneration = icDAL.CalculateRemuneration(sTransNos); } return(dRemuneration); }
private void CalculateInterestClaim() { decimal dCalInterest = 0; decimal dIncomeTax = 0; int iSelectedCount = 0; string sRegNo = ""; foreach (GridViewRow gvr in gvData.Rows) { CheckBox chk = (CheckBox)gvr.FindControl("chkSelected"); if (chk != null) { if (chk.Checked) { dCalInterest += Util.GetDecimalNumber(gvr.Cells[7].Text);//Payment Amount to be calculated dIncomeTax += Util.GetDecimalNumber(gvr.Cells[6].Text); sRegNo = Convert.ToString(gvr.Cells[1].Text).Trim(); iSelectedCount++; } } } InterestClaimDAL intClaimDAL = new InterestClaimDAL(); Result cdresult = intClaimDAL.GetConversionDetails(sRegNo); string sCCY = "00"; decimal dRate = 1; if (cdresult.Status) { DataTable dtConversionCCY = (DataTable)cdresult.Return; sCCY = Convert.ToString(dtConversionCCY.Rows[0]["CurrencyID"]); dRate = Convert.ToDecimal(dtConversionCCY.Rows[0]["ConvRate"]); } DDListUtil.Assign(ddlConversionCurrency, sCCY); ddlConversionCurrency.Enabled = false; txtConversionRate.Text = dRate.ToString("N2"); txtConversionRate.Enabled = false; #region Assign Data in calculation field set txtSelectCount.Text = "TOTAL SELECTED " + iSelectedCount.ToString() + " OF " + gvData.Rows.Count; txtTotalIncomeTax1.Text = dIncomeTax.ToString("N2"); txtRemuneration.Text = CalculateRemuneration(false).ToString("N2"); txtTotalIncomeTax2.Text = (CalculateConvertedAmount(dIncomeTax, Util.GetDecimalNumber(txtConversionRate.Text))).ToString("N2"); txtTotalInterest1.Text = (dCalInterest).ToString("N2"); txtTotalInterest2.Text = CalculateConvertedAmount(dCalInterest, Util.GetDecimalNumber(txtConversionRate.Text)).ToString("N2"); #endregion }
private void FillIntPaymentDetailGrid(string sInterestClaimTransNo) { InterestClaimDAL intClaimDAL = new InterestClaimDAL(); ClaimDAL claimDAL = new ClaimDAL(); Config oConfig = (Config)Session[Constants.SES_USER_CONFIG]; /////Currency Update string sCurrecncyCriteria = " INNER JOIN (SELECT TOP (1) PolicyID, MAX(PolicyEffectDate) AS PolicyEffectDate FROM SPMS_SPPolicy WHERE (SPTypeID = '" + ddlSpType.SelectedValue + "') GROUP BY PolicyID ORDER BY PolicyEffectDate DESC) AS b INNER JOIN SPMS_SPCurrencyPolicy ON b.PolicyID = SPMS_SPCurrencyPolicy.PolicyID ON a.CurrencyID = SPMS_SPCurrencyPolicy.CurrencyID "; sCurrecncyCriteria += " WHERE (SPMS_SPCurrencyPolicy.ActivityType = " + (int)Constants.ACTIVITY_TYPE.INTEREST_CLAIM + ")"; DataTable dtCurrencySource = claimDAL.GetCurrencySource(sCurrecncyCriteria); if (dtCurrencySource != null) { ddlConversionCurrency.DataSource = dtCurrencySource; ddlConversionCurrency.DataTextField = "DisplayMember"; ddlConversionCurrency.DataValueField = "ValueMember"; ddlConversionCurrency.DataBind(); ddlConversionCurrency.Enabled = false; } string sSPCurrency = ViewState[_SPTYPE_CUREENCY] as string; if (string.IsNullOrEmpty(sSPCurrency)) { sSPCurrency = claimDAL.GetSPCurrency(ddlSpType.SelectedValue); } ViewState[_SPTYPE_CUREENCY] = sSPCurrency;//claimDAL.GetSPCurrency(ddlSpType.SelectedValue); LoadCurrencyData(); //// string reportType = ""; reportType = ddlReportCategory.SelectedValue; Result oResult = intClaimDAL.GetInterestClaimData(ddlSpType.SelectedValue, Util.GetDateTimeByString(txtPaymentDateFrom.Text), Util.GetDateTimeByString(txtPaymentDateTo.Text), reportType, sInterestClaimTransNo, oConfig.DivisionID, oConfig.BankCodeID); if (oResult.Status) { DataTable dtIntClaim = oResult.Return as DataTable; if (dtIntClaim != null && dtIntClaim.Rows.Count > 0) { hdnGridTotal.Value = dtIntClaim.Rows.Count.ToString(); dtIntClaim.Columns.Remove("CurrencyID"); dtIntClaim.Columns.Remove("InterestRate"); dtIntClaim.Columns.Remove("PaidInterestA"); dtIntClaim.Columns.Remove("IncomeTaxA"); dtIntClaim.Columns.Remove("PaymentAmountA"); gvData.DataSource = dtIntClaim; gvData.DataBind(); DDListUtil.Assign(ddlConversionCurrency, Convert.ToString(dtIntClaim.Rows[0]["PCurrencyID"])); if (ddlConversionCurrency.SelectedIndex.Equals(0)) { ucMessage.OpenMessage("Please assign currency in Policy Setup for Interest Claim.", Constants.MSG_TYPE_INFO); ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true); } txtConversionRate.Text = Convert.ToString(dtIntClaim.Rows[0]["PConvRate"]); txtConversionRate.Enabled = false; if (!string.IsNullOrEmpty(sInterestClaimTransNo)) { foreach (GridViewRow gvr in gvData.Rows) { CheckBox chk = (CheckBox)gvr.FindControl("chkSelected"); if (chk != null) { chk.Checked = true; chk.Enabled = false; } } txtSelectCount.Text = "TOTAL SELECTED " + dtIntClaim.Rows.Count + " OF " + dtIntClaim.Rows.Count; } else { txtSelectCount.Text = "TOTAL SELECTED 0 OF " + dtIntClaim.Rows.Count; } } } }