Exemplo n.º 1
0
        protected void gvCertInfo_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            GridViewRow gvRow       = (GridViewRow)((Button)e.CommandSource).NamingContainer;
            LienRemove  oLienRemove = (LienRemove)Session[Constants.SES_LIEN_REMOVE_MARK];

            if (oLienRemove != null && gvRow != null)
            {
                oLienRemove.DtLienRemoveDetail.Rows.RemoveAt(gvRow.RowIndex);
                DataTable tmpDt = oLienRemove.DtLienRemoveDetail.Copy();
                if (tmpDt.Columns.Contains("SPScripID"))
                {
                    tmpDt.Columns.Remove("SPScripID");
                }
                gvCertInfo.DataSource = tmpDt;
                gvCertInfo.DataBind();

                Session[Constants.SES_STOPPAY_REMOVE_MARK] = oLienRemove;
            }

            decimal dTotalAmount = 0m;

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

            txtCDRemoveAmount.Text = dTotalAmount.ToString("N2");
        }
Exemplo n.º 2
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"))
                {
                    LienRemove oLienRemove = GetObject();

                    LienDAL oLienDAL = new LienDAL();
                    Result  oResult  = oLienDAL.SaveLienRemoveMark(oLienRemove);
                    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.º 3
0
        protected void btnApprove_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(hdLienRemoveTransNo.Value))
            {
                LienRemove oLienRemove = new LienRemove(hdLienRemoveTransNo.Value);
                LienDAL    oLienDAL    = new LienDAL();
                oLienRemove.UserDetails = ucUserDet.UserDetail;

                Result oResult = (Result)oLienDAL.ApproveLienRemoveMark(oLienRemove);
                if (oResult.Status)
                {
                    ReportDAL rdal = new ReportDAL();

                    oResult = rdal.LienLetter(Constants.LETTER_TYPE_LIEN_REMOVE, txtUnlienTransNo.Text);

                    if (oResult.Status)
                    {
                        Session[Constants.SES_RPT_DATA] = oResult.Return;
                        Page.RegisterStartupScript(Constants.REPORT_WINDOW, Util.OpenReport());
                    }
                    //ucMessage.OpenMessage(Constants.MSG_SUCCESS_APPROVE, Constants.MSG_TYPE_SUCCESS);
                    ClearAfterApprove();
                }
                else
                {
                    ucMessage.OpenMessage(Constants.MSG_ERROR_NOT_FOUND + " to Approve", Constants.MSG_TYPE_INFO);
                }
            }
            else
            {
                ucMessage.OpenMessage(Constants.MSG_ERROR_APPROVE, Constants.MSG_TYPE_ERROR);
            }
        }
Exemplo n.º 4
0
        private void LoadDataByRegNo(string sTransNo, string sRegNo, string sApprovalStaus)
        {
            LienDAL oLienDAL = new LienDAL();
            Result  oResult  = null;

            if (SEARCH_FROM.Equals(2)) //LienMark search
            {
                oResult = (Result)oLienDAL.LoadLienRemoveMarkByRegNo("", sTransNo, sRegNo, "");
            }
            else if (SEARCH_FROM.Equals(1) || SEARCH_FROM.Equals(3) || SEARCH_FROM.Equals(4))
            {
                oResult = (Result)oLienDAL.LoadLienRemoveMarkByRegNo(sTransNo, "", sRegNo, sApprovalStaus);
            }

            TotalClear();
            //hdIssueTransNo.Value = sRegNo;
            if (oResult.Status)
            {
                LienRemove oLienRemove = (LienRemove)oResult.Return;
                SetObject(oLienRemove);

                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);

                    fsList.Visible          = true;
                    btnRegSearch.Enabled    = true;
                    btnUnLienSearch.Enabled = true;
                }
                else if (SEARCH_FROM.Equals(4))
                {
                    EnableDisableControl(true);
                    Util.ControlEnabled(ucUserDet.FindControl("txtCheckerComments"), true);
                }
                else
                {
                    EnableDisableControl(false);
                }
            }
            else
            {
                ucMessage.OpenMessage(Constants.MSG_ERROR_NOT_FOUND, Constants.MSG_TYPE_ERROR);
            }
        }
Exemplo n.º 5
0
        private void LoadDataByTransactionNo(string sTransactionNo)
        {
            LienDAL oLienDAL = new LienDAL();
            Result  oResult  = (Result)oLienDAL.LoadLienRemoveMarkByTransactionNo(sTransactionNo);

            TotalClear();

            if (oResult.Status)
            {
                LienRemove oLienRemove = (LienRemove)oResult.Return;
                SetObject(oLienRemove);
            }
            else
            {
                ucMessage.OpenMessage(Constants.MSG_ERROR_NOT_FOUND, Constants.MSG_TYPE_ERROR);
            }
        }
Exemplo n.º 6
0
        protected void ddlCDDenom_SelectedIndexChanged(object sender, EventArgs e)
        {
            ddlCDCertif.Items.Clear();
            if (!string.IsNullOrEmpty(ddlCDDenom.SelectedValue))
            {
                LienRemove oLienRemove = (LienRemove)Session[Constants.SES_LIEN_REMOVE_MARK];
                DDListUtil.Add(ddlCDCertif, "", "");
                if ((!string.IsNullOrEmpty(oLienRemove.LienRemoveTransNo) && oLienRemove.DtLienRemoveDetail.Rows.Count > 0) || string.IsNullOrEmpty(oLienRemove.LienRemoveTransNo))
                {
                    //Filtered by Denomination
                    List <Scrip> filteredScripList = oLienRemove.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());
                    }
                }
            }
        }
Exemplo n.º 7
0
        protected void btnReject_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(hdLienRemoveTransNo.Value))
            {
                LienRemove oLienRemove = new LienRemove(hdLienRemoveTransNo.Value);
                LienDAL    oLienDAL    = new LienDAL();
                oLienRemove.UserDetails = ucUserDet.UserDetail;

                Result oResult = (Result)oLienDAL.RejectLienRemoveMark(oLienRemove);
                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.º 8
0
        private LienRemove GetObject()
        {
            LienRemove oLienRemove = (LienRemove)Session[Constants.SES_LIEN_REMOVE_MARK];

            if (oLienRemove != null)
            {
                if (string.IsNullOrEmpty(oLienRemove.LienRemoveTransNo))
                {
                    oLienRemove.LienRemoveTransNo = "-1";
                }

                oLienRemove.LienRemoveAmount = Util.GetDecimalNumber(txtCDRemoveAmount.Text);
                oLienRemove.LienRemoveDate   = Util.GetDateTimeByString(txtUnlienDate.Text);
                oLienRemove.LienBank         = txtLienBank.Text.ToUpper();
                oLienRemove.LienBankAddress  = txtBankAddress.Text.ToUpper();
                oLienRemove.OurRef           = txtOurRefNo.Text.ToUpper();
                oLienRemove.TheirRef         = txtTheirRefNo.Text.ToUpper();
                oLienRemove.Remarks          = txtRemarks.Text.ToUpper();

                oLienRemove.UserDetails = ucUserDet.UserDetail;
            }

            return(oLienRemove);
        }
Exemplo n.º 9
0
        private void LoadDataByRegNo(string sTransNo, string sRegNo, string sApprovalStaus, string sType)
        {
            LienDAL oLienDAL = new LienDAL();
            Result  oResult  = null;

            TotalClear();

            DataTable dt = new DataTable();

            dt.Columns.Add(new DataColumn("Reg No", typeof(string)));
            dt.Columns.Add(new DataColumn("Issue Date", typeof(string)));
            dt.Columns.Add(new DataColumn("Bond Holder", typeof(string)));
            dt.Columns.Add(new DataColumn("Certificate No", typeof(string)));
            dt.Columns.Add(new DataColumn("Denomination", typeof(string)));
            dt.Columns.Add(new DataColumn("Amount", typeof(string)));

            DataRow   row = null;
            ArrayList al  = new ArrayList();

            if (sType.Equals("LM")) //LienMark search
            {
                oResult = (Result)oLienDAL.LoadLienMarkByTransactionNo(sTransNo, sApprovalStaus);
                if (oResult.Status)
                {
                    Lien oLien = (Lien)oResult.Return;
                    if (oLien != null)
                    {
                        txtLienBank.Text    = oLien.LienBank + (oLien.LienBankAddress == "" ? "" : "," + oLien.LienBankAddress);
                        txtOurRefNo.Text    = oLien.OurRef;
                        txtThierRefNo.Text  = oLien.TheirRef;
                        txtLienTransNo.Text = oLien.LienTransNo;
                        txtLienDate.Text    = oLien.LienDate.ToString(Constants.DATETIME_FORMAT);


                        if (oLien.DtLienDetails.Rows.Count > 0)
                        {
                            for (int i = 0; i < oLien.DtLienDetails.Rows.Count; i++)
                            {
                                if (!al.Contains(oLien.DtLienDetails.Rows[i]["SP Series"]))
                                {
                                    row                   = dt.NewRow();
                                    row["Reg No"]         = oLien.Issue.RegNo;
                                    row["Issue Date"]     = oLien.Issue.VersionIssueDate.ToString(Constants.DATETIME_dd_MMM_yyyy);
                                    row["Bond Holder"]    = oLien.Issue.BondHolderName;
                                    row["Certificate No"] = oLien.DtLienDetails.Rows[i]["SP Series"] + "-" + oLien.DtLienDetails.Rows[i]["SPScripID"];
                                    row["Denomination"]   = oLien.DtLienDetails.Rows[i]["Denomination"];
                                    row["Amount"]         = oLien.DtLienDetails.Rows[i]["Denomination"];

                                    dt.Rows.Add(row);
                                    al.Add(oLien.DtLienDetails.Rows[i]["SP Series"]);
                                }
                                else
                                {
                                    dt.Rows[al.IndexOf(oLien.DtLienDetails.Rows[i]["SP Series"])]["Amount"]         = Convert.ToDouble(dt.Rows[al.IndexOf(oLien.DtLienDetails.Rows[i]["SP Series"])]["Amount"]) + Convert.ToDouble(oLien.DtLienDetails.Rows[i]["Denomination"]);
                                    dt.Rows[al.IndexOf(oLien.DtLienDetails.Rows[i]["SP Series"])]["Certificate No"] = dt.Rows[al.IndexOf(oLien.DtLienDetails.Rows[i]["SP Series"])]["Certificate No"] + ", " + oLien.DtLienDetails.Rows[i]["SP Series"] + "-" + oLien.DtLienDetails.Rows[i]["SPScripID"];
                                }
                            }
                        }

                        if (dt.Rows.Count > 0)
                        {
                            gvData.DataSource = dt;
                        }
                        else
                        {
                            gvData.DataSource = null;
                        }
                        gvData.DataBind();
                    }
                }
            }
            else if (sType.Equals("LMR")) //LienMark remove search
            {
                oResult = (Result)oLienDAL.LoadLienRemoveMarkByRegNo(sTransNo, "", sRegNo, sApprovalStaus);
                if (oResult.Status)
                {
                    LienRemove oLienRemove = (LienRemove)oResult.Return;
                    if (oLienRemove != null)
                    {
                        txtLienBank.Text   = oLienRemove.LienBank + (oLienRemove.LienBankAddress == "" ? "" : "," + oLienRemove.LienBankAddress);
                        txtOurRefNo.Text   = oLienRemove.OurRef;
                        txtThierRefNo.Text = oLienRemove.TheirRef;
                        //txtLienTransNo.Text = oLienRemove.Lien.LienTransNo;
                        txtLienTransNo.Text = sTransNo;
                        txtLienDate.Text    = oLienRemove.Lien.LienDate.ToString(Constants.DATETIME_FORMAT);

                        if (oLienRemove.DtLienRemoveDetail.Rows.Count > 0)
                        {
                            for (int i = 0; i < oLienRemove.DtLienRemoveDetail.Rows.Count; i++)
                            {
                                if (!al.Contains(oLienRemove.DtLienRemoveDetail.Rows[i]["SP Series"]))
                                {
                                    row                   = dt.NewRow();
                                    row["Reg No"]         = oLienRemove.Issue.RegNo;
                                    row["Issue Date"]     = oLienRemove.Issue.VersionIssueDate.ToString(Constants.DATETIME_dd_MMM_yyyy);
                                    row["Bond Holder"]    = oLienRemove.Issue.BondHolderName;
                                    row["Certificate No"] = oLienRemove.DtLienRemoveDetail.Rows[i]["SP Series"] + "-" + oLienRemove.DtLienRemoveDetail.Rows[i]["SPScripID"];
                                    row["Denomination"]   = oLienRemove.DtLienRemoveDetail.Rows[i]["Denomination"];
                                    row["Amount"]         = oLienRemove.DtLienRemoveDetail.Rows[i]["Denomination"];

                                    dt.Rows.Add(row);
                                    al.Add(oLienRemove.DtLienRemoveDetail.Rows[i]["SP Series"]);
                                }
                                else
                                {
                                    dt.Rows[al.IndexOf(oLienRemove.DtLienRemoveDetail.Rows[i]["SP Series"])]["Amount"]         = Convert.ToDouble(dt.Rows[al.IndexOf(oLienRemove.DtLienRemoveDetail.Rows[i]["SP Series"])]["Amount"]) + Convert.ToDouble(oLienRemove.DtLienRemoveDetail.Rows[i]["Denomination"]);
                                    dt.Rows[al.IndexOf(oLienRemove.DtLienRemoveDetail.Rows[i]["SP Series"])]["Certificate No"] = dt.Rows[al.IndexOf(oLienRemove.DtLienRemoveDetail.Rows[i]["SP Series"])]["Certificate No"] + ", " + oLienRemove.DtLienRemoveDetail.Rows[i]["SP Series"] + "-" + oLienRemove.DtLienRemoveDetail.Rows[i]["SPScripID"];
                                }
                            }
                        }

                        if (dt.Rows.Count > 0)
                        {
                            gvData.DataSource = dt;
                        }
                        else
                        {
                            gvData.DataSource = null;
                        }
                        gvData.DataBind();
                    }
                }
            }
        }
Exemplo n.º 10
0
        private void TotalClear()
        {
            EnableDisableControl(false);
            // Stop Payment Remove Mark set in session
            LienRemove oLienRemoveMark = new LienRemove();

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

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

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

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

            hdLienRemoveTransNo.Value = "";
            hdIssueTransNo.Value      = "";
            hdRegNo.Value             = "";

            //Lien Remove Mark Transaction No
            txtLienAmount.Text    = string.Empty;
            txtLienTransNo.Text   = string.Empty;
            txtUnlienTransNo.Text = string.Empty;
            txtUnlienDate.Text    = DateTime.Now.ToString(Constants.DATETIME_FORMAT);
            txtRegNo.Text         = string.Empty;

            //Issue Details
            txtIssueDate.Text = string.Empty;
            txtIssueName.Text = string.Empty;
            if (ddlBranch.Items.Count > 0)
            {
                ddlBranch.SelectedIndex = 0;
            }

            ddlCustomerType.Items.Clear();
            if (ddlSpType.Items.Count > 0)
            {
                ddlSpType.SelectedIndex = 0;
            }

            //Customer(s) Details
            gvCustomerDetail.Enabled = true;

            //Nominee(s) Details
            gvNomDetail.Enabled = true;

            //Certificate
            gvCertInfo.Enabled = true;

            // Lien Remove Detail
            txtRemarks.Text     = string.Empty;
            txtOurRefNo.Text    = string.Empty;
            txtTheirRefNo.Text  = string.Empty;
            txtLienBank.Text    = string.Empty;
            txtBankAddress.Text = string.Empty;
            txtLienAmount.Text  = string.Empty;

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

            ucUserDet.Reset();
            ucUserDet.ResetData();
        }
Exemplo n.º 11
0
        private void SetObject(LienRemove oLienRemove)
        {
            if (oLienRemove != null)
            {
                if (oLienRemove.Issue != null)
                {
                    hdLienRemoveTransNo.Value = oLienRemove.LienRemoveTransNo;
                    hdIssueTransNo.Value      = oLienRemove.Issue.IssueTransNo;
                    hdRegNo.Value             = oLienRemove.Issue.RegNo;

                    //Lien Detail
                    txtLienDate.Text    = oLienRemove.Lien.LienDate.ToString(Constants.DATETIME_FORMAT);
                    txtLienTransNo.Text = oLienRemove.Lien.LienTransNo;
                    txtLienAmount.Text  = oLienRemove.Lien.LienAmount.ToString();

                    //Load from LienMark search
                    if (oLienRemove.LienRemoveDate.Year.Equals(1) || oLienRemove.LienRemoveDate.Year.Equals(1900))
                    {
                        txtUnlienDate.Text = DateTime.Now.ToString(Constants.DATETIME_FORMAT);
                    }
                    else //Load from LienMark Remove search
                    {
                        txtUnlienDate.Text = oLienRemove.LienRemoveDate.ToString(Constants.DATETIME_FORMAT);
                    }
                    txtOurRefNo.Text   = oLienRemove.OurRef;
                    txtTheirRefNo.Text = oLienRemove.TheirRef;
                    if (!string.IsNullOrEmpty(oLienRemove.LienBank))
                    {
                        txtLienBank.Text = oLienRemove.LienBank;
                    }
                    else
                    {
                        txtLienBank.Text = oLienRemove.Lien.LienBank;
                    }
                    if (!string.IsNullOrEmpty(oLienRemove.LienBankAddress))
                    {
                        txtBankAddress.Text = oLienRemove.LienBankAddress;
                    }
                    else
                    {
                        txtBankAddress.Text = oLienRemove.Lien.LienBankAddress;
                    }
                    // Remarks
                    txtRemarks.Text = oLienRemove.Remarks;

                    //Issue Details
                    txtRegNo.Text     = oLienRemove.Issue.RegNo.ToString();
                    txtIssueDate.Text = oLienRemove.Issue.VersionIssueDate.ToString(Constants.DATETIME_FORMAT);
                    txtIssueName.Text = oLienRemove.Issue.IssueName.ToString();

                    ddlSpType.Text = oLienRemove.Issue.SPType.SPTypeID.Trim();
                    ddlBranch.Text = oLienRemove.Issue.Branch.BranchID.Trim();

                    DDListUtil.Assign(ddlCustomerType, oLienRemove.Issue.VersionSPPolicy.DTCustomerTypePolicy, true);
                    DDListUtil.Assign(ddlCustomerType, oLienRemove.Issue.CustomerType.CustomerTypeID);

                    // User Info
                    // ucUserDet.UserDetail = oLienRemove.UserDetails;

                    #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)));

                    DataRow rowCustomerDetails = null;

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

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

                        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)));

                    DataRow rowNomineeDetail = null;

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

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

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

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

                    // Certificate Detail
                    txtCDRemoveAmount.Text = oLienRemove.LienRemoveAmount.ToString("N2");
                    DataTable tmpDt = oLienRemove.DtLienRemoveDetail.Copy();
                    if (tmpDt.Columns.Contains("SPScripID"))
                    {
                        tmpDt.Columns.Remove("SPScripID");
                    }
                    gvCertInfo.DataSource = tmpDt;
                    gvCertInfo.DataBind();

                    Session[Constants.SES_LIEN_REMOVE_MARK] = oLienRemove;

                    if ((SEARCH_FROM.Equals(2)) && ddlCDDenom.Items.Count <= 1)
                    {
                        ucMessage.OpenMessage("Lien Mark removed!!", Constants.MSG_TYPE_INFO);
                        ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true);
                    }
                    else
                    {
                        txtUnlienTransNo.Text = oLienRemove.LienRemoveTransNo;
                    }
                    // user detail

                    UserDetails oUserDetails = ucUserDet.UserDetail;
                    if (hdDataType.Value.Equals("2"))
                    {
                        oUserDetails.MakerID        = oLienRemove.UserDetails.MakerID;
                        oUserDetails.MakeDate       = oLienRemove.UserDetails.MakeDate;
                        oUserDetails.CheckerID      = oLienRemove.UserDetails.CheckerID;
                        oUserDetails.CheckDate      = oLienRemove.UserDetails.CheckDate;
                        oUserDetails.CheckerComment = oLienRemove.UserDetails.CheckerComment;
                        ucUserDet.UserDetail        = oUserDetails;
                    }
                    if (SEARCH_FROM.Equals(4))
                    {
                        oUserDetails.MakerID        = oLienRemove.UserDetails.MakerID;
                        oUserDetails.CheckerComment = oLienRemove.UserDetails.CheckerComment;
                        ucUserDet.UserDetail        = oUserDetails;
                    }
                    else
                    {
                        oUserDetails.CheckerID      = oLienRemove.UserDetails.CheckerID;
                        oUserDetails.CheckDate      = oLienRemove.UserDetails.CheckDate;
                        oUserDetails.CheckerComment = oLienRemove.UserDetails.CheckerComment;
                        ucUserDet.UserDetail        = oUserDetails;
                    }
                }
            }
        }
Exemplo n.º 12
0
        private void Calculate(string sAction)
        {
            LienRemove oLienRemove = (LienRemove)Session[Constants.SES_LIEN_REMOVE_MARK];

            DataTable dt = null;

            if (oLienRemove != null)
            {
                dt = oLienRemove.DtLienRemoveDetail;

                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)));
                }
            }

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

                if (iUpTo > 0)
                {
                    int iSelectedIndex = ddlCDCertif.SelectedIndex;

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

                        bool isExist = false;

                        if (dt.Rows.Count > 0)
                        {
                            DataRow[] selectedRow = dt.Select("SPScripID = " + ddlCDCertif.Items[certificateIndex + iSelectedIndex].Value);
                            if (selectedRow.Count() > 0)
                            {
                                isExist = true;
                            }
                        }

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

                            row["SPScripID"]    = ddlCDCertif.Items[certificateIndex + iSelectedIndex].Value;
                            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"]    = "WAITING FOR APPROVE";
                            dt.Rows.Add(row);
                        }
                    }
                }
                #endregion
            }
            else if (sAction.Equals("MA")) //Mark All
            {
                #region Mark All
                if (oLienRemove != 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 scripIndex = 0; scripIndex < oLienRemove.Issue.ScripList.Count; scripIndex++)
                    {
                        DataRow row = dt.NewRow();

                        if (ddlCDDenom.SelectedItem.Value.Equals(oLienRemove.Issue.ScripList[scripIndex].Denomination.DenominationID.ToString()))
                        {
                            row["SPScripID"]    = oLienRemove.Issue.ScripList[scripIndex].SPScripID;
                            row["Denomination"] = oLienRemove.Issue.ScripList[scripIndex].Denomination.DenominationID;
                            row["SP Series"]    = oLienRemove.Issue.ScripList[scripIndex].SPSeries;
                            row["Sl No"]        = oLienRemove.Issue.ScripList[scripIndex].SlNo;
                            row["Status"]       = "WAITING FOR APPROVE";
                            dt.Rows.Add(row);
                        }
                    }
                }
                #endregion
            }
            else if (sAction.Equals("RA")) //Remove All
            {
                dt.Rows.Clear();
            }
            if (dt.Rows.Count > 0)
            {
                dt.DefaultView.Sort = "Sl No";
            }

            oLienRemove.DtLienRemoveDetail = dt;
            DataTable tmpDt = dt.Copy();
            Session[Constants.SES_LIEN_REMOVE_MARK] = oLienRemove;//update session
            if (tmpDt.Columns.Contains("SPScripID"))
            {
                tmpDt.Columns.Remove("SPScripID");
            }
            gvCertInfo.DataSource = tmpDt;
            gvCertInfo.DataBind();

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

            txtCDRemoveAmount.Text = dTotalAmount.ToString("N2");
        }