public ActionResult ConfirmChangePassword(string oldpass, string Pass, string cpass)
        {
            LORepository    orepo = new LORepository();
            LoginRepository lrepo = new LoginRepository();

            LoanOfficer of = orepo.Get(Convert.ToInt32(Session["Id"]));

            Logininfo log = lrepo.Get(Session["Name"].ToString());

            if (Session["Password"].ToString() == oldpass)
            {
                if (Pass != cpass)
                {
                    ViewData["Message"] = "Password Didn't match";
                }
                else
                {
                    of.LOfficer_Password = Pass;
                    log.Login_Password   = Pass;

                    orepo.Update(of);
                    lrepo.Update(log);

                    ViewData["Message"] = "Password Updated Successfully";
                    Session["Officer"]  = of;
                    Session["Password"] = Pass;
                }
            }
            else
            {
                ViewData["Message"] = "Wrong Password";
            }

            return(View("Empty"));
        }
        public ActionResult ConfirmEditProfile(LoanOfficer l)
        {
            LORepository urepo = new LORepository();

            urepo.Update(l);

            ViewData["Message"]    = "Edit Successfull";
            Session["LoanOfficer"] = l;
            return(View("Empty"));
        }
示例#3
0
        public ActionResult ConfirmLoanOfficer_Salary(int LOfficer_Id)
        {
            LORepository brepo = new LORepository();
            LoanOfficer  br    = brepo.Get(LOfficer_Id);
            DateTime     d     = DateTime.Now;

            if (d >= Convert.ToDateTime(br.LOfficer_LastPaymentDate).AddDays(30))
            {
                br.LOfficer_LastPaymentDate = d.ToString();
                br.LOfficer_TotalPayment   += br.LOfficer_Salary;
                br.LOfficer_Balance        += br.LOfficer_Salary;

                brepo.Update(br);
                ViewData["Message"] = "Salary Payment Successfull";
            }
            else
            {
                ViewData["Message"] = "To Early to Pay Salary";
            }

            return(View("Empty"));
        }