public ActionResult Create() { ViewBag.EventCode = new SelectList(EventRepo.Get(), "id", "Code"); ViewBag.DesignCode = new SelectList(DesignRequestRepo.Get(), "id", "Code"); PromotionViewModel model = new PromotionViewModel(); return(PartialView("_Create", model)); }
//Add Item CLOSE public ActionResult CloseList(int id) { ViewBag.Product = new SelectList(ProductRepo.Get(), "Id", "Name"); ViewBag.Description = new SelectList(ProductRepo.Get(), "Id", "Description"); List <DesignItemViewModel> model = DesignRequestRepo.GetCloseItem(id); return(PartialView("_CloseList", DesignApproveRepo.Get(id))); }
public ActionResult AddItem() { ViewBag.Product = new SelectList(ProductRepo.Get(), "Id", "Name"); ViewBag.Description = new SelectList(ProductRepo.Get(), "Id", "Description"); ViewBag.Employee = new SelectList(DesignRequestRepo.GetPic(), "Id", "Full_Name"); DesignItemViewModel model = new DesignItemViewModel(); return(PartialView("_AddItem", model)); }
public ActionResult Create(DesignRequestViewModel model, List <DesignItemViewModel> item) { model.Create_By = User.Identity.Name; ResultResponse result = DesignRequestRepo.Update(model, item); return(Json(new { success = result.Success, entity = model, message = result.Message }, JsonRequestBehavior.AllowGet)); }
public ActionResult List() { UserViewModel access = DesignApproveRepo.GetIdByName(User.Identity.Name); if (access.Role == "Requester" || access.Role == "Admin" || access.Role == "Staff") { return(PartialView("_List", DesignRequestRepo.Get())); } else { return(new RedirectToRouteResult(new RouteValueDictionary(new { controller = "AccessDenied", action = "Index" }))); } }
public ActionResult Create2(int designid, int eventid) { ViewBag.EventCode = new SelectList(EventRepo.Get(), "id", "Code"); ViewBag.DesignCode = new SelectList(DesignRequestRepo.Get(), "id", "Code"); UserViewModel model2 = PromotionRepo.GetIdByName(User.Identity.Name); PromotionViewModel model = new PromotionViewModel(); model.RequestBy = model2.Fullname; model.T_Design_Id = designid; model.T_Event_Id = eventid; return(PartialView("_Create2", model)); }
//EDIT public ActionResult Edit(int id) { DesignRequestViewModel model = DesignRequestRepo.GetById(id); ViewBag.DesignRequest = new SelectList(EventRepo.Get(), "Id", "Code"); UserViewModel access = DesignApproveRepo.GetIdByName(User.Identity.Name); if (access.Role == "Requester" || access.Role == "Admin") { return(PartialView("_Edit", model)); } else { return(new RedirectToRouteResult(new RouteValueDictionary(new { controller = "AccessDenied", action = "Index" }))); } }
//GET : New Product public ActionResult Create() { UserViewModel result = DesignRequestRepo.GetIdByName(User.Identity.Name); DesignRequestViewModel model = new DesignRequestViewModel(); model.Request_By = result.M_Employee_Id; model.NameRequest = result.Fullname; model.Code = DesignRequestRepo.GetNewCode(); ViewBag.DesignRequest = new SelectList(EventRepo.Get(), "Id", "Code"); UserViewModel access = DesignApproveRepo.GetIdByName(User.Identity.Name); if (access.Role == "Requester" || access.Role == "Admin") { return(PartialView("_Create", model)); } else { return(new RedirectToRouteResult(new RouteValueDictionary(new { controller = "AccessDenied", action = "Index" }))); } }
public ActionResult Filter(DesignRequestViewModel model) { return(PartialView("_List", DesignRequestRepo.Filter(model))); }
// GET: DesignRequest public ActionResult Index() { ViewBag.Assign = new SelectList(DesignRequestRepo.Get(), "Assign_To", "Assign_To"); return(View()); }