Esempio n. 1
0
    protected void SaveButton_Click(object sender, EventArgs e)
    {
        UnitHolderRegistration regObj      = new UnitHolderRegistration();
        UnitTransfer           transferObj = new UnitTransfer();

        regObj.FundCode   = tfereeFundCodeTextBox.Text.Trim();
        regObj.BranchCode = tfereeBranhCodeTextBox.Text.Trim();
        regObj.RegNumber  = tferorRegNoTextBox.Text.Trim();

        transferObj.TransferNo       = Convert.ToInt32(transferNoTextBox.Text.Trim());
        transferObj.TransferDate     = transferDateTextBox.Text.Trim().ToString();
        transferObj.TransferorRegNo  = tferorRegNoTextBox.Text.Trim().ToString();
        transferObj.TferorBranchCode = tferorBranchCodeTextBox.Text.Trim().ToString();
        transferObj.TransfereeRegNo  = tfereeRegNoTextBox.Text.Trim().ToString();
        transferObj.TfereeBranchCode = tfereeBranhCodeTextBox.Text.Trim().ToString();

        try
        {
            if (unitTransferBLObj.IsTransferLock(regObj))
            {
                dvContentBottom.Visible = true;
                transferNoTextBox.Focus();
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('" + msgObj.Error().ToString() + " " + "Transfer Opearation is Locked " + "');", true);
            }
            else if (unitTransferBLObj.IsDuplicateTransfer(regObj, transferObj))
            {
                dvContentBottom.Visible = true;
                transferNoTextBox.Focus();
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('" + msgObj.Duplicate().ToString() + " " + "Transfer Number " + "');", true);
            }
            else
            {
                DataTable dtGrid = opendMFDAO.getTableDataGrid();
                DataRow   drGrid;
                foreach (DataGridItem gridRow in leftDataGrid.Items)
                {
                    CheckBox leftCheckBox = (CheckBox)gridRow.FindControl("leftCheckBox");
                    if (leftCheckBox.Checked)
                    {
                        drGrid                = dtGrid.NewRow();
                        drGrid["SL_NO"]       = gridRow.Cells[1].Text.Trim().ToString();
                        drGrid["CERTIFICATE"] = gridRow.Cells[2].Text.Trim().ToString();
                        drGrid["QTY"]         = gridRow.Cells[3].Text.Trim().ToString();
                        dtGrid.Rows.Add(drGrid);
                    }
                }

                unitTransferBLObj.saveTransfer(dtGrid, regObj, transferObj, userObj); //save Transfer Data
                ClearText();
                leftDataGrid.DataSource = opendMFDAO.getTableDataGrid();              // hide remaining Data
                leftDataGrid.DataBind();
                tferorRegNoTextBox.Focus();
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save SuccessFully');", true);
            }
        }
        catch (Exception ex)
        {
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('" + msgObj.Error().ToString() + " " + ex.Message.Replace("'", "").ToString() + "');", true);
        }
    }
Esempio n. 2
0
    protected void SaveButton_Click(object sender, EventArgs e)
    {
        UnitHolderRegistration regObj = new UnitHolderRegistration();
        // UnitTransfer transferObj = new UnitTransfer();
        UnitRepurchase unitRepObj = new UnitRepurchase();

        regObj.FundCode   = FundCodeTextBox.Text.Trim();
        regObj.BranchCode = BranchCodeTextBox.Text.Trim();
        regObj.RegNumber  = RegNoTextBox.Text.Trim();

        unitRepObj.RepurchaseNo   = Convert.ToInt32(RepNoTextBox.Text.Trim().ToString());
        unitRepObj.RepurchaseRate = Convert.ToInt32(RepRateTextBox.Text.Trim().ToString());
        unitRepObj.RepurchaseDate = RepDateTextBox.Text.Trim().ToString();

        try
        {
            if (unitRepBLObj.IsDuplicateRepurchase(regObj, unitRepObj))
            {
                dvContentBottom.Visible = true;
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('" + msgObj.Duplicate().ToString() + " " + "Repurchase Number " + "');", true);
            }
            else
            {
                DataTable dtGrid = opendMFDAO.getTableDataGrid();
                DataRow   drGrid;
                foreach (DataGridItem gridRow in leftDataGrid.Items)
                {
                    CheckBox leftCheckBox = (CheckBox)gridRow.FindControl("leftCheckBox");
                    if (leftCheckBox.Checked)
                    {
                        drGrid                = dtGrid.NewRow();
                        drGrid["SL_NO"]       = gridRow.Cells[1].Text.Trim().ToString();
                        drGrid["CERTIFICATE"] = gridRow.Cells[2].Text.Trim().ToString();
                        drGrid["QTY"]         = gridRow.Cells[3].Text.Trim().ToString();
                        dtGrid.Rows.Add(drGrid);
                    }
                }

                unitRepBLObj.saveRepurchase(dtGrid, regObj, unitRepObj, userObj);//save Repurchase Data
                ClearText();

                leftDataGrid.DataSource = opendMFDAO.getTableDataGrid();// hide remaining Data
                leftDataGrid.DataBind();
                TotalUnitHoldingTextBox.Text = "";

                //RepNoTextBox.Text = unitRepBLObj.getNextRepurchaseNo(regObj, userObj).ToString();
                //unitRepObj.RepurchaseNo = unitRepBLObj.getNextRepurchaseNo(regObj, userObj) - 1;
                //RepDateTextBox.Text = unitRepBLObj.getLastRepDate(regObj, unitRepObj).ToString("dd-MMM-yyyy");
                //RepRateTextBox.Text = unitRepBLObj.getLastRepRate(regObj, unitRepObj).ToString();
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save SuccessFully');", true);
            }
        }
        catch (Exception ex)
        {
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('" + msgObj.Error().ToString() + " " + ex.Message.Replace("'", "").ToString() + "');", true);
        }
    }
Esempio n. 3
0
    protected void SaveButton_Click(object sender, EventArgs e)
    {
        UnitHolderRegistration regObj = new UnitHolderRegistration();
        // UnitTransfer transferObj = new UnitTransfer();
        UnitRepurchase unitRepObj = new UnitRepurchase();

        regObj.FundCode   = FundCodeTextBox.Text.Trim();
        regObj.BranchCode = BranchCodeTextBox.Text.Trim();
        regObj.RegNumber  = RegNoTextBox.Text.Trim();

        unitRepObj.RepurchaseNo   = Convert.ToInt32(RepNoTextBox.Text.Trim().ToString());
        unitRepObj.RepurchaseRate = decimal.Parse(RepRateTextBox.Text.Trim().ToString());
        unitRepObj.RepurchaseDate = RepDateTextBox.Text.Trim().ToString();
        if (EFTRadioButton.Checked)
        {
            unitRepObj.PayType = "EFT";
        }
        else
        {
            unitRepObj.PayType = "CHQ";
        }


        try
        {
            if (opendMFDAO.IsValidRegistration(regObj))
            {
                if (unitRepBLObj.IsRepurchaseLock(regObj))
                {
                    dvContentBottom.Visible = true;
                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('" + msgObj.Error().ToString() + " " + " Repurchase Operation is locked " + "');", true);
                }

                else if (unitRepBLObj.IsDuplicateRepurchase(regObj, unitRepObj))
                {
                    dvContentBottom.Visible = true;
                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('" + msgObj.Duplicate().ToString() + " " + "Repurchase Number " + "');", true);
                }
                else if (!unitRepBLObj.IsValidBEFTN(regObj, unitRepObj))
                {
                    dvContentBottom.Visible = true;
                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('" + msgObj.Error().ToString() + " " + "Either No Router Number  or Account Number>13 digits " + "');", true);
                }
                else if (unitRepBLObj.IsIDAccount(regObj, unitRepObj))
                {
                    dvContentBottom.Visible = true;
                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('" + msgObj.Error().ToString() + " " + "ID Account is not allow to BEFTN " + "');", true);
                }
                else
                {
                    long      totalSurrenderUnits = 0;
                    DataTable dtGrid = opendMFDAO.getTableDataGrid();
                    DataRow   drGrid;
                    foreach (DataGridItem gridRow in leftDataGrid.Items)
                    {
                        CheckBox leftCheckBox = (CheckBox)gridRow.FindControl("leftCheckBox");
                        if (leftCheckBox.Checked)
                        {
                            drGrid                = dtGrid.NewRow();
                            drGrid["SL_NO"]       = gridRow.Cells[1].Text.Trim().ToString();
                            drGrid["CERTIFICATE"] = gridRow.Cells[2].Text.Trim().ToString();
                            drGrid["QTY"]         = gridRow.Cells[3].Text.Trim().ToString();
                            totalSurrenderUnits   = totalSurrenderUnits + Convert.ToInt64(gridRow.Cells[3].Text.Trim().ToString());
                            dtGrid.Rows.Add(drGrid);
                        }
                    }
                    if (dtGrid.Rows.Count > 0)
                    {
                        if (totalSurrenderUnits == Convert.ToInt64(TotalUnitRepurchaseTextBox.Text))
                        {
                            unitRepBLObj.saveRepurchase(dtGrid, regObj, unitRepObj, userObj);//save Repurchase Data
                            ClearText();

                            leftDataGrid.DataSource = opendMFDAO.getTableDataGrid();// hide remaining Data
                            leftDataGrid.DataBind();
                            TotalUnitHoldingTextBox.Text = "";
                            EFTRadioButton.Checked       = true;
                            CHQRadioButton.Checked       = false;

                            //NormalRadioButton.Checked = true;
                            //DeathRadioButton.Checked = false;
                            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save SuccessFully');", true);
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed : Total Selected Units and Add Total Units is not equal');", true);
                        }
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due to No Sale Selected');", true);
                    }
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Invalid Registration Number');", true);
            }
        }
        catch (Exception ex)
        {
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('" + msgObj.Error().ToString() + " " + ex.Message.Replace("'", "").ToString() + "');", true);
        }
    }
Esempio n. 4
0
    protected void SaveButton_Click(object sender, EventArgs e)
    {
        UnitHolderRegistration regObj = new UnitHolderRegistration();
        // UnitTransfer transferObj = new UnitTransfer();
        UnitRepurchase unitRepObj = new UnitRepurchase();

        regObj.FundCode   = FundCodeTextBox.Text.Trim();
        regObj.BranchCode = BranchCodeTextBox.Text.Trim();
        regObj.RegNumber  = RegNoTextBox.Text.Trim();

        unitRepObj.RepurchaseNo   = Convert.ToInt32(moneyReceipDropDownList.SelectedItem.Text.ToString());
        unitRepObj.RepurchaseRate = decimal.Parse(RepRateTextBox.Text.Trim().ToString());
        unitRepObj.RepurchaseDate = RepDateTextBox.Text.Trim().ToString();
        unitRepObj.PayType        = payTypeLabel.Text.ToUpper();



        try
        {
            if (opendMFDAO.IsValidRegistration(regObj))
            {
                if (unitRepBLObj.IsRepurchaseLock(regObj))
                {
                    dvContentBottom.Visible = true;
                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('" + msgObj.Error().ToString() + " " + " Repurchase Operation is locked " + "');", true);
                }

                else if (unitRepBLObj.IsDuplicateRepurchase(regObj, unitRepObj))
                {
                    dvContentBottom.Visible = true;
                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('" + msgObj.Duplicate().ToString() + " " + "Repurchase Number " + "');", true);
                }
                else if (!unitRepBLObj.IsValidBEFTN(regObj, unitRepObj))
                {
                    dvContentBottom.Visible = true;
                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('" + msgObj.Error().ToString() + " " + "Either No Router Number  or Account Number>13 digits " + "');", true);
                }
                else if (unitRepBLObj.IsIDAccount(regObj, unitRepObj))
                {
                    dvContentBottom.Visible = true;
                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('" + msgObj.Error().ToString() + " " + "ID Account is not allow to BEFTN " + "');", true);
                }
                else
                {
                    long      totalSurrenderUnits = 0;
                    DataTable dtGrid = opendMFDAO.getTableDataGrid();
                    DataRow   drGrid;
                    foreach (DataGridItem gridRow in leftDataGrid.Items)
                    {
                        CheckBox leftCheckBox = (CheckBox)gridRow.FindControl("leftCheckBox");
                        if (leftCheckBox.Checked)
                        {
                            drGrid                = dtGrid.NewRow();
                            drGrid["SL_NO"]       = gridRow.Cells[1].Text.Trim().ToString();
                            drGrid["CERTIFICATE"] = gridRow.Cells[2].Text.Trim().ToString();
                            drGrid["QTY"]         = gridRow.Cells[3].Text.Trim().ToString();
                            totalSurrenderUnits   = totalSurrenderUnits + Convert.ToInt64(gridRow.Cells[3].Text.Trim().ToString());
                            dtGrid.Rows.Add(drGrid);
                        }
                    }
                    if (dtGrid.Rows.Count > 0)
                    {
                        if (totalSurrenderUnits == Convert.ToInt64(TotalUnitRepurchaseTextBox.Text) && totalSurrenderUnits == Convert.ToInt64(QtyTextBox.Text))
                        {
                            commonGatewayObj.ExecuteNonQuery("UPDATE MONEY_RECEIPT SET SL_REP_TR_RN_NO=" + unitRepObj.RepurchaseNo + "  WHERE ID=" + Convert.ToUInt64(moneyReceipDropDownList.SelectedValue.ToString()));
                            unitRepBLObj.saveRepurchase(dtGrid, regObj, unitRepObj, userObj);//save Repurchase Data
                            ClearText();

                            moneyReceipDropDownList.DataSource     = unitSaleBLObj.dtMoneyRecieptforDDL(" AND REG_BK = '" + regObj.FundCode.ToString().ToUpper() + "' AND REG_BR = '" + regObj.BranchCode.ToString().ToUpper() + "'AND RECEIPT_TYPE = 'REP' AND SL_REP_TR_RN_NO IS NULL  ORDER BY RECEIPT_NO DESC ");
                            moneyReceipDropDownList.DataTextField  = "RECEIPT_NO";
                            moneyReceipDropDownList.DataValueField = "ID";
                            moneyReceipDropDownList.DataBind();

                            leftDataGrid.DataSource = opendMFDAO.getTableDataGrid();// hide remaining Data
                            leftDataGrid.DataBind();
                            TotalUnitHoldingTextBox.Text = "";

                            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save SuccessFully');", true);
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed : Total Selected Units and Add Total Units is not equal');", true);
                        }
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due to No Sale Selected');", true);
                    }
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Invalid Registration Number');", true);
            }
        }
        catch (Exception ex)
        {
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('" + msgObj.Error().ToString() + " " + ex.Message.Replace("'", "").ToString() + "');", true);
        }
    }
    protected void SaveButton_Click(object sender, EventArgs e)
    {
        UnitHolderRegistration regObj = new UnitHolderRegistration();

        regObj.FundCode   = FundCodeTextBox.Text.Trim();
        regObj.BranchCode = BranchCodeTextBox.Text.Trim();
        regObj.RegNumber  = RegNoTextBox.Text.Trim();
        UnitLien unitLienObj = new UnitLien();

        unitLienObj.LienCancelNo      = Convert.ToInt32(LienMarkCancelNoTextBox.Text.Trim().ToString());
        unitLienObj.LienNo            = Convert.ToInt32(LienMarkDropDownList.SelectedValue.ToString());
        unitLienObj.LienInst          = Convert.ToInt16(LienbankNameDropDownList.SelectedValue.ToString());
        unitLienObj.LienInstBranch    = Convert.ToInt32(LienbranchNameDropDownList.SelectedValue.ToString());
        unitLienObj.LienRefference    = LienCancelReqRefTextBox.Text.Trim().ToString();
        unitLienObj.LienCancelReqDate = LienCancelReqDateTextBox.Text.Trim().ToString();
        unitLienObj.LienCancelDate    = DateTime.Today.ToString();

        try
        {
            if (unitLienBLObj.IsDuplicateLienCancel(regObj, unitLienObj))
            {
                dvContentBottom.Visible = true;
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('" + msgObj.Duplicate().ToString() + " " + "Lien Cancel Number " + "');", true);
            }
            else
            {
                long      totalSurrenderUnits = 0;
                DataTable dtGrid = opendMFDAO.getTableDataGrid();
                DataRow   drGrid;
                foreach (DataGridItem gridRow in leftDataGrid.Items)
                {
                    CheckBox leftCheckBox = (CheckBox)gridRow.FindControl("leftCheckBox");
                    if (leftCheckBox.Checked)
                    {
                        drGrid                = dtGrid.NewRow();
                        drGrid["SL_NO"]       = gridRow.Cells[1].Text.Trim().ToString();
                        drGrid["CERTIFICATE"] = gridRow.Cells[2].Text.Trim().ToString();
                        drGrid["QTY"]         = gridRow.Cells[3].Text.Trim().ToString();
                        totalSurrenderUnits   = totalSurrenderUnits + Convert.ToInt64(gridRow.Cells[3].Text.Trim().ToString());
                        dtGrid.Rows.Add(drGrid);
                    }
                }
                if (totalSurrenderUnits == Convert.ToInt64(TotalUnitLienCancelTextBox.Text))
                {
                    unitLienBLObj.saveLienMarkCancel(dtGrid, regObj, unitLienObj, userObj); //save Lien Cancel Data
                    leftDataGrid.DataSource = opendMFDAO.getTableDataGrid();                // hide remaining Data
                    leftDataGrid.DataBind();
                    TotalLienUnitHoldingTextBox.Text   = "";
                    LienMarkDropDownList.SelectedValue = "0";

                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save SuccessFully');", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed : Total Selected Units and Add Total Units is not equal');", true);
                }
            }
        }
        catch (Exception ex)
        {
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('" + msgObj.Error().ToString() + " " + ex.Message.Replace("'", "").ToString() + "');", true);
        }
    }
    protected void SaveButton_Click(object sender, EventArgs e)
    {
        UnitHolderRegistration regObj = new UnitHolderRegistration();

        regObj.FundCode   = fundCodeTextBox.Text;
        regObj.BranchCode = branchCodeTextBox.Text;
        regObj.RegNumber  = regNoTextBox.Text;

        renwalObj                = new UnitRenewal();
        renwalObj.RenewalNo      = renewalNumberTextBox.Text.Trim().ToString();
        renwalObj.RenewalDate    = renewalDateTextBox.Text.Trim().ToString();
        renwalObj.RenewalType    = renewalTypeDropDownList.SelectedValue.ToString().ToUpper();
        renwalObj.RenewalUnitQty = Convert.ToInt32(renewalUnitsTextBox.Text.Trim());

        try
        {
            if (renewalBLObj.IsRenewalLock(regObj))
            {
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('" + msgObj.Error().ToString() + " " + "Renewal Operation is Locked " + "');", true);
            }
            else if (renewalBLObj.IsDuplicateRenewal(regObj, renwalObj))
            {
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('" + msgObj.Duplicate().ToString() + " " + "Renewal Number " + "');", true);
            }
            else
            {
                int       rowNumber = 1;
                int       line      = 0;
                DataTable dtDino    = opendMFDAO.getTableDinomination();
                DataRow   drDino;
                bool      invalidCert       = false;
                bool      allocateCert      = true;
                int       duplicateCerNoReg = 0;
                string    dino  = "";
                string    cerNo = "";
                foreach (DataGridItem gridItem in dinoGridView.Items)
                {
                    drDino = dtDino.NewRow();
                    TextBox txtDino   = null;
                    TextBox txtCert   = null;
                    TextBox txtWeight = null;
                    txtDino           = (TextBox)(gridItem.FindControl("dinoTextBox"));
                    txtCert           = (TextBox)(gridItem.FindControl("certNoTextBox"));
                    txtWeight         = (TextBox)(gridItem.FindControl("weightTextBox"));
                    duplicateCerNoReg = opendMFDAO.duplicateCerNoReg(regObj, txtDino.Text.ToString(), txtCert.Text.ToString());
                    allocateCert      = unitSaleBLObj.IsCertificateAllocate(regObj, txtDino.Text.ToString(), txtCert.Text.ToString());
                    if (duplicateCerNoReg == 0)
                    {
                        if (opendMFDAO.validationDino(txtDino.Text.ToString().ToUpper(), regObj.FundCode.ToString().ToUpper()) && opendMFDAO.validationWeight(Convert.ToInt32(txtWeight.Text.ToString()), regObj.FundCode.ToString().ToUpper()))
                        {
                            if (allocateCert)
                            {
                                drDino["dino"]        = txtDino.Text.Trim().ToString().ToUpper();
                                drDino["cert_no"]     = Convert.ToInt32(txtCert.Text.Trim().ToString());
                                drDino["cert_weight"] = Convert.ToInt32(txtWeight.Text.Trim().ToString());
                                dtDino.Rows.Add(drDino);
                                rowNumber++;
                            }
                            else
                            {
                                allocateCert = false;
                                line         = rowNumber;
                                dino         = txtDino.Text.Trim().ToString();
                                cerNo        = txtCert.Text.Trim().ToString();
                                break;
                            }
                        }
                        else
                        {
                            invalidCert = true;
                            line        = rowNumber;
                            break;
                        }
                    }
                    else
                    {
                        dino  = txtDino.Text.Trim().ToString();
                        cerNo = txtCert.Text.Trim().ToString();
                        break;
                    }
                }

                if (duplicateCerNoReg > 0)
                {
                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('Certificate " + dino + "-" + cerNo + " is Already Used to Reg No:" + duplicateCerNoReg + "');", true);
                }
                else
                {
                    if (invalidCert)
                    {
                        ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('Save Failed!!Invalid Dinomination or Weight at Line: " + line + "');", true);
                    }
                    else if (!allocateCert)
                    {
                        ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('Save Failed!! Line: " + line + " and Certificate No: " + dino + "-" + cerNo + " is not allocated in this branch');", true);
                    }
                    else if (!invalidCert && allocateCert)
                    {
                        DataTable dtGrid = opendMFDAO.getTableDataGrid();
                        DataRow   drGrid;
                        foreach (DataGridItem gridRow in leftDataGrid.Items)
                        {
                            CheckBox leftCheckBox = (CheckBox)gridRow.FindControl("leftCheckBox");
                            if (leftCheckBox.Checked)
                            {
                                drGrid                = dtGrid.NewRow();
                                drGrid["SL_NO"]       = gridRow.Cells[1].Text.Trim().ToString();
                                drGrid["CERTIFICATE"] = gridRow.Cells[2].Text.Trim().ToString();
                                drGrid["QTY"]         = gridRow.Cells[3].Text.Trim().ToString();
                                dtGrid.Rows.Add(drGrid);
                            }
                        }

                        renewalBLObj.SaveUnitRenewal(regObj, dtGrid, renwalObj, dtDino, userObj);
                        // unitSaleBLObj.SaveUnitSale(regObj, saleObj, dtDino, userObj);
                        ClearText();
                        leftDataGrid.Visible      = false;
                        renewalNumberTextBox.Text = "";
                        regNoTextBox.Text         = "";
                        //saleNumberTextBox.Text = unitSaleBLObj.getNextSaleNo(regObj, userObj).ToString();
                        //saleObj.SaleNo = unitSaleBLObj.getNextSaleNo(regObj, userObj) - 1;
                        //saleDateTextBox.Text = opendMFDAO.getLastSaleDate(regObj, saleObj).ToString("dd-MMM-yyyy");
                        //saleRateTextBox.Text = opendMFDAO.getLastSaleRate(regObj, saleObj).ToString();
                        ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('" + msgObj.Success().ToString() + "');", true);
                    }
                }
            }
        }
        catch (Exception ex)
        {
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('" + msgObj.Error().ToString() + " " + ex.Message.Replace("'", "").ToString() + "');", true);
        }
    }