Exemplo n.º 1
0
    protected void SubmitButton_Click(object sender, EventArgs e)
    {
        Hashtable htUpdate = new Hashtable();

        try
        {
            bool isDupliacteDRF = unitSaleBLObj.CheckDuplicateSaleRelatedInfo(" AND SALE.REG_BK='" + fundCode + "' AND SALE.DRF_ACCEPT_NO='" + DRFNoTextBox.Text + "'");
            bool isDupliacteDRN = unitSaleBLObj.CheckDuplicateSaleRelatedInfo(" AND SALE.REG_BK='" + fundCode + "' AND SALE.DRF_DRN ='" + DRNTextBox.Text + "'");

            if (isDupliacteDRF)
            {
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due to Duplicate DRF No');", true);
            }
            else if (isDupliacteDRN)
            {
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due to Duplicate DRN');", true);
            }

            else
            {
                commonGatewayObj.BeginTransaction();

                htUpdate = new Hashtable();
                htUpdate.Add("DRF_ACCEPT_ENTRY_BY", userObj.UserID.ToString());
                htUpdate.Add("DRF_ACCEPT_ENTRY_DATE", DateTime.Now);
                htUpdate.Add("DRF_ACCEPT_NO", DRFNoTextBox.Text.Trim().ToString());
                htUpdate.Add("DRF_DRN", DRNTextBox.Text.Trim().ToString());
                htUpdate.Add("DRF_ACCEPT_DATE", DamateDateTextBox.Text.Trim().ToString());


                commonGatewayObj.Update(htUpdate, "SALE", "REG_BK='" + fundCode.ToUpper().ToString() + "' AND REG_BR='" + branchCode.ToUpper().ToString() + "' AND SALE.DRF_REF_NO=" + DRRefNoDropDownList.SelectedValue.ToString());

                commonGatewayObj.CommitTransaction();
                DRRefNoDropDownList.DataSource     = unitSaleBLObj.dtDRRefNoListForDRN("AND SALE.REG_BK='" + fundCode + "'");
                DRRefNoDropDownList.DataTextField  = "NAME";
                DRRefNoDropDownList.DataValueField = "ID";
                DRRefNoDropDownList.DataBind();

                DRFNoTextBox.Text      = "";
                DRNTextBox.Text        = "";
                DamateDateTextBox.Text = "";
                FolioNoLabel.Text      = "";
                CertNoLabel.Text       = "";
                DistinctNoToLabel.Text = "";
                DistNoFromLabel.Text   = "";
                TotalUnitLabel.Text    = "";
                DataTable dtSaleInfoForDRF = unitSaleBLObj.dtGetSaleInfoForDemate(" AND SALE.REG_BK='" + fundCode + "' AND SALE.REG_BR='" + branchCode + "' AND SALE.DRF_REF_NO=0");
                SaleListGridView.DataSource = dtSaleInfoForDRF;
                SaleListGridView.DataBind();
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('Save Successfully');", true);
            }
        }
        catch (Exception ex)
        {
            commonGatewayObj.RollbackTransaction();
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due to Error:" + ex.Message.ToString() + "');", true);
        }
    }
Exemplo n.º 2
0
    protected void SubmitButton_Click(object sender, EventArgs e)
    {
        int       countCheck = 0;
        Hashtable htUpdate   = new Hashtable();

        try
        {
            foreach (GridViewRow Drv in SaleListGridView.Rows)
            {
                TextBox TRSeqNoTextBox = (TextBox)SaleListGridView.Rows[countCheck].FindControl("TRSeqNoTextBox");

                bool isDupliacteTrSeqNo = unitSaleBLObj.CheckDuplicateSaleRelatedInfo(" AND SALE.REG_BK='" + fundCode + "' AND SALE.DRF_TR_SEQ_NO='" + TRSeqNoTextBox.Text + "'");


                if (isDupliacteTrSeqNo)
                {
                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due to Duplicate Transfer Sequence Number:" + TRSeqNoTextBox.Text + "');", true);
                    break;
                }

                else
                {
                    commonGatewayObj.BeginTransaction();

                    htUpdate = new Hashtable();
                    htUpdate.Add("DRF_TR_ENTRY_BY", userObj.UserID.ToString());
                    htUpdate.Add("DRF_TR_ENTRY_DATE", DateTime.Now);
                    htUpdate.Add("DRF_TR_SEQ_NO", TRSeqNoTextBox.Text.Trim().ToString());
                    htUpdate.Add("DRF_TR_DATE", TransferDateTextBox.Text.Trim().ToString());

                    commonGatewayObj.Update(htUpdate, "SALE", "REG_BK='" + fundCode.ToUpper().ToString() + "' AND REG_BR='" + branchCode.ToUpper().ToString() + "' AND SALE.DRF_REF_NO=" + DRRefNoDropDownList.SelectedValue.ToString());
                }
                commonGatewayObj.CommitTransaction();
                DRRefNoDropDownList.DataSource     = unitSaleBLObj.dtDRRefNoListForFolioTransfer("AND SALE.REG_BK='" + fundCode + "'");
                DRRefNoDropDownList.DataTextField  = "NAME";
                DRRefNoDropDownList.DataValueField = "ID";
                DRRefNoDropDownList.DataBind();

                TRSeqFromNoTextBox.Text  = "";
                TransferDateTextBox.Text = "";


                DataTable dtSaleInfoForDRF = unitSaleBLObj.dtGetSaleInfoForDemate(" AND SALE.REG_BK='" + fundCode + "' AND SALE.REG_BR='" + branchCode + "' AND SALE.DRF_REF_NO=0");
                SaleListGridView.DataSource = dtSaleInfoForDRF;
                SaleListGridView.DataBind();
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('Save Successfully');", true);

                countCheck++;
            }
        }
        catch (Exception ex)
        {
            commonGatewayObj.RollbackTransaction();
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due to Error:" + ex.Message.ToString() + "');", true);
        }
    }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (BaseContent.IsSessionExpired())
        {
            Response.Redirect("../Default.aspx");
            return;
        }
        bcContent = (BaseClass)Session["BCContent"];

        userObj.UserID         = bcContent.LoginID.ToString();
        fundCode               = bcContent.FundCode.ToString();
        branchCode             = bcContent.BranchCode.ToString();
        spanFundName.InnerText = opendMFDAO.GetFundName(fundCode.ToString());

        if (!IsPostBack)
        {
            DRRefNoDropDownList.DataSource     = unitSaleBLObj.dtDRRefNoListForFolioTransfer("AND SALE.REG_BK='" + fundCode + "'");
            DRRefNoDropDownList.DataTextField  = "NAME";
            DRRefNoDropDownList.DataValueField = "ID";
            DRRefNoDropDownList.DataBind();
        }
    }
Exemplo n.º 4
0
    protected void SubmitButton_Click(object sender, EventArgs e)
    {
        Hashtable htUpdate = new Hashtable();

        try
        {
            bool isDupliacteDRFolioNo       = unitSaleBLObj.CheckDuplicateSaleRelatedInfo(" AND SALE.REG_BK='" + fundCode + "' AND SALE.DRF_REG_FOLIO_NO='" + RegFolioNoTextBox.Text + "'");
            bool isDupliacteDRCertNo        = unitSaleBLObj.CheckDuplicateSaleRelatedInfo(" AND SALE.REG_BK='" + fundCode + "' AND SALE.DRF_CERT_NO ='" + CertNoTextBox.Text + "'");
            bool isDupliacteDRDistinctiveNo = unitSaleBLObj.CheckDuplicateSaleRelatedInfo("AND ((SALE.DRF_DISTNCT_NO_FROM BETWEEN " + DistinctNoFromTextBox.Text.Trim().ToString() + " AND " + DistinctNoToTextBox.Text.Trim().ToString() + ") AND (SALE.REG_BK = '" + fundCode + "') OR (SALE.DRF_DISTNCT_NO_TO BETWEEN " + DistinctNoFromTextBox.Text.Trim().ToString() + " AND " + DistinctNoToTextBox.Text.Trim().ToString() + ") AND (SALE.REG_BK = '" + fundCode + "'))");
            if (isDupliacteDRFolioNo)
            {
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due to Duplicate Folio number');", true);
            }
            else if (isDupliacteDRCertNo)
            {
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due to Duplicate Certificate number');", true);
            }
            else if (isDupliacteDRDistinctiveNo)
            {
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due to Duplicate Distinctive number');", true);
            }
            else if (((Convert.ToInt64(DistinctNoToTextBox.Text.Trim().ToString()) - Convert.ToInt64(DistinctNoFromTextBox.Text.Trim().ToString()) + 1)) != Convert.ToInt64(TotalUnitsTextBox.Text.Trim().ToString()))
            {
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due to  Distinctive Range and Total Units is not Eqqaul');", true);
            }
            else
            {
                commonGatewayObj.BeginTransaction();

                htUpdate = new Hashtable();
                htUpdate.Add("DRF_CUST_REQ_BY", userObj.UserID.ToString());
                htUpdate.Add("DRF_CUST_REQ_DATE", DateTime.Now);
                htUpdate.Add("DRF_REG_FOLIO_NO", RegFolioNoTextBox.Text.Trim().ToString());
                htUpdate.Add("DRF_CERT_NO", CertNoTextBox.Text.Trim().ToString());
                htUpdate.Add("DRF_DISTNCT_NO_FROM", DistinctNoFromTextBox.Text.Trim().ToString());
                htUpdate.Add("DRF_DISTNCT_NO_TO", DistinctNoToTextBox.Text.Trim().ToString());

                commonGatewayObj.Update(htUpdate, "SALE", "REG_BK='" + fundCode.ToUpper().ToString() + "' AND REG_BR='" + branchCode.ToUpper().ToString() + "' AND SALE.DRF_REF_NO=" + DRRefNoDropDownList.SelectedValue.ToString());

                commonGatewayObj.CommitTransaction();
                DRRefNoDropDownList.DataSource     = unitSaleBLObj.dtDRRefNoListForCustodian("AND SALE.REG_BK='" + fundCode + "'");
                DRRefNoDropDownList.DataTextField  = "NAME";
                DRRefNoDropDownList.DataValueField = "ID";
                DRRefNoDropDownList.DataBind();

                RegFolioNoTextBox.Text     = "";
                CertNoTextBox.Text         = "";
                DistinctNoFromTextBox.Text = "";
                DistinctNoToTextBox.Text   = "";
                TotalUnitsTextBox.Text     = "";
                DataTable dtSaleInfoForDRF = unitSaleBLObj.dtGetSaleInfoForDemate(" AND SALE.REG_BK='" + fundCode + "' AND SALE.REG_BR='" + branchCode + "' AND SALE.DRF_REF_NO=0");
                SaleListGridView.DataSource = dtSaleInfoForDRF;
                SaleListGridView.DataBind();
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert('Save Successfully');", true);
            }
        }
        catch (Exception ex)
        {
            commonGatewayObj.RollbackTransaction();
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Save Failed Due to Error:" + ex.Message.ToString() + "');", true);
        }
    }