Exemplo n.º 1
0
        //View Approve
        public ActionResult Approve(int id)
        {
            PromotionViewModel model = PromotionRepo.GetById(id);

            ViewBag.Employee = new SelectList(PromotionRepo.GetStaff(), "Id", "Full_Name");
            UserViewModel currentuser = PromotionRepo.GetIdByName(User.Identity.Name);

            if (model.FlagDesign == "Yes")
            {
                return(PartialView("_Approve", model));
            }
            else
            {
                return(PartialView("_ApproveNo", model));
            }

            if (currentuser.Role == "Admin")
            {
                ViewBag.Employee = new SelectList(EmployeeRepo.Get(), "Id", "FullName");
                return(PartialView("_Approve", PromotionRepo.GetById(id)));
            }
            else
            {
                return(new RedirectToRouteResult(new RouteValueDictionary(new { controller = "AccessDenied", action = "Index" })));
            }
        }
Exemplo n.º 2
0
        //GET: View Edit
        public ActionResult Edit(int id)
        {
            PromotionViewModel model = PromotionRepo.GetById(id);

            if (model.Flag_Design == "1")
            {
                return(PartialView("_Edit", model));
            }
            else
            {
                return(PartialView("_EditNo", model));
            }
        }
Exemplo n.º 3
0
 public ActionResult ApproveNo(int id)
 {
     return(PartialView("_ApproveNo", PromotionRepo.GetById(id)));
 }