コード例 #1
0
        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));
        }
コード例 #2
0
        //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)));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        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));
        }
コード例 #5
0
        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" })));
            }
        }
コード例 #6
0
        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));
        }
コード例 #7
0
        //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" })));
            }
        }
コード例 #8
0
        //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" })));
            }
        }
コード例 #9
0
 public ActionResult Filter(DesignRequestViewModel model)
 {
     return(PartialView("_List", DesignRequestRepo.Filter(model)));
 }
コード例 #10
0
 // GET: DesignRequest
 public ActionResult Index()
 {
     ViewBag.Assign = new SelectList(DesignRequestRepo.Get(), "Assign_To", "Assign_To");
     return(View());
 }