Exemplo n.º 1
0
        public ActionResult ConfirmChangePassword(string oldpass, string Pass, string cpass)
        {
            CashierRepository orepo = new CashierRepository();
            LoginRepository   lrepo = new LoginRepository();

            Cashier 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.Cashier_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"));
        }
Exemplo n.º 2
0
        public ActionResult _UpdateCashier(Cashier ins)
        {
            //...Update Object
            Cashier ins2 = CRep.Update(ins);

            //...Repopulate Grid...
            return(View(new GridModel(CRep.GetAllCashier())));
        }
Exemplo n.º 3
0
        public ActionResult ConfirmEditProfile(Cashier cs)
        {
            CashierRepository crepo = new CashierRepository();

            crepo.Update(cs);

            ViewData["Message"] = "Edit Successfull";
            Session["Cashier"]  = cs;
            return(View("Empty"));
        }
Exemplo n.º 4
0
        public ActionResult ConfirmCashier_Salary(int Cashier_Id)
        {
            CashierRepository brepo = new CashierRepository();
            Cashier           br    = brepo.Get(Cashier_Id);
            DateTime          d     = DateTime.Now;

            if (d >= Convert.ToDateTime(br.Cashier_LastPaymentDate).AddDays(30))
            {
                br.Cashier_LastPaymentDate = d.ToString();
                br.Cashier_TotalPayment   += br.Cashier_Salary;
                br.Cashier_Balance        += br.Cashier_Salary;

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

            return(View("Empty"));
        }