Пример #1
0
        protected void SubmitBtn_Click(object sender, EventArgs e)
        {
            string uname = (string)Session["Logged"];
            string pass  = (string)Session["lPwd"];
            int    aid   = (int)Session["accId"];

            AccountsBLL user = new AccountsBLL();
            AccountsDAL a    = user.retrieveUser(uname, pass);

            BuyerBLL buyer = new BuyerBLL();
            BuyerDAL b     = buyer.retrieveFinPlan(aid);

            string  mainName          = b.MainApplicantName;
            decimal mainSalary        = b.MainApplicantSalary;
            string  coName            = b.CoApplicantName;
            decimal coSalary          = b.CoApplicantSalary;
            decimal totSavings        = b.totalSavings;
            decimal upfrontPayment    = b.upfrontPaymentBudget;
            int     loanServicePeriod = b.loanServicingPeriod;
            string  useCpf            = b.userCpfToService;

            decimal ab1 = decimal.Parse(theTotalSavings.Text);
            decimal ac1 = decimal.Parse(theUpfrontPaymentBudget.Text.Trim());


            decimal asd  = ab1 + ac1;
            decimal asdf = asd - (asd * 0.8m) + (asd * 0.0275m);

            Label1.Text = "Recommended Bufget: S$ " + asdf;
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string username = (string)Session["Logged"];
            string pass     = (string)Session["lPwd"];
            int    aid      = (int)Session["accId"];

            AccountsBLL user = new AccountsBLL();
            AccountsDAL p    = user.retrieveUser(username, pass);


            string name = p.fullName;

            theName.Text = name;


            //Page lastPage = (Page)Context.Handler;
            //string asd = ((TextBox)lastPage.FindControl("loginTextbox")).Text;

            //SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["MYDBConnection"].ConnectionString);
            //conn.Open();
            //SqlDataAdapter sda = new SqlDataAdapter("SELECT * FROM Accounts WHERE userName ='******'", conn);
            //DataTable dt = new DataTable();
            //sda.Fill(dt);

            //name = dt.Rows[0][3].ToString();

            //theName.Text = name;
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string uname = (string)Session["Logged"];
            string pass  = (string)Session["lPwd"];
            int    aid   = (int)Session["accId"];

            AccountsBLL user = new AccountsBLL();
            AccountsDAL a    = user.retrieveUser(uname, pass);


            string fullname = a.fullName;
            string mobile   = a.mobile;
            string email    = a.email;
            string address  = a.address;


            BuyerBLL buyer = new BuyerBLL();
            BuyerDAL b     = buyer.retrieveFinPlan(aid);

            string  mainName          = b.MainApplicantName;
            decimal mainSalary        = b.MainApplicantSalary;
            string  coName            = b.CoApplicantName;
            decimal coSalary          = b.CoApplicantSalary;
            decimal totSavings        = b.totalSavings;
            decimal upfrontPayment    = b.upfrontPaymentBudget;
            int     loanServicePeriod = b.loanServicingPeriod;
            string  useCpf            = b.userCpfToService;


            UserName.Text = fullname;
            Mobile.Text   = mobile;
            Email.Text    = email;
            Address.Text  = address;

            theMainApplicantName.Text    = mainName;
            theMainApplicantSalary.Text  = mainSalary.ToString();
            theCoApplicantName.Text      = coName;
            theCoApplicantSalary.Text    = coSalary.ToString();
            theTotalSavings.Text         = totSavings.ToString();
            theUpfrontPaymentBudget.Text = upfrontPayment.ToString();
            theLoanServicePeriod.Text    = loanServicePeriod.ToString();



            //Page lastPage = (Page)Context.Handler;
            //string asd = ((TextBox)lastPage.FindControl("loginTextbox")).Text;

            //SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["MYDBConnection"].ConnectionString);
            //conn.Open();
            //SqlDataAdapter sda = new SqlDataAdapter("SELECT * FROM Accounts WHERE userName ='******'", conn);
            //DataTable dt = new DataTable();
            //sda.Fill(dt);

            //name1 = dt.Rows[0][3].ToString();
            //theName.Text = name1;
        }
Пример #4
0
        protected void SignInBtn_Click(object sender, EventArgs e)
        {
            string username = loginTextbox.Text.Trim();
            string password = passwordTextBox.Text.Trim();


            AccountsBLL user = new AccountsBLL();
            AccountsDAL p    = user.retrieveUser(username, password);

            string accType = p.accType;
            int    accId   = p.AccountID;


            if (user.retrieveUserByLogin(username, password) == true)
            {
                Session["Logged"] = username;
                Session["lPwd"]   = password;
                Session["accId"]  = accId;

                if (accType.Equals("Buyer"))
                {
                    Response.Redirect("index.aspx");
                }
                else if (accType.Equals("Reseller"))
                {
                    Response.Redirect("reseller.aspx");
                }
                else if (accType.Equals("Banker"))
                {
                    Response.Redirect("bankerIndex.aspx");
                }
            }
            else
            {
                Response.Write("<script>alert('Please enter valid Username and Password')</script>");
            }



            //SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["MYDBConnection"].ConnectionString);
            //conn.Open();
            //SqlDataAdapter sda = new SqlDataAdapter("SELECT * FROM Accounts WHERE userName ='******' AND password = '******'" , conn);
            //SqlDataAdapter sdaa = new SqlDataAdapter("SELECT * FROM Accounts WHERE accType ='Buyer'", conn);
            //DataTable dt = new System.Data.DataTable();
            //sda.Fill(dt);
            //if(dt.Rows.Count == 1 )
            //{
            //    utype = dt.Rows[0][7].ToString();
            //    if (utype == "Buyer")
            //    {
            //        Server.Transfer("index.aspx");
            //    }
            //    else if (utype == "Reseller")
            //    {
            //        Server.Transfer("reseller.aspx");
            //    }
            //    else if (utype == "Banker")
            //    {
            //        Server.Transfer("bankerIndex.aspx");
            //    }

            //}
            //else
            //{
            //    Response.Write("<script>alert('Please enter valid Username and Password')</script>");
            //}
            //conn.Close();
        }