Ejemplo n.º 1
0
        public ActionResult Create(int? id)
        {
            var userName = System.Web.HttpContext.Current.User.Identity.Name;
            var user = _systemService.GetUserAndRole(0, userName);
            if (user == null)
            {
                return RedirectToAction("Index", "Login");
            }

            if (user.CategoryR == 0)
            {
                return RedirectToAction("Index", "Home");
            }

            var item = new WAMS_CATEGORY();

            if (id.HasValue)
            {
                item = _service.GetByKey(id.Value);
            }

            var model = new CategoryViewModel
            {
                bCategoryID = item.bCategoryID,
                CategoryCode = item.CategoryCode,
                vCategoryName = item.CategoryCode,
                iType = item.iType,
                Timestamp = item.Timestamp,
                iCreated = item.iCreated,
                dCreated = item.dCreated,
                UserLogin = user,
                Types = new SelectList(_systemService.TypeStockList(), "Id", "Name")
            };
            return View(model);
        }
Ejemplo n.º 2
0
        public ActionResult Create(int?id)
        {
            var userName = System.Web.HttpContext.Current.User.Identity.Name;
            var user     = _systemService.GetUserAndRole(0, userName);

            if (user == null)
            {
                return(RedirectToAction("Index", "Login"));
            }

            if (user.CategoryR == 0)
            {
                return(RedirectToAction("Index", "Home"));
            }

            var item = new WAMS_CATEGORY();

            if (id.HasValue)
            {
                item = _service.GetByKey(id.Value);
            }

            var model = new CategoryViewModel
            {
                bCategoryID   = item.bCategoryID,
                CategoryCode  = item.CategoryCode,
                vCategoryName = item.CategoryCode,
                iType         = item.iType,
                Timestamp     = item.Timestamp,
                iCreated      = item.iCreated,
                dCreated      = item.dCreated,
                UserLogin     = user,
                Types         = new SelectList(_systemService.TypeStockList(), "Id", "Name")
            };

            return(View(model));
        }
Ejemplo n.º 3
0
 public bool Update(WAMS_CATEGORY store)
 {
     _repository.Update(store);
     _unitOfWork.CommitChanges();
     return(true);
 }
Ejemplo n.º 4
0
 public bool Insert(WAMS_CATEGORY store)
 {
     _repository.Add(store);
     _unitOfWork.CommitChanges();
     return(true);
 }
Ejemplo n.º 5
0
 public bool Update(WAMS_CATEGORY store)
 {
     _repository.Update(store);
     _unitOfWork.CommitChanges();
     return true;
 }
Ejemplo n.º 6
0
 public bool Insert(WAMS_CATEGORY store)
 {
     _repository.Add(store);
     _unitOfWork.CommitChanges();
     return true;
 }