Exemplo n.º 1
0
        protected void btnApprove_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(hdStopPayTransNo.Value))
            {
                StopPayment    oStopPay    = new StopPayment(hdStopPayTransNo.Value);
                StopPaymentDAL oStopPayDAL = new StopPaymentDAL();
                oStopPay.UserDetails = ucUserDet.UserDetail;

                Result oResult = (Result)oStopPayDAL.ApproveStopPayMark(oStopPay);
                if (oResult.Status)
                {
                    ReportDAL rdal = new ReportDAL();

                    oResult = rdal.StopPaymentLetter(Constants.LETTER_TYPE_STOP, txtStopPayTransNo.Text.Trim());
                    if (oResult.Status)
                    {
                        Session[Constants.SES_RPT_DATA] = oResult.Return;
                        Page.RegisterStartupScript(Constants.REPORT_WINDOW, Util.OpenReport2(1));
                    }

                    ClearAfterApprove();

                    //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_NOT_FOUND + " to Approve", Constants.MSG_TYPE_INFO);
            }
        }
Exemplo n.º 2
0
        protected void ddlCDDenom_SelectedIndexChanged(object sender, EventArgs e)
        {
            ddlCDCertif.Items.Clear();
            if (!string.IsNullOrEmpty(ddlCDDenom.SelectedValue))
            {
                StopPayment oStopPay = (StopPayment)Session[Constants.SES_STOPPAY_MARK];
                DDListUtil.Add(ddlCDCertif, "", "");
                //Filtered by Denomination
                List <Scrip> filteredScripList = oStopPay.Issue.ScripList.Where(s => s.Denomination.DenominationID.ToString().Equals(ddlCDDenom.SelectedValue)).ToList();

                for (int iScripCount = 0; iScripCount < filteredScripList.Count; iScripCount++)
                {
                    DDListUtil.Add(ddlCDCertif, filteredScripList[iScripCount].SPSeries + " " + filteredScripList[iScripCount].SlNo, filteredScripList[iScripCount].SPScripID.ToString() + ":" + filteredScripList[iScripCount].OlsStatus.ToString());
                }
            }
        }
Exemplo n.º 3
0
        private void LoadDataByRegNo(string sStopPaymentTransNo, string sRegNo, string sApprovalStaus)
        {
            StopPaymentDAL oStopPayDAL = new StopPaymentDAL();
            Result         oResult     = (Result)oStopPayDAL.LoadStopPayMarkByRegNo(sStopPaymentTransNo, sRegNo, sApprovalStaus);

            TotalClear();
            if (oResult.Status)
            {
                StopPayment oStopPay = (StopPayment)oResult.Return;
                SetObject(oStopPay);

                if (hdDataType.Value.Equals("2"))
                {
                    EnableDisableControl(true);
                    Util.ControlEnabled(btnReject, false);
                    Util.ControlEnabled(btnApprove, false);
                    Util.ControlEnabled(btnBack, false);

                    Util.ControlEnabled(btnReset, true);
                    Util.ControlEnabled(btnSave, true);
                    Util.ControlEnabled(btnDelete, true);

                    btnRegSearch.Enabled     = true;
                    btnStopPaySearch.Enabled = true;



                    fsList.Visible = true;
                }
                else if (SEARCH_FROM.Equals(3))
                {
                    EnableDisableControl(true);
                    Util.ControlEnabled(ucUserDet.FindControl("txtCheckerComments"), true);
                }
                else if (SEARCH_FROM.Equals(2))
                {
                    EnableDisableControl(false);
                }
            }
            else
            {
                ucMessage.OpenMessage(Constants.MSG_ERROR_NOT_FOUND, Constants.MSG_TYPE_ERROR);
            }
        }
