Beispiel #1
0
    protected void ddlBrName_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            txtBrCode.Text   = "";
            txtWorkDate.Text = "";
            txtOpenDate.Text = "";

            txtBrCode.Text = ddlBrName.SelectedValue.ToString();

            ViewState["EntryDate"] = LG.openDay(txtBrCode.Text.Trim().ToString());

            string NextDay = ViewState["EntryDate"].ToString();
            NextDay = conn.AddMonthDay(NextDay, "-1", "D");
A:
            string Holdy = conn.sExecuteScalar("SELECT COUNT(*) FROM AVS1026 WHERE HOLIDAYDATE = '" + conn.ConvertDate(NextDay) + "' AND STATUS = 1 ");
            if (Holdy != "0")
            {
                NextDay = conn.AddMonthDay(NextDay, "-1", "D");
                goto A;
            }
            else
            {
                txtWorkDate.Text = ViewState["EntryDate"].ToString();
                txtOpenDate.Text = NextDay.ToString();
                BindGrid();
                return;
            }
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
        }
    }
    protected void txtPeriod_TextChanged(object sender, EventArgs e)
    {
        try
        {
            if (txtDepAmt.Text == "")
            {
                lblMessage.Text = "First Enter Amount...!!";
                ModalPopup.Show(this.Page);
                txtDepAmt.Focus();
                return;
            }

            if (txtPeriod.Text == "")
            {
                return;
            }
            if (ddlDuration.SelectedValue == "M")
            {
                txtDueDate.Text = conn.AddMonthDay(txtDepDate.Text, txtPeriod.Text, "M").Replace("12:00:00", "");
                txtDueDate.Text = conn.AddMonthDay(txtDepDate.Text, txtPeriod.Text, "M").Replace("12:00:00", "");
            }
            else if (ddlDuration.SelectedValue == "D")
            {
                txtDueDate.Text = conn.AddMonthDay(txtDepDate.Text, txtPeriod.Text, "D").Replace("12:00:00", "");
                txtDueDate.Text = conn.AddMonthDay(txtDepDate.Text, txtPeriod.Text, "D").Replace("12:00:00", "");
            }
            txtIntRate.Focus();
        }
        catch (Exception ex)
        {
            ExceptionLogging.SendErrorToText(ex);
        }
    }
Beispiel #3
0
    public void CalcMatDate()
    {
        try
        {
            string EffDate, MatDate;
            if (TxtPeriod.Text != "")
            {
                if (DdlDuartion.SelectedValue == "M")
                {
                    EffDate = Conn.ConvertDate(TxtEffectDate.Text);

                    MatDate = Conn.AddMonthDay(TxtEffectDate.Text, TxtPeriod.Text, "M");
                    TxtMaturityDate.Text = MatDate.ToString();
                }
                else
                {
                    EffDate = Conn.ConvertDate(TxtEffectDate.Text);

                    MatDate = Conn.AddMonthDay(TxtEffectDate.Text, TxtPeriod.Text, "D");
                    TxtMaturityDate.Text = MatDate.ToString();
                }
            }
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
        }
    }
    protected void TxtPeriod_TextChanged(object sender, EventArgs e)
    {
        try
        {
            if (TxtPeriod.Text == "")
            {
                return;
            }

            if (TxtPrincipal.Text == "")
            {
                WebMsgBox.Show("Enter Deposit Amount", this.Page);
                TxtPrincipal.Focus();
                return;
            }

            //double rate = 0;

            //TxtIntRate.Text = rate.ToString();

            TxtTDate.Text = Conn.AddMonthDay(TxtFDate.Text, TxtPeriod.Text, "M").Replace("12:00:00", "");

            float amt     = (float)Convert.ToDouble(TxtPrincipal.Text);
            float intrate = (float)Convert.ToDouble(TxtIntRate.Text);
            CalculatedepositINT(amt, TxtAccType.Text.ToString(), intrate, Convert.ToInt32(TxtPeriod.Text), "ON MATURITY", "M");
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
        }
    }
    public string ReOpenDay(string BrCode, string EDate, string LoginCode, string Mid, string Flag)
    {
        string RS = "";

        try
        {
            EDate = conn.AddMonthDay(EDate.ToString(), "-1", "D");

            sql = "Exec SP_DayReOpenActivity @BranchCode = '" + BrCode + "', @EntryDate = '" + conn.ConvertDate(EDate).ToString() + "', @LoginCode = '" + LoginCode + "', @Mid = '" + Mid + "', @PcName = '" + conn.PCNAME() + "', @Flag = '" + Flag + "'";
            RS  = conn.sExecuteScalar(sql);
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
        }
        return(RS);
    }
Beispiel #6
0
    protected void TxtRate_TextChanged(object sender, EventArgs e)
    {
        // Get rates wise
        if (ddlduration.SelectedValue == "M")
        {
            DtDueDate.Text = conn.AddMonthDay(dtDeposDate.Text, TxtPeriod.Text, "M").Replace("12:00:00", "");
            DtDueDate.Text = conn.AddMonthDay(dtDeposDate.Text, TxtPeriod.Text, "M").Replace("12:00:00", "");
        }
        else if (ddlduration.SelectedValue == "D")
        {
            DtDueDate.Text = conn.AddMonthDay(dtDeposDate.Text, TxtPeriod.Text, "D").Replace("12:00:00", "");
            DtDueDate.Text = conn.AddMonthDay(dtDeposDate.Text, TxtPeriod.Text, "D").Replace("12:00:00", "");
        }
        // Calculate Interest
        float amt     = (float)Convert.ToDouble(TxtDepoAmt.Text);
        float intrate = (float)Convert.ToDouble(TxtRate.Text);

        CalculatedepositINT(amt, ddlProdCode.SelectedValue.ToString(), intrate, Convert.ToInt32(TxtPeriod.Text), ddlIntrestPay.SelectedItem.Text.ToString(), ddlduration.SelectedItem.Text.ToString());
    }
    protected void GetChrgs(string FL)
    {
        string RES;

        try
        {
            if (FL == "UCC")
            {
                RES = OC.GetCharges(Session["BRCD"].ToString(), Session["EntryDate"].ToString(), FL);
                if (RES != null)
                {
                    TxtChrgsCheque.Text = RES;
                }
            }

            if (FL == "MCM")
            {
                DateTime CDT;
                string   MINMON = "";
                MINMON = OC.GetMinMonth(Session["BRCD"].ToString());
                string chkdt = conn.AddMonthDay(TxtOpenDate.Text, MINMON, "M").Replace("12:00:00", "");
                // OPD = Convert.ToDateTime(TxtOpenDate.Text);
                CDT = Convert.ToDateTime(chkdt);
                if (Convert.ToDateTime(Session["EntryDate"].ToString()) <= CDT)
                {
                    RES = OC.GetCharges(Session["BRCD"].ToString(), Session["EntryDate"].ToString(), FL);
                    if (RES != null)
                    {
                        TxtEarlyClose.Text = RES;
                    }
                }
                else
                {
                    TxtEarlyClose.Text = "0";
                }
            }
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
        }
    }
Beispiel #8
0
 protected void TxtPeriod_TextChanged(object sender, EventArgs e)
 {
     try
     {
         string RT = "";
         string RR = FDR.Getrate(TxtPeriod.Text, TxtProcode.Text, ddlduration.SelectedValue, ViewState["ACCTYPE"].ToString(), Session["BRCD"].ToString(), Session["EntryDate"].ToString());
         if (RR != null)
         {
             TxtRate.Text = RR;
             RT           = TxtRate.Text;
             string PT = ddlduration.SelectedItem.Text;
             if (PT == "Days" || PT == "DAYS")
             {
                 PT = "D";
             }
             else if (PT == "Months" || PT == "MONTHS")
             {
                 PT = "M";
             }
             if (RT != "")
             {
                 // TxtDepoAmt.Text = TxtTotalAmount.Text;
                 double RATE = Convert.ToDouble(RT);
                 DtDueDate.Text = conn.AddMonthDay(dtDeposDate.Text, TxtPeriod.Text, PT).Replace("12:00:00", "");
                 CalculatedepositINT(float.Parse(TxtDepoAmt.Text), TxtProcode.Text, float.Parse(RATE.ToString()), Convert.ToInt32(TxtPeriod.Text), ddlIntrestPay.SelectedItem.Text, ddlduration.SelectedValue);
             }
             BtnSubmit.Focus();
         }
         else
         {
             WebMsgBox.Show("Invalid Period, Add from Interest Master....!", this.Page);
             TxtPeriod.Text = "";
             TxtPeriod.Focus();
         }
     }
     catch (Exception Ex)
     {
         ExceptionLogging.SendErrorToText(Ex);
     }
 }
Beispiel #9
0
    protected void ddlBrName_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            txtBrCode.Text   = "";
            txtWorkDate.Text = "";
            txtOpenDate.Text = "";

            //Check user is admin or not
            string ADM = DO.checkAdmin(Session["BRCD"].ToString(), Session["LOGINCODE"].ToString(), Session["MID"].ToString());

            if (ADM != null && ADM != "")
            {
                txtBrCode.Text = ddlBrName.SelectedValue.ToString();

                ViewState["EntryDate"] = LG.openDay(txtBrCode.Text.Trim().ToString());

                string NextDay = ViewState["EntryDate"].ToString();
                NextDay = conn.AddMonthDay(NextDay, "1", "D");
A:
                string Holdy = conn.sExecuteScalar("SELECT COUNT(*) FROM AVS1026 WHERE HOLIDAYDATE = '" + conn.ConvertDate(NextDay) + "' AND STATUS = 1 ");
                if (Holdy != "0")
                {
                    NextDay = conn.AddMonthDay(NextDay, "1", "D");
                    goto A;
                }
                else
                {
                    txtWorkDate.Text = ViewState["EntryDate"].ToString();
                    txtOpenDate.Text = NextDay.ToString();
                    return;
                }
            }
            else
            {
                ddlBrName.SelectedValue = Session["BRCD"].ToString();
                txtBrCode.Text          = Session["BRCD"].ToString();

                ViewState["EntryDate"] = LG.openDay(txtBrCode.Text.Trim().ToString());

                string NextDay = ViewState["EntryDate"].ToString();
                NextDay = conn.AddMonthDay(NextDay, "1", "D");
A:
                string Holdy = conn.sExecuteScalar("SELECT COUNT(*) FROM AVS1026 WHERE HOLIDAYDATE = '" + conn.ConvertDate(NextDay) + "' AND STATUS = 1 ");
                if (Holdy != "0")
                {
                    NextDay = conn.AddMonthDay(NextDay, "1", "D");
                    goto A;
                }
                else
                {
                    txtWorkDate.Text = ViewState["EntryDate"].ToString();
                    txtOpenDate.Text = NextDay.ToString();
                    return;
                }
            }
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
        }
    }