예제 #1
0
        private void LoadPreviousList()
        {
            InterestReimbursementDAL oIntReimburDAL = new InterestReimbursementDAL();
            Config oConfig = (Config)Session[Constants.SES_USER_CONFIG];
            Result oResult = oIntReimburDAL.LoadUnapprovedList(oConfig.UserName, false, oConfig.DivisionID, oConfig.BankCodeID);

            gvData.DataSource = null;
            gvData.DataBind();
            if (oResult.Status)
            {
                DataTable dtTmpList = (DataTable)oResult.Return;
                if (dtTmpList != null)
                {
                    if (dtTmpList.Rows.Count > 0)
                    {
                        dtTmpList.Columns.Remove("Maker ID");

                        gvData.DataSource = dtTmpList;
                        gvData.DataBind();

                        Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpList;
                    }
                }
            }
        }
예제 #2
0
        protected void btnApprove_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtBBReferenceNo.Text))
            {
                InterestReimbursement    oIntReim = Session[Constants.SES_INTE_RECON] as InterestReimbursement;
                InterestReimbursementDAL oInterestReimbursementDAL = new InterestReimbursementDAL();

                //get User Details
                oIntReim.UserDetails = ucUserDet.UserDetail;

                Result oResult = (Result)oInterestReimbursementDAL.Approve(oIntReim);
                if (oResult.Status)
                {
                    ucMessage.OpenMessage(Constants.MSG_SUCCESS_APPROVE, Constants.MSG_TYPE_SUCCESS);
                }
                else
                {
                    ucMessage.OpenMessage(Constants.MSG_ERROR_APPROVE, Constants.MSG_TYPE_ERROR);
                }
            }
            else
            {
                ucMessage.OpenMessage(Constants.MSG_ERROR_APPROVE, Constants.MSG_TYPE_ERROR);
            }
        }
예제 #3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            InterestReimbursement oInterestReimbursement = (InterestReimbursement)Session[Constants.SES_INTE_RECON];

            if (oInterestReimbursement != null)
            {
                oInterestReimbursement.InterestReimburseTransNo     = hdnInterestReimburseTransNo.Value.Equals("") ? "-1" : hdnInterestReimburseTransNo.Value;
                oInterestReimbursement.InterestReimburseReferenceNo = txtBBReferenceNo.Text.Trim().ToUpper();
                oInterestReimbursement.SPType.SPTypeID     = ddlSpType.SelectedValue;
                oInterestReimbursement.ReimburseDate       = DateTime.Now;
                oInterestReimbursement.Currency.CurrencyID = ddlReconCurrency.SelectedValue;
                oInterestReimbursement.ConvRate            = Util.GetDecimalNumber(txtReimConvRate.Text);
                oInterestReimbursement.ConvRateToBC        = Util.GetDecimalNumber(txtCovRateToBC.Text);
                oInterestReimbursement.ClaimAmount         = Util.GetDecimalNumber(txtTotInterest.Text);
                oInterestReimbursement.ReconAmount         = Util.GetDecimalNumber(txtTotRecInt.Text);
                oInterestReimbursement.Remuneration        = Util.GetDecimalNumber(txtTotRemuneration.Text);
                oInterestReimbursement.BBAmount            = Util.GetDecimalNumber(txtBBAmount.Text);

                decimal dIR = 0;
                decimal dDR = 0;
                object  obj = oInterestReimbursement.DtInteClaimReimbursement.Compute("SUM(ReconAmount)", "");
                dIR = !DBNull.Value.Equals(obj) ? Convert.ToDecimal(obj) : 0;

                obj = 0;
                obj = oInterestReimbursement.DtIntePaymentDetails.Compute("SUM(ReconAmount)", "");
                dDR = !DBNull.Value.Equals(obj) ? Convert.ToDecimal(obj) : 0;

                if (dIR != dDR)
                {
                    ucMessage.OpenMessage("Claim recon details and payment recon details mismatched. May have manual journal. Please check..", Constants.MSG_TYPE_ERROR);
                    return;
                }

                oInterestReimbursement.UserDetails = ucUserDet.UserDetail;
                InterestReimbursementDAL oInterestReimbursementDAL = new InterestReimbursementDAL();
                Result oResult = oInterestReimbursementDAL.Save(oInterestReimbursement);
                if (oResult.Status)
                {
                    LoadPreviousList();
                    TotalClear();
                    ucMessage.OpenMessage(Constants.MSG_SUCCESS_SAVE, Constants.MSG_TYPE_SUCCESS);
                }
                else
                {
                    if (oResult.Message.Equals("A"))
                    {
                        ucMessage.OpenMessage("This BB Reference No. already used. Please check..", Constants.MSG_TYPE_ERROR);
                    }
                    else
                    {
                        ucMessage.OpenMessage(Constants.MSG_ERROR_SAVE, Constants.MSG_TYPE_ERROR);
                    }
                }
            }
        }
예제 #4
0
        private void LoadDataByReferenceNo(string sBBRefNo, string sApprovalStatus)
        {
            Config oConfig = (Config)Session[Constants.SES_USER_CONFIG];
            InterestReimbursementDAL oInterestReimbursementDAL = new InterestReimbursementDAL();
            Result oResult = oInterestReimbursementDAL.GetInteClaimReimburseStatementByBBRefNo(sBBRefNo, sApprovalStatus, oConfig.DivisionID, oConfig.BankCodeID);

            if (oResult.Status)
            {
                SetObject(oResult.Return as InterestReimbursement);
            }
        }
예제 #5
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     //if (!hdDataType.Value.Equals("2"))
     //{
     if (!string.IsNullOrEmpty(hdnInterestReimburseTransNo.Value))
     {
         InterestReimbursementDAL oIntReimDAL = new InterestReimbursementDAL();
         Result oResult = (Result)oIntReimDAL.Detete(hdnInterestReimburseTransNo.Value);
         if (oResult.Status)
         {
             TotalClear();
             LoadPreviousList();
             ucMessage.OpenMessage(Constants.MSG_SUCCESS_DELETE, Constants.MSG_TYPE_SUCCESS);
         }
         else
         {
             if (oResult.Message.Equals(Constants.TABLE_MAIN))
             {
                 ucMessage.OpenMessage(Constants.MSG_APPROVED_DELETE_DATA, Constants.MSG_TYPE_ERROR);
             }
             else
             {
                 ucMessage.OpenMessage(Constants.MSG_ERROR_DELETE, Constants.MSG_TYPE_ERROR);
             }
         }
     }
     //}
     //else
     //{
     //    ucMessage.OpenMessage(Constants.MSG_ERROR_DELETE, Constants.MSG_TYPE_ERROR);
     //}
     //}
     //else
     //{
     //    ucMessage.OpenMessage(Constants.MSG_APPROVED_DELETE_DATA, Constants.MSG_TYPE_INFO);
     //    ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true);
     //}
 }
예제 #6
0
        protected void btnReject_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtBBReferenceNo.Text))
            {
                InterestReimbursement oIntReim = new InterestReimbursement();
                oIntReim.InterestReimburseReferenceNo = txtBBReferenceNo.Text;
                InterestReimbursementDAL oIntReimDAL = new InterestReimbursementDAL();
                oIntReim.UserDetails = ucUserDet.UserDetail;

                Result oResult = (Result)oIntReimDAL.Reject(oIntReim);
                if (oResult.Status)
                {
                    ucMessage.OpenMessage(Constants.MSG_SUCCESS_REJECT, Constants.MSG_TYPE_SUCCESS);
                }
                else
                {
                    ucMessage.OpenMessage(Constants.MSG_ERROR_REJECT, Constants.MSG_TYPE_ERROR);
                }
            }
            else
            {
                ucMessage.OpenMessage(Constants.MSG_ERROR_REJECT, Constants.MSG_TYPE_ERROR);
            }
        }
예제 #7
0
        private void Populate_PaymentDetails(string sClaimRefNo)
        {
            InterestReimbursement oInterestReimbursement = (InterestReimbursement)Session[Constants.SES_INTE_RECON];

            if (oInterestReimbursement == null)
            {
                oInterestReimbursement = new InterestReimbursement();
            }
            DataTable dtPaymentDetails = oInterestReimbursement.DtIntePaymentDetails;

            if (dtPaymentDetails.Columns.Count <= 0)
            {
                dtPaymentDetails.Columns.Add(new DataColumn("ClaimRefNo", typeof(string)));
                dtPaymentDetails.Columns.Add(new DataColumn("RegNo", typeof(string)));
                dtPaymentDetails.Columns.Add(new DataColumn("PaymentDate", typeof(string)));
                dtPaymentDetails.Columns.Add(new DataColumn("ClaimAmount", typeof(decimal)));
                dtPaymentDetails.Columns.Add(new DataColumn("ReconAmount", typeof(decimal)));
                //saving in DB purpose. This is hidden in design
                dtPaymentDetails.Columns.Add(new DataColumn("InterestClaimTransNo", typeof(string)));
                dtPaymentDetails.Columns.Add(new DataColumn("IntPaymentTransNo", typeof(string)));
                dtPaymentDetails.Columns.Add(new DataColumn("Narration", typeof(string)));
                dtPaymentDetails.Columns.Add(new DataColumn("AccountNo", typeof(string)));
                dtPaymentDetails.TableName = "IntPaymentDetails";
            }
            DataRow[] rows = dtPaymentDetails.Select("ClaimRefNo='" + sClaimRefNo + "'");

            if (rows.Length <= 0)
            {
                InterestReimbursementDAL oInterestReimbursementDAL = new InterestReimbursementDAL();
                Config    oConfig        = (Config)Session[Constants.SES_USER_CONFIG];
                Result    oResult        = oInterestReimbursementDAL.GetIntePaymentDetailsByClaimTransNo(sClaimRefNo, oConfig.DivisionID, oConfig.BankCodeID);
                DataTable dtTmpPayDetail = null;
                if (oResult.Status)
                {
                    dtTmpPayDetail = oResult.Return as DataTable;
                }
                for (int i = 0; i < dtTmpPayDetail.Rows.Count; i++)
                {
                    DataRow r = dtPaymentDetails.NewRow();
                    r["ClaimRefNo"]           = dtTmpPayDetail.Rows[i]["ClaimRefNo"];
                    r["RegNo"]                = dtTmpPayDetail.Rows[i]["RegNo"];
                    r["PaymentDate"]          = Convert.ToDateTime(dtTmpPayDetail.Rows[i]["PaymentDate"]).ToString("dd-MMM-yyyy");
                    r["ClaimAmount"]          = dtTmpPayDetail.Rows[i]["ClaimAmount"];
                    r["ReconAmount"]          = dtTmpPayDetail.Rows[i]["ReconAmount"];
                    r["InterestClaimTransNo"] = dtTmpPayDetail.Rows[i]["InterestClaimTransNo"];
                    r["IntPaymentTransNo"]    = dtTmpPayDetail.Rows[i]["IntPaymentTransNo"];
                    r["Narration"]            = dtTmpPayDetail.Rows[i]["Narration"];
                    r["AccountNo"]            = dtTmpPayDetail.Rows[i]["AccountNo"];

                    dtPaymentDetails.Rows.Add(r);
                }
            }
            DataView dv = new DataView();

            dv.Table     = dtPaymentDetails;
            dv.RowFilter = "ClaimRefNo='" + sClaimRefNo + "'";

            gvIntClaimDetail.DataSource = dv;
            gvIntClaimDetail.DataBind();

            Calculate_PaymentDetails(oInterestReimbursement, sClaimRefNo);
        }
예제 #8
0
        protected void txtClaimRefNo_TextChanged(object sender, EventArgs e)
        {
            Config oConfig       = (Config)Session[Constants.SES_USER_CONFIG];
            bool   isRefNoFrmtOk = false;
            string sRefNo        = txtClaimRefNo.Text.Trim();

            //string[] aRefNo = sRefNo.Split('/');
            //if (aRefNo.Length.Equals(4))
            //{
            //    isRefNoFrmtOk = true;
            //}
            if (!string.IsNullOrEmpty(ddlSpType.SelectedValue) && !string.IsNullOrEmpty(ddlYear.SelectedValue))
            {
                //sRefNo = ddlSpType.SelectedValue + "/ABC/" + sRefNo + "/" + ddlYear.SelectedValue;
                txtClaimRefNo.Text = sRefNo;
                isRefNoFrmtOk      = true;
            }
            if (isRefNoFrmtOk)
            {
                int iIndx = -1;
                InterestReimbursement oIntReim = (InterestReimbursement)Session[Constants.SES_INTE_RECON];
                if (oIntReim != null)
                {
                    DataTable dtClaimDetails = oIntReim.DtInteClaimReimbursement;
                    DataRow[] rows           = dtClaimDetails.Select("ClaimRefNo='" + txtClaimRefNo.Text + "'");
                    foreach (var vClaimDtl in rows)
                    {
                        iIndx = dtClaimDetails.Rows.IndexOf(vClaimDtl);
                        if ((gvClaim.Rows.Count > iIndx))
                        {
                            GridViewRow gvRow = gvClaim.Rows[iIndx];
                            SetInterestClaimDetails(gvRow);
                        }
                        break;
                    }
                }
                if (iIndx.Equals(-1))
                {
                    InterestReimbursementDAL oInterestReimbursementDAL = new InterestReimbursementDAL();
                    Result oResult = oInterestReimbursementDAL.GetInteClaimStatementByClaimRefNo(txtClaimRefNo.Text.Trim(), oConfig.DivisionID, oConfig.BankCodeID);
                    if (oResult.Status)
                    {
                        DataTable dtIntersetClaim = oResult.Return as DataTable;
                        if (dtIntersetClaim.Rows.Count > 0)
                        {
                            DDListUtil.Assign(ddlSpType, DB.GetDBValue(dtIntersetClaim.Rows[0]["SPTypeID"]));
                            txtClaimDate.Text     = (Date.GetDateTimeByString(dtIntersetClaim.Rows[0]["StatementDate"].ToString())).ToString(Constants.DATETIME_FORMAT);
                            txtClaimDateFrom.Text = (Date.GetDateTimeByString(dtIntersetClaim.Rows[0]["FromDate"].ToString())).ToString(Constants.DATETIME_FORMAT);
                            txtClaimDateTo.Text   = (Date.GetDateTimeByString(dtIntersetClaim.Rows[0]["ToDate"].ToString())).ToString(Constants.DATETIME_FORMAT);
                            txtClaimCurrncy.Text  = DB.GetDBValue(dtIntersetClaim.Rows[0]["CurrencyCode"]);
                            txtClaimCurrncy.Attributes["CurrencyID"] = DB.GetDBValue(dtIntersetClaim.Rows[0]["CurrencyID"]);
                            txtConvRate.Text = DB.GetDBValue(dtIntersetClaim.Rows[0]["ConvRate"]);

                            txtReimConvRate.Text = "1.0000";
                            txtCovRateToBC.Text  = "1.0000";

                            txtInterest.Text              = DB.GetDBValue(dtIntersetClaim.Rows[0]["InterestAmount"]);
                            txtRemuneration.Text          = DB.GetDBValue(dtIntersetClaim.Rows[0]["Remuneration"]);
                            hdnInterestClaimTransNo.Value = DB.GetDBValue(dtIntersetClaim.Rows[0]["InterestClaimTransNo"]);
                        }
                        else
                        {
                            ucMessage.OpenMessage("Invalid reference number !!", Constants.MSG_TYPE_INFO);
                            ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true);
                            ClearInterestClaimSection();
                        }
                    }
                    else
                    {
                        ucMessage.OpenMessage(oResult.Message, Constants.MSG_TYPE_INFO);
                        ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true);
                        ClearInterestClaimSection();
                    }
                }

                btnAdd.Focus();
            }
            else
            {
                ucMessage.OpenMessage("Please select SP Type and Year.", Constants.MSG_TYPE_INFO);
                ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true);
                ClearInterestClaimSection();
            }
        }
예제 #9
0
        protected void SearchAction()
        {
            string sType   = Request.QueryString["pType"];
            Config oConfig = (Config)Session[Constants.SES_USER_CONFIG];

            gvData.DataSource = null;
            gvData.DataBind();

            if (!string.IsNullOrEmpty(sType))
            {
                Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = new DataTable();

                #region Recon Sales Statement
                if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_RECON.SALES_STATEMENT).PadLeft(5, '0')))
                {
                    lgText.InnerHtml = "Reconciliantion Sales Statement Approval Queue List";
                    SaleStatementReconDAL oSaleStatmentReconDAL = new SaleStatementReconDAL();
                    TemplateBuilder       tbGvData = new TemplateBuilder();
                    tbGvData.AppendLiteralString("No 'Reconciliantion Sale Statement' record found");
                    gvData.EmptyDataTemplate = tbGvData;

                    Result    oResult           = oSaleStatmentReconDAL.LoadUnapprovedList(null, true, oConfig.DivisionID, oConfig.BankCodeID);
                    DataTable dtTmpCurrencyList = (DataTable)oResult.Return;
                    if (dtTmpCurrencyList != null)
                    {
                        gvData.DataSource = dtTmpCurrencyList;
                        gvData.DataBind();
                        Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpCurrencyList;
                    }
                }
                #endregion Recon Sales Statement

                #region Recon Commission Claim
                else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_RECON.COMMISSION).PadLeft(5, '0')))
                {
                    lgText.InnerHtml = "Reconciliantion Commission Claim Approval Queue List";
                    CommClaimReconciliationDAL oCommClaimRecDAL = new CommClaimReconciliationDAL();
                    TemplateBuilder            tbGvData         = new TemplateBuilder();
                    tbGvData.AppendLiteralString("No 'Reconciliantion Commission Claim' record found");
                    gvData.EmptyDataTemplate = tbGvData;

                    Result    oResult           = oCommClaimRecDAL.LoadUnapprovedList(null, true, oConfig.DivisionID, oConfig.BankCodeID);
                    DataTable dtTmpCurrencyList = (DataTable)oResult.Return;
                    if (dtTmpCurrencyList != null)
                    {
                        gvData.DataSource = dtTmpCurrencyList;
                        gvData.DataBind();
                        Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpCurrencyList;
                    }
                }
                #endregion

                #region Recon Interest Claim
                else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_RECON.INTEREST).PadLeft(5, '0')))
                {
                    lgText.InnerHtml = "Reconciliantion Interest Claim Approval Queue List";
                    InterestReimbursementDAL oIntReimDAL = new InterestReimbursementDAL();
                    TemplateBuilder          tbGvData    = new TemplateBuilder();
                    tbGvData.AppendLiteralString("No 'Reconciliantion Interest Claim' record found");
                    gvData.EmptyDataTemplate = tbGvData;

                    Result    oResult = oIntReimDAL.LoadUnapprovedList(null, true, oConfig.DivisionID, oConfig.BankCodeID);
                    DataTable dtTmpIssueUpdateList = (DataTable)oResult.Return;
                    if (dtTmpIssueUpdateList != null)
                    {
                        gvData.DataSource = dtTmpIssueUpdateList;
                        gvData.DataBind();
                        Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpIssueUpdateList;
                    }
                }
                #endregion

                #region Recon Encashment Claim
                else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_RECON.ENCASHMENT).PadLeft(5, '0')))
                {
                    lgText.InnerHtml = "Reconciliantion Encashment Claim Approval Queue List";
                    EncashmentReimbursementDAL oEncashReimDAL = new EncashmentReimbursementDAL();
                    TemplateBuilder            tbGvData       = new TemplateBuilder();
                    tbGvData.AppendLiteralString("No 'Reconciliantion Encashment Claim' record found");
                    gvData.EmptyDataTemplate = tbGvData;

                    Result    oResult = oEncashReimDAL.LoadUnapprovedList(null, true, oConfig.DivisionID, oConfig.BankCodeID);
                    DataTable dtTmpIssueUpdateList = (DataTable)oResult.Return;
                    if (dtTmpIssueUpdateList != null)
                    {
                        gvData.DataSource = dtTmpIssueUpdateList;
                        gvData.DataBind();
                        Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpIssueUpdateList;
                    }
                }
                #endregion


                //Make Filter By User
                if (!string.IsNullOrEmpty(oConfig.FilterMakerID))
                {
                    DDListUtil.Assign(ddlUserName, oConfig.FilterMakerID.Trim());
                    FilterData(oConfig.FilterMakerID.Trim());
                }
            }
        }