예제 #1
0
        public ActionResult RoutingMasterNew(RoutingMaster routingMaster)
        {
            if (ModelState.IsValid)
            {
                if (this.genericMgr.FindAll<long>(duiplicateVerifyStatement, new object[] { routingMaster.Code })[0] > 0)
                {
                    base.SaveErrorMessage(Resources.SYS.ErrorMessage.Errors_Existing_Code, routingMaster.Code);
                }
                else
                {
                    this.genericMgr.CreateWithTrim(routingMaster);
                    SaveSuccessMessage(Resources.PRD.Routing.RoutingMaster_Added);
                    return RedirectToAction("RoutingList/" + routingMaster.Code);
                }
            }

            return View(routingMaster);
        }
예제 #2
0
        public ActionResult RoutingMasterEdit(RoutingMaster routingMaster)
        {
            if (ModelState.IsValid)
            {
                this.genericMgr.UpdateWithTrim(routingMaster);
                SaveSuccessMessage(Resources.PRD.Routing.RoutingMaster_Updated);
            }

            //return new RedirectToRouteResult(new RouteValueDictionary  
            //                                       { 
            //                                           { "action", "RoutingList" }, 
            //                                           { "controller", "Routing" },
            //                                           { "id", routingMaster.Code }
            //                                       });
            return PartialView(routingMaster);
        }
예제 #3
0
        public ActionResult _RoutingDropDownList(string controlName, string controlId, string selectedValue, bool? includeBlankOption)
        {
            ViewBag.ControlName = controlName;
            ViewBag.ControlId = controlId;
            IList<RoutingMaster> routingList = base.genericMgr.FindAll<RoutingMaster>(" from RoutingMaster as r where r.IsActive = ? ", true);
            if (routingList == null)
            {
                routingList = new List<RoutingMaster>();
            }

            if (includeBlankOption.HasValue && includeBlankOption.Value)
            {
                RoutingMaster blankRoutingMaster = new RoutingMaster();
                routingList.Insert(0, blankRoutingMaster);
            }
            return PartialView(new SelectList(routingList, "Code", "Name", selectedValue));
        }