Exemplo n.º 4
0
        private StopPayment GetObject()
        {
            StopPayment oStopPay = (StopPayment)Session[Constants.SES_STOPPAY_MARK];

            if (oStopPay != null)
            {
                if (string.IsNullOrEmpty(oStopPay.StopPaymentTransNo))
                {
                    oStopPay.StopPaymentTransNo = "-1";
                }
                oStopPay.Remarks           = txtRemarks.Text;
                oStopPay.StopPaymentAmount = Util.GetDecimalNumber(txtCDTotalAmount.Text);
                oStopPay.StopPaymentDate   = Util.GetDateTimeByString(txtStopPaymentDate.Text);

                oStopPay.UserDetails = ucUserDet.UserDetail;
            }

            return(oStopPay);
        }
Exemplo n.º 5
0
        protected void btnReject_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(hdStopPayTransNo.Value))
            {
                StopPayment    oStopPay    = new StopPayment(hdStopPayTransNo.Value);
                StopPaymentDAL oStopPayDAL = new StopPaymentDAL();
                oStopPay.UserDetails = ucUserDet.UserDetail;

                Result oResult = (Result)oStopPayDAL.RejectStopPayMark(oStopPay);
                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_NOT_FOUND + " to Reject", Constants.MSG_TYPE_INFO);
            }
        }
Exemplo n.º 6
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Config oConfig = (Config)Session[Constants.SES_USER_CONFIG];

            if (oConfig != null)
            {
                if (!(hdDataType.Value.Equals("2")))
                {
                    if (ddlCDDenom.Items.Count > 1)
                    {
                        StopPayment oStopPay = GetObject();
                        oStopPay.UserDetails          = ucUserDet.UserDetail;
                        oStopPay.UserDetails.MakeDate = DateTime.Now;
                        ucUserDet.ResetData();
                        StopPaymentDAL oStopPayment = new StopPaymentDAL();
                        Result         oResult      = oStopPayment.SaveStopPayMark(oStopPay);
                        if (oResult.Status)
                        {
                            TotalClear();
                            LoadPreviousList();

                            ucMessage.OpenMessage(Constants.MSG_SUCCESS_SAVE, Constants.MSG_TYPE_SUCCESS);
                        }
                        else
                        {
                            ucMessage.OpenMessage(Constants.MSG_ERROR_SAVE, Constants.MSG_TYPE_ERROR);
                        }
                    }
                }
                else
                {
                    ucMessage.OpenMessage(Constants.MSG_APPROVED_SAVE_DATA, Constants.MSG_TYPE_INFO);
                    ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true);
                }
            }
        }
Exemplo n.º 7
0
        protected void gvCertInfo_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            GridViewRow gvRow    = (GridViewRow)((Button)e.CommandSource).NamingContainer;
            StopPayment oStopPay = (StopPayment)Session[Constants.SES_STOPPAY_MARK];

            if (oStopPay != null && gvRow != null)
            {
                oStopPay.DtStopPaymentDetail.Rows.RemoveAt(gvRow.RowIndex);

                gvCertInfo.DataSource = oStopPay.DtStopPaymentDetail;
                gvCertInfo.DataBind();

                Session[Constants.SES_STOPPAY_MARK] = oStopPay;
            }

            decimal dTotalAmount = 0m;

            foreach (GridViewRow gvr in gvCertInfo.Rows)
            {
                dTotalAmount += Util.GetDecimalNumber(gvr.Cells[1].Text);
            }

            txtCDTotalAmount.Text = dTotalAmount.ToString("N2");
        }
