Exemple #1
0
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        IBusinessAbstraction iba = GenericFactory <BusinessAbstraction, IBusinessAbstraction> .CreateInstance();

        try
        {
            string chkAcctNum = iba.IsValidUser(Utils.StripPunctuation(txtUsername.Text),
                                                Utils.StripPunctuation(txtPassword.Text));

            if (chkAcctNum != "")
            {
                lblStatus.Text                = "Welcome User";
                SessionFacade.USERNAME        = txtUsername.Text;
                SessionFacade.CHECKINGACCTNUM = chkAcctNum;
                if (SessionFacade.PAGEREQUESTED != null)
                {
                    Response.Redirect(SessionFacade.PAGEREQUESTED);
                }
            }

            else
            {
                lblStatus.Text = "Invalid User..";
            }
        }
        catch (Exception ex)
        {
            lblStatus.Text = ex.Message;
        }
    }
Exemple #2
0
    void ShowTransferHistory(string chkAcctNum)
    {
        try
        {
            IBusinessAbstraction iba = GenericFactory <BusinessAbstraction, IBusinessAbstraction> .CreateInstance();

            List <TransferHistory> TList = iba.GetTransferHistory(chkAcctNum);
            gv1.DataSource = TList;
            gv1.DataBind();
        }
        catch (Exception ex)
        {
            lblStatus.Text = ex.Message;
        }
    }
Exemple #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (SessionFacade.USERNAME == null)
        {
            SessionFacade.PAGEREQUESTED = Request.ServerVariables["SCRIPT_NAME"];
            Response.Redirect("Login.aspx");
        }

        IBusinessAbstraction iba = GenericFactory <BusinessAbstraction, IBusinessAbstraction> .CreateInstance();

        string chkAcctNum = SessionFacade.CHECKINGACCTNUM;
        string savAcctNum = chkAcctNum + "1";

        lblCheckingBalance.Text = iba.GetCheckingBalance(chkAcctNum).ToString();
        lblSavingBalance.Text   = iba.GetSavingBalance(savAcctNum).ToString();
    }
Exemple #4
0
    protected void btnTransfer_Click(object sender, EventArgs e)
    {
        IBusinessAbstraction iba = GenericFactory <BusinessAbstraction, IBusinessAbstraction> .CreateInstance();

        try
        {
            string chkAcctNum = SessionFacade.CHECKINGACCTNUM;
            string savAcctNum = chkAcctNum + "1";
            if (iba.TransferFromChkgToSav(chkAcctNum, savAcctNum,
                                          double.Parse(txtAmount.Text)))
            {
                lblStatus.Text          = "Transfer successful..";
                lblCheckingBalance.Text = iba.GetCheckingBalance(chkAcctNum).ToString();
                lblSavingBalance.Text   = iba.GetSavingBalance(savAcctNum).ToString();
            }
        }
        catch (Exception ex)
        {
            lblStatus.Text = ex.Message;
        }
    }
    protected void btnChangePwd_Click(object sender, EventArgs e)
    {
        IBusinessAbstraction iba = GenericFactory <BusinessAbstraction, IBusinessAbstraction> .CreateInstance();

        try
        {
            string oldPwd = Utils.StripPunctuation(txtOldPwd.Text);
            string newPwd = Utils.StripPunctuation(txtNewPwd.Text);
            string rePwd  = Utils.StripPunctuation(txtRetypePwd.Text);
            if (rePwd.Equals(newPwd))
            {
                string userName   = Utils.StripPunctuation(SessionFacade.USERNAME);
                string chkAcctNum = iba.IsValidUser(userName, oldPwd);
                if (chkAcctNum != "")
                {
                    if (iba.ChangePassword(userName, oldPwd, newPwd))
                    {
                        lblStatus.Text = "Password updated successfully!";
                    }
                    else
                    {
                        lblStatus.Text = "Couldn't change password!!!";
                    }
                }
                else
                {
                    lblStatus.Text = "Invalid old password ...";
                }
            }
            else
            {
                lblStatus.Text = "Password mismatch ...";
            }
        }
        catch (Exception ex)
        {
            lblStatus.Text = ex.Message;
        }
    }