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