Exemplo n.º 8
0
        private void Calculate(string sAction)
        {
            StopPayment oStopPay = (StopPayment)Session[Constants.SES_STOPPAY_MARK];

            DataTable dt = null;

            //ArrayList alOldStatus = new ArrayList();

            if (oStopPay != null)
            {
                dt = (DataTable)oStopPay.DtStopPaymentDetail;

                if (dt.Columns.Count <= 0)
                {
                    dt.Columns.Add(new DataColumn("SPScripID", typeof(string)));
                    dt.Columns.Add(new DataColumn("Denomination", typeof(string)));
                    dt.Columns.Add(new DataColumn("SP Series", typeof(string)));
                    dt.Columns.Add(new DataColumn("Sl No", typeof(string)));
                    dt.Columns.Add(new DataColumn("Status", typeof(string)));
                    dt.Columns.Add(new DataColumn("OldStatus", typeof(string)));
                }
            }

            if (sAction.Equals("MS")) //Mark Single
            {
                #region Mark Single
                int iUpTo = Util.GetIntNumber(txtCDUpTo.Text);

                if (iUpTo > 0)
                {
                    string   sCertifVal     = ddlCDCertif.SelectedItem.Value;
                    string[] sCertifValList = sCertifVal.Split(':');
                    int      iSelectedIndex = ddlCDCertif.SelectedIndex;
                    int      iOldStatus     = Util.GetIntNumber(sCertifValList[1]);


                    for (int certificateIndex = 0; certificateIndex < iUpTo; certificateIndex++)
                    {
                        if (certificateIndex + iSelectedIndex == ddlCDCertif.Items.Count)
                        {
                            break;
                        }

                        string   sTmpOldScripStatus = ddlCDCertif.Items[certificateIndex + iSelectedIndex].Value;
                        string[] sTmpList           = sTmpOldScripStatus.Split(':');
                        bool     isExist            = false;

                        if (dt.Rows.Count > 0)
                        {
                            DataRow[] selectedRow = dt.Select("SPScripID = " + sTmpList[0]);
                            if (selectedRow.Count() > 0)
                            {
                                isExist = true;
                            }
                        }

                        if (!isExist)
                        {
                            DataRow row = dt.NewRow();

                            row["SPScripID"]    = sTmpList[0];
                            row["Denomination"] = ddlCDDenom.SelectedItem.Value;
                            string sTmp = ddlCDCertif.Items[certificateIndex + iSelectedIndex].Text;
                            row["SP Series"] = (sTmp.Substring(0, sTmp.LastIndexOf(' '))).Trim();
                            row["Sl No"]     = (sTmp.Substring(sTmp.LastIndexOf(' ') + 1, (sTmp.Length - sTmp.LastIndexOf(' ')) - 1)).Trim();
                            row["Status"]    = "Stopped";
                            row["OldStatus"] = sTmpList[1];
                            dt.Rows.Add(row);
                        }
                    }
                }
                #endregion
            }
            else if (sAction.Equals("MA")) //Mark All
            {
                #region Mark All
                if (oStopPay != null)
                {
                    int iDnomCount = 0;

                    if (dt.Rows.Count > 0)
                    {
                        object objCount = dt.Compute("COUNT(Denomination)", "Denomination = " + ddlCDDenom.SelectedItem.Value);
                        if (objCount != null)
                        {
                            iDnomCount = Convert.ToInt32(objCount);
                        }
                        if (iDnomCount > 0)
                        {
                            DataRow[] DrDenomCheck = dt.Select("Denomination = " + ddlCDDenom.SelectedItem.Value);
                            foreach (DataRow DrCheck in DrDenomCheck)
                            {
                                dt.Rows.Remove(DrCheck);
                            }
                        }
                    }

                    for (int scripCount = 0; scripCount < oStopPay.Issue.ScripList.Count; scripCount++)
                    {
                        DataRow row = dt.NewRow();

                        if (ddlCDDenom.SelectedItem.Value.Equals(oStopPay.Issue.ScripList[scripCount].Denomination.DenominationID.ToString()))
                        {
                            row["SPScripID"]    = oStopPay.Issue.ScripList[scripCount].SPScripID;
                            row["Denomination"] = oStopPay.Issue.ScripList[scripCount].Denomination.DenominationID;
                            row["SP Series"]    = oStopPay.Issue.ScripList[scripCount].SPSeries;
                            row["Sl No"]        = oStopPay.Issue.ScripList[scripCount].SlNo;
                            row["Status"]       = "Stopped";
                            row["OldStatus"]    = oStopPay.Issue.ScripList[scripCount].OlsStatus;
                            dt.Rows.Add(row);
                        }
                    }
                }
                #endregion
            }
            else if (sAction.Equals("RA")) //Remove All
            {
                dt.Rows.Clear();
            }

            DataTable tmpDt = dt.Copy();

            oStopPay.DtStopPaymentDetail        = dt;
            Session[Constants.SES_STOPPAY_MARK] = oStopPay;
            if (tmpDt.Columns.Contains("OldStatus"))
            {
                tmpDt.Columns.Remove("OldStatus");
            }
            if (tmpDt.Columns.Contains("SPScripID"))
            {
                tmpDt.Columns.Remove("SPScripID");
            }
            gvCertInfo.DataSource = tmpDt;
            gvCertInfo.DataBind();

            for (int i = 0; i < gvCertInfo.Rows.Count; i++)
            {
                HiddenField hdObj = (HiddenField)gvCertInfo.Rows[i].FindControl("hdOldStatus");
                if (hdObj != null)
                {
                    hdObj.Value = oStopPay.DtStopPaymentDetail.Rows[i]["OldStatus"].ToString();
                }
            }

            decimal dTotalAmount = 0m;
            foreach (GridViewRow gvr in gvCertInfo.Rows)
            {
                dTotalAmount += Util.GetDecimalNumber(gvr.Cells[1].Text);
            }

            txtCDTotalAmount.Text = dTotalAmount.ToString("N2");
        }
