コード例 #1
0
        public ActionResult ConfirmManagerSalary(int Manager_Id)
        {
            BranchManagerRepository brepo = new BranchManagerRepository();
            BranchManager           br    = brepo.Get(Manager_Id);
            DateTime d = DateTime.Today;

            if (d >= Convert.ToDateTime(br.Manager_LastPaymentDate).AddDays(30))
            {
                br.Manager_LastPaymentDate = d.ToString();
                br.Manager_TotalPayment   += br.Manager_Salary;
                br.Manager_Balance        += br.Manager_Salary;

                brepo.Update(br);
                ViewData["Message"] = "Salary Payment Successfull";

                TransactionRepository trepo = new TransactionRepository();
                Transaction           tr    = new Transaction();
                tr.Tr_Amount  = br.Manager_Salary;
                tr.Tr_Date    = DateTime.Now.ToString("yyyy-MM-dd");
                tr.Tr_EmpType = "MD";
                tr.Tr_AccName = br.Manager_Name;
                tr.Tr_Through = Session["Name"].ToString();
                tr.Tr_Type    = "Salary";

                trepo.Insert(tr);
            }
            else
            {
                ViewData["Message"] = "To Early to Pay Salary";
            }

            return(View("Empty"));
        }
コード例 #2
0
        public ActionResult ConfirmChangePassword(string oldpass, string Pass, string cpass)
        {
            BranchManagerRepository orepo = new BranchManagerRepository();
            LoginRepository         lrepo = new LoginRepository();

            BranchManager 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.Manager_password = Pass;
                    log.Login_Password  = Pass;

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

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

            return(View("Empty"));
        }
コード例 #3
0
        public ActionResult ConfirmEditProfile(BranchManager u)
        {
            BranchManagerRepository urepo = new BranchManagerRepository();

            urepo.Update(u);

            ViewData["Message"] = "Edit Successfull";
            Session["Manager"]  = u;
            return(View("Empty"));
        }
コード例 #4
0
 public IHttpActionResult Edit([FromBody] BranchManager branch_Manager, [FromUri] int id)
 {
     branch_Manager.BranchManagerId = id;
     BranchManagerRepository.Update(branch_Manager);
     return(Ok(branch_Manager));
 }