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.StockTypeR == 0)
            {
                return RedirectToAction("Index", "Home");
            }

            var item = new WAMS_STOCK_TYPE();

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

            var model = new StockTypeViewModel
            {
                Id = item.Id,
                TypeCode = item.TypeCode,
                TypeName = item.TypeName,
                Timestamp = item.Timestamp,
                iCreated = item.iCreated,
                dCreated = item.dCreated,
                UserLogin = user
            };

            // FUNCTION
            return View(model);
        }
        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.StockTypeR == 0)
            {
                return(RedirectToAction("Index", "Home"));
            }

            var item = new WAMS_STOCK_TYPE();

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

            var model = new StockTypeViewModel
            {
                Id        = item.Id,
                TypeCode  = item.TypeCode,
                TypeName  = item.TypeName,
                Timestamp = item.Timestamp,
                iCreated  = item.iCreated,
                dCreated  = item.dCreated,
                UserLogin = user
            };

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