Exemplo n.º 9
0
        private void TotalClear()
        {
            // Stop Payment Mark set in session
            EnableDisableControl(false);
            StopPayment oStopPayment = new StopPayment();

            if (Session[Constants.SES_STOPPAY_MARK] == null)
            {
                Session.Add(Constants.SES_STOPPAY_MARK, oStopPayment);
            }
            else
            {
                Session[Constants.SES_STOPPAY_MARK] = oStopPayment;
            }

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

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

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

            hdStopPayTransNo.Value = "";
            hdIssueTransNo.Value   = "";
            hdRegNo.Value          = "";

            //Stop Payment Mark Transaction No
            txtStopPaymentDate.Text = DateTime.Now.ToString(Constants.DATETIME_FORMAT);
            txtStopPayTransNo.Text  = string.Empty;


            //Issue Details.. year
            if (ddlYear.Items.Count > 0)
            {
                ddlYear.Text = DateTime.Now.Year.ToString();
            }
            else
            {
                for (int i = 1990; i < DateTime.Now.Year + 1 + 1; i++)
                {
                    DDListUtil.Add(ddlYear, i.ToString(), i.ToString());
                }
                ddlYear.Text = DateTime.Now.Year.ToString();
            }

            txtTotalAmount.Text = string.Empty;
            ddlCustomerType.Items.Clear();
            if (ddlSpType.Items.Count > 0)
            {
                ddlSpType.SelectedIndex = 0;
            }
            if (ddlBranch.Items.Count > 0)
            {
                ddlBranch.SelectedIndex = 0;
            }
            txtIssueDate.Text = string.Empty;
            txtIssueName.Text = string.Empty;
            txtRegNo.Text     = string.Empty;

            // Remarks
            txtRemarks.Text = string.Empty;

            //Certificate Detail
            ddlCDDenom.Items.Clear();
            ddlCDCertif.Items.Clear();
            txtCDUpTo.Text        = "1";
            txtCDTotalAmount.Text = string.Empty;

            ucUserDet.Reset();
            ucUserDet.ResetData();
        }
