コード例 #1
0
 public ActionResult Item(string errMsg)
 {
     if (Session["UserID"] != null)
     {
         ViewBag.ItemCode = GenerateItemCode();
         var item = _ItemInfoService.All().ToList().LastOrDefault();
         ViewBag.ItemType     = new SelectList(_ItemTypeService.All().ToList(), "ItemTypeCode", "ItemTypeName");
         ViewBag.UnitCode     = new SelectList(_UnitService.All().ToList(), "UnitCode", "UnitName");
         ViewBag.DetUnitCode  = new SelectList(_UnitService.All().ToList(), "UnitCode", "UnitName");
         ViewBag.PackItemCode = new SelectList(_ItemInfoService.All().ToList(), "ItemCode", "ItemName");
         ViewBag.AltItemCode  = new SelectList(_ItemInfoService.All().ToList(), "ItemCode", "ItemName");
         ViewBag.Items        = GetItemAll();
         ViewBag.Group        = LoadDropDown.LoadGroupInf(_CommonVmService);
         ViewBag.SubGroup     = LoadDropDown.LoadSGroupInfo(_CommonVmService);
         ViewBag.SubSubGroup  = LoadDropDown.LoadAllSSGroupInfo(_CommonVmService);
         var sysSet = _sysSetService.All().ToList().FirstOrDefault();
         ViewBag.MaintVAT    = sysSet.MaintVAT;
         Session["MaintVAT"] = sysSet.MaintVAT;
         #region For item Filtering option
         ViewBag.NoGrp        = sysSet.NoGrp;
         ViewBag.OnlyGrp      = sysSet.OnlyGrp;
         ViewBag.GrpAndSubGrp = sysSet.GrpAndSubGrp;
         ViewBag.SubSubGrp    = sysSet.SubSubGrp;
         #endregion
         ViewBag.errMsg = errMsg;
         return(View());
     }
     else
     {
         return(RedirectToAction("SecUserLogin", "SecUserLogin"));
     }
 }