Esempio n. 1
0
    protected void tferorRegNoTextBox_TextChanged(object sender, EventArgs e)
    {
        UnitHolderRegistration unitRegObj = new UnitHolderRegistration();

        unitRegObj.FundCode   = tferorFundCodeTextBox.Text.Trim();
        unitRegObj.BranchCode = tferorBranchCodeTextBox.Text.Trim();
        unitRegObj.RegNumber  = tferorRegNoTextBox.Text.Trim();


        DataTable dtRegInfo            = opendMFDAO.getDtRegInfo(unitRegObj);
        DataTable dtTotalSaleUnitCerts = opendMFDAO.getDtTotalSaleUnitCertsCDS(unitRegObj);
        decimal   TotalUnitsBalance    = opendMFDAO.getTotalSaleUnitBalanceCDS(unitRegObj);

        if (dtRegInfo.Rows.Count > 0)
        {
            tferorHolderNameTextBox.Text  = dtRegInfo.Rows[0]["HNAME"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["HNAME"].ToString();
            tferorjHolderNameTextBox.Text = dtRegInfo.Rows[0]["JNT_NAME"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["JNT_NAME"].ToString();

            string[] branchCodeSign    = unitRegObj.BranchCode.Split('/');
            string   imageSignLocation = Path.Combine(ConfigReader.SingLocation + "\\" + unitRegObj.FundCode, unitRegObj.FundCode + "_" + branchCodeSign[0] + "_" + branchCodeSign[1] + "_" + unitRegObj.RegNumber + ".jpg");

            if (File.Exists(Path.Combine(ConfigReader.SingLocation + "\\" + unitRegObj.FundCode, unitRegObj.FundCode.ToString() + "_" + branchCodeSign[0] + "_" + branchCodeSign[1] + "_" + unitRegObj.RegNumber + ".jpg")))
            {
                SignImage.ImageUrl = encrypt.PhotoBase64ImgSrc(imageSignLocation.ToString());
            }
            else
            {
                SignImage.ImageUrl = encrypt.PhotoBase64ImgSrc(Path.Combine(ConfigReader.SingLocation, "Notavailable.JPG").ToString());
            }
            if (dtTotalSaleUnitCerts.Rows.Count > 0)
            {
                transferNoTextBox.Text  = unitTransferBLObj.getNextTransferNo(unitRegObj, userObj).ToString();
                leftDataGrid.DataSource = dtTotalSaleUnitCerts;
                leftDataGrid.DataBind();
                TotalUnitHoldingTextBox.Text    = TotalUnitsBalance.ToString();
                TotalUnitRepurchaseTextBox.Text = "";
            }
            else
            {
                transferNoTextBox.Text          = "";
                TotalUnitHoldingTextBox.Text    = "";
                TotalUnitRepurchaseTextBox.Text = "";
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('No Units To Transfer');", true);
            }
        }
        else
        {
            TotalUnitHoldingTextBox.Text    = "";
            tferorHolderNameTextBox.Text    = "";
            tferorjHolderNameTextBox.Text   = "";
            TotalUnitRepurchaseTextBox.Text = "";
            transferNoTextBox.Text          = "";

            // dvContentBottom.Visible = false;
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Invalid Registration Number');", true);
        }
    }
Esempio n. 2
0
    protected void RegNoTextBox_TextChanged(object sender, EventArgs e)
    {
        UnitHolderRegistration unitRegObj = new UnitHolderRegistration();

        unitRegObj.FundCode   = FundCodeTextBox.Text.Trim();
        unitRegObj.BranchCode = BranchCodeTextBox.Text.Trim();
        unitRegObj.RegNumber  = RegNoTextBox.Text.Trim();
        UnitRepurchase unitRepObj = new UnitRepurchase();

        if (opendMFDAO.IsValidRegistration(unitRegObj))
        {
            DataTable dtRegInfo            = opendMFDAO.getDtRegInfo(unitRegObj);
            DataTable dtTotalSaleUnitCerts = opendMFDAO.getDtTotalSaleUnitCertsCDS(unitRegObj);
            decimal   TotalUnitsBalance    = opendMFDAO.getTotalSaleUnitBalanceCDS(unitRegObj);
            if (dtRegInfo.Rows.Count > 0)
            {
                HolderNameTextBox.Text = dtRegInfo.Rows[0]["HNAME"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["HNAME"].ToString();

                HolderJNameTextBox.Text = dtRegInfo.Rows[0]["JNT_NAME"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["JNT_NAME"].ToString();

                string[] BranchCodeSign     = unitRegObj.BranchCode.Split('/');
                string   imageSignLocation  = Path.Combine(ConfigReader.SingLocation + "\\" + unitRegObj.FundCode, unitRegObj.FundCode + "_" + BranchCodeSign[0] + "_" + BranchCodeSign[1] + "_" + unitRegObj.RegNumber + ".jpg");//"../../Image/IAMCL/Sign/"+ fundCode + "_" + branchCode + "_" + regNo + ".jpg";
                string   imagePhotoLocation = Path.Combine(ConfigReader.PhotoLocation + "\\" + unitRegObj.FundCode, unitRegObj.FundCode + "_" + "_" + BranchCodeSign[0] + BranchCodeSign[1] + "_" + unitRegObj.RegNumber + ".jpg");

                if (File.Exists(Path.Combine(ConfigReader.SingLocation + "\\" + unitRegObj.FundCode, unitRegObj.FundCode + "_" + BranchCodeSign[0] + "_" + BranchCodeSign[1] + "_" + unitRegObj.RegNumber + ".jpg")))
                {
                    SignImage.ImageUrl = encrypt.PhotoBase64ImgSrc(imageSignLocation.ToString());
                }
                else
                {
                    SignImage.ImageUrl = encrypt.PhotoBase64ImgSrc(Path.Combine(ConfigReader.SingLocation, "Notavailable.JPG").ToString());
                }
                if (dtTotalSaleUnitCerts.Rows.Count > 0)
                {
                    leftDataGrid.DataSource = dtTotalSaleUnitCerts;
                    leftDataGrid.DataBind();
                    TotalUnitHoldingTextBox.Text = TotalUnitsBalance.ToString();
                }
                else
                {
                    TotalUnitHoldingTextBox.Text    = "";
                    TotalUnitRepurchaseTextBox.Text = "";

                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('No Units To Repurchase');", true);
                }
                TotalUnitRepurchaseTextBox.Text = "";
                RepNoTextBox.Text       = unitRepBLObj.getNextRepurchaseNo(unitRegObj, userObj).ToString();
                unitRepObj.RepurchaseNo = unitRepBLObj.getNextRepurchaseNo(unitRegObj, userObj) - 1;
                RepDateTextBox.Text     = unitRepBLObj.getLastRepDate(unitRegObj, unitRepObj).ToString("dd-MMM-yyyy");
                RepRateTextBox.Text     = unitRepBLObj.getLastRepRate(unitRegObj, unitRepObj).ToString();
            }
            else
            {
                TotalUnitHoldingTextBox.Text    = "";
                TotalUnitRepurchaseTextBox.Text = "";

                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('No Units To Repurchase');", true);
            }
        }
        else
        {
            ClearText();
            TotalUnitHoldingTextBox.Text    = "";
            TotalUnitRepurchaseTextBox.Text = "";

            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Invalid Registration Number');", true);
        }
    }
    protected void moneyReceipDropDownList_SelectedIndexChanged(object sender, EventArgs e)
    {
        DataTable dtMoneyReceitInfoDetails = unitSaleBLObj.dtMoneyRecieptInfoDetails(Convert.ToInt64(moneyReceipDropDownList.SelectedValue.ToString()));

        if (dtMoneyReceitInfoDetails.Rows.Count > 0)
        {
            regObj.FundCode     = FundCodeTextBox.Text.ToString();
            regObj.BranchCode   = BranchCodeTextBox.Text.ToString();
            regObj.RegNumber    = dtMoneyReceitInfoDetails.Rows[0]["REG_NO"].ToString();
            RegNoTextBox.Text   = dtMoneyReceitInfoDetails.Rows[0]["REG_NO"].ToString();
            QtyTextBox.Text     = dtMoneyReceitInfoDetails.Rows[0]["UNIT_QTY"].ToString();
            RepDateTextBox.Text = Convert.ToDateTime(dtMoneyReceitInfoDetails.Rows[0]["RECEIPT_DATE"].ToString()).ToString("dd-MMM-yyyy");
            RepRateTextBox.Text = dtMoneyReceitInfoDetails.Rows[0]["RATE"].ToString();
            if (!dtMoneyReceitInfoDetails.Rows[0]["REP_PAY_TYPE"].Equals(DBNull.Value))
            {
                payTypeLabel.Text = dtMoneyReceitInfoDetails.Rows[0]["REP_PAY_TYPE"].ToString().ToUpper();
            }
            DataTable dtRegInfo            = opendMFDAO.getDtRegInfo(regObj);
            DataTable dtTotalSaleUnitCerts = opendMFDAO.getDtTotalSaleUnitCertsCDS(regObj);
            decimal   TotalUnitsBalance    = opendMFDAO.getTotalSaleUnitBalanceCDS(regObj);

            if (dtRegInfo.Rows.Count > 0)
            {
                HolderNameTextBox.Text  = dtRegInfo.Rows[0]["HNAME"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["HNAME"].ToString();
                HolderJNameTextBox.Text = dtRegInfo.Rows[0]["JNT_NAME"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["JNT_NAME"].ToString();
                string[] BranchCodeSign     = regObj.BranchCode.Split('/');
                string   imageSignLocation  = Path.Combine(ConfigReader.SingLocation + "\\" + regObj.FundCode, regObj.FundCode + "_" + BranchCodeSign[0] + "_" + BranchCodeSign[1] + "_" + regObj.RegNumber + ".jpg");//"../../Image/IAMCL/Sign/"+ fundCode + "_" + branchCode + "_" + regNo + ".jpg";
                string   imagePhotoLocation = Path.Combine(ConfigReader.PhotoLocation + "\\" + regObj.FundCode, regObj.FundCode + "_" + "_" + BranchCodeSign[0] + BranchCodeSign[1] + "_" + regObj.RegNumber + ".jpg");

                if (File.Exists(Path.Combine(ConfigReader.SingLocation + "\\" + regObj.FundCode, regObj.FundCode + "_" + BranchCodeSign[0] + "_" + BranchCodeSign[1] + "_" + regObj.RegNumber + ".jpg")))
                {
                    SignImage.ImageUrl = encrypt.PhotoBase64ImgSrc(imageSignLocation.ToString());
                }
                else
                {
                    SignImage.ImageUrl = encrypt.PhotoBase64ImgSrc(Path.Combine(ConfigReader.SingLocation, "Notavailable.JPG").ToString());
                }
                if (dtTotalSaleUnitCerts.Rows.Count > 0)
                {
                    leftDataGrid.DataSource = dtTotalSaleUnitCerts;
                    leftDataGrid.DataBind();
                    TotalUnitHoldingTextBox.Text = TotalUnitsBalance.ToString();
                }
                else
                {
                    TotalUnitHoldingTextBox.Text    = "";
                    TotalUnitRepurchaseTextBox.Text = "";


                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('No Units To Repurchase');", true);
                }
            }
            else
            {
                ClearText();
                TotalUnitHoldingTextBox.Text    = "";
                TotalUnitRepurchaseTextBox.Text = "";

                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('No Units To Repurchase');", true);
            }
        }
        else
        {
            ClearText();
            TotalUnitHoldingTextBox.Text    = "";
            TotalUnitRepurchaseTextBox.Text = "";
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('No Data Found');", true);
        }
    }