Exemplo n.º 10
0
        private void SetObject(StopPayment oStopPay)
        {
            if (oStopPay != null)
            {
                if (oStopPay.Issue != null)
                {
                    hdStopPayTransNo.Value = oStopPay.StopPaymentTransNo;
                    hdIssueTransNo.Value   = oStopPay.Issue.IssueTransNo;
                    hdRegNo.Value          = oStopPay.Issue.RegNo;

                    txtRegNo.Text  = oStopPay.Issue.RegNo.ToString();
                    ddlSpType.Text = oStopPay.Issue.SPType.SPTypeID.Trim();
                    ddlBranch.Text = oStopPay.Issue.Branch.BranchID.Trim();

                    txtStopPaymentDate.Text = DateTime.Now.ToString(Constants.DATETIME_FORMAT);
                    txtStopPayTransNo.Text  = oStopPay.StopPaymentTransNo;
                    txtIssueName.Text       = oStopPay.Issue.IssueName;

                    //Issue Details
                    DDListUtil.Assign(ddlSpType, oStopPay.Issue.SPType.SPTypeID);
                    DDListUtil.Assign(ddlYear, oStopPay.Issue.VersionIssueDate.Year);
                    DDListUtil.Assign(ddlBranch, oStopPay.Issue.Branch.BranchID);
                    txtRegNo.Text       = oStopPay.Issue.RegNo;
                    txtIssueDate.Text   = oStopPay.Issue.VersionIssueDate.ToString(Constants.DATETIME_FORMAT);
                    txtTotalAmount.Text = oStopPay.Issue.IssueAmount.ToString("N2");
                    DDListUtil.Assign(ddlCustomerType, oStopPay.Issue.VersionSPPolicy.DTCustomerTypePolicy, true);
                    DDListUtil.Assign(ddlCustomerType, oStopPay.Issue.CustomerType.CustomerTypeID);


                    #region Customer Details
                    DataTable dtCustomerDetails = new DataTable();

                    dtCustomerDetails.Columns.Add(new DataColumn("Customer Name", typeof(string)));
                    //dtCustomerDetails.Columns.Add(new DataColumn("Customer ID", typeof(string)));
                    dtCustomerDetails.Columns.Add(new DataColumn("Address", typeof(string)));
                    dtCustomerDetails.Columns.Add(new DataColumn("Phone", typeof(string)));

                    DataRow rowCustomerDetails = null;

                    for (int customerCount = 0; customerCount < oStopPay.Issue.CustomerDetailsList.Count; customerCount++)
                    {
                        rowCustomerDetails = dtCustomerDetails.NewRow();

                        rowCustomerDetails["Customer Name"] = oStopPay.Issue.CustomerDetailsList[customerCount].CustomerName;
                        //rowCustomerDetails["Customer ID"] = oStopPay.Issue.CustomerDetailsList[customerCount].CustomerID;
                        rowCustomerDetails["Address"] = oStopPay.Issue.CustomerDetailsList[customerCount].Address;
                        rowCustomerDetails["Phone"]   = oStopPay.Issue.CustomerDetailsList[customerCount].Phone;

                        dtCustomerDetails.Rows.Add(rowCustomerDetails);
                    }

                    gvCustomerDetail.DataSource = dtCustomerDetails;
                    gvCustomerDetail.DataBind();
                    #endregion

                    #region Nominee Detail
                    DataTable dtNomineeDetail = new DataTable();

                    dtNomineeDetail.Columns.Add(new DataColumn("Nominee Name", typeof(string)));
                    dtNomineeDetail.Columns.Add(new DataColumn("Relation", typeof(string)));
                    dtNomineeDetail.Columns.Add(new DataColumn("Address", typeof(string)));
                    dtNomineeDetail.Columns.Add(new DataColumn("Nominee Share", typeof(string)));
                    dtNomineeDetail.Columns.Add(new DataColumn("Amount", typeof(string)));

                    DataRow rowNomineeDetail = null;

                    for (int nomineeCount = 0; nomineeCount < oStopPay.Issue.NomineeList.Count; nomineeCount++)
                    {
                        rowNomineeDetail = dtNomineeDetail.NewRow();

                        rowNomineeDetail["Nominee Name"]  = oStopPay.Issue.NomineeList[nomineeCount].NomineeName;
                        rowNomineeDetail["Relation"]      = oStopPay.Issue.NomineeList[nomineeCount].Relation;
                        rowNomineeDetail["Address"]       = oStopPay.Issue.NomineeList[nomineeCount].Address;
                        rowNomineeDetail["Nominee Share"] = oStopPay.Issue.NomineeList[nomineeCount].NomineeShare;
                        rowNomineeDetail["Amount"]        = oStopPay.Issue.NomineeList[nomineeCount].Amount;

                        dtNomineeDetail.Rows.Add(rowNomineeDetail);
                    }
                    gvNomDetail.DataSource = dtNomineeDetail;
                    gvNomDetail.DataBind();

                    #endregion

                    ArrayList alScrip = new ArrayList();
                    ddlCDDenom.Items.Clear();
                    DDListUtil.Add(ddlCDDenom, "", "");
                    for (int iScripCount = 0; iScripCount < oStopPay.Issue.ScripList.Count; iScripCount++)
                    {
                        if (!alScrip.Contains(oStopPay.Issue.ScripList[iScripCount].Denomination.DenominationID))
                        {
                            DDListUtil.Add(ddlCDDenom, oStopPay.Issue.ScripList[iScripCount].Denomination.DenominationID.ToString(), oStopPay.Issue.ScripList[iScripCount].Denomination.DenominationID.ToString());
                            alScrip.Add(oStopPay.Issue.ScripList[iScripCount].Denomination.DenominationID);
                        }
                    }

                    // remarks
                    txtRemarks.Text = oStopPay.Remarks;

                    // Certificate Detail
                    DataTable dtStopPayment = oStopPay.DtStopPaymentDetail.Copy();
                    if (dtStopPayment.Columns.Contains("OldStatus"))
                    {
                        dtStopPayment.Columns.Remove("OldStatus");
                    }
                    if (dtStopPayment.Columns.Contains("SPScripID"))
                    {
                        dtStopPayment.Columns.Remove("SPScripID");
                    }
                    gvCertInfo.DataSource = dtStopPayment;
                    gvCertInfo.DataBind();

                    for (int i = 0; i < gvCertInfo.Rows.Count; i++)
                    {
                        HiddenField hdObj = (HiddenField)gvCertInfo.Rows[i].FindControl("hdOldStatus");
                        if (hdObj != null)
                        {
                            hdObj.Value = oStopPay.DtStopPaymentDetail.Rows[i]["OldStatus"].ToString();
                        }
                    }
                    Session[Constants.SES_STOPPAY_MARK] = oStopPay;

                    // user detail

                    UserDetails oUserDetails = ucUserDet.UserDetail;
                    if (hdDataType.Value.Equals("2") && SEARCH_FROM.Equals(1))
                    {
                        oUserDetails.MakerID        = oStopPay.UserDetails.MakerID;
                        oUserDetails.MakeDate       = oStopPay.UserDetails.MakeDate;
                        oUserDetails.CheckerID      = oStopPay.UserDetails.CheckerID;
                        oUserDetails.CheckDate      = oStopPay.UserDetails.CheckDate;
                        oUserDetails.CheckerComment = oStopPay.UserDetails.CheckerComment;
                        ucUserDet.UserDetail        = oUserDetails;
                        txtStopPaymentDate.Text     = oStopPay.StopPaymentDate.ToString(Constants.DATETIME_FORMAT);
                    }
                    if ((hdDataType.Value.Equals("1") && SEARCH_FROM.Equals(1)) || SEARCH_FROM.Equals(2))
                    {
                        oUserDetails.CheckerID      = oStopPay.UserDetails.CheckerID;
                        oUserDetails.CheckDate      = oStopPay.UserDetails.CheckDate;
                        oUserDetails.CheckerComment = oStopPay.UserDetails.CheckerComment;
                        ucUserDet.UserDetail        = oUserDetails;
                    }
                    if (SEARCH_FROM.Equals(3))
                    {
                        oUserDetails.MakerID        = oStopPay.UserDetails.MakerID;
                        oUserDetails.CheckerComment = oStopPay.UserDetails.CheckerComment;
                        ucUserDet.UserDetail        = oUserDetails;
                    }

                    if (oStopPay.Issue.Status.Equals((int)Constants.ISSUE_STATUS.FULL_ENCAHSED))
                    {
                        ucMessage.OpenMessage("Already Encashed.", Constants.MSG_TYPE_INFO);
                        ScriptManager.RegisterStartupScript(this.UpdatePanel8, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true);
                    }

                    Calculate("");
                }
            }
        }