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)); }
public bool Update(WAMS_STOCK_TYPE store) { _repository.Update(store); _unitOfWork.CommitChanges(); return(true); }
public bool Insert(WAMS_STOCK_TYPE store) { _repository.Add(store); _unitOfWork.CommitChanges(); return(true); }
public bool Update(WAMS_STOCK_TYPE store) { _repository.Update(store); _unitOfWork.CommitChanges(); return true; }
public bool Insert(WAMS_STOCK_TYPE store) { _repository.Add(store); _unitOfWork.CommitChanges(); return true; }