public ActionResult Action(tblProductStatus objSubmit) { if (objSubmit.ID == 0) { objSubmit.DateCreated = DateTime.Now; objSubmit.DateUpdated = DateTime.Now; objSubmit.IsDeleted = false; objSubmit.IsShow = true; productStatusRepository.Add(objSubmit); } else { var obj = productStatusRepository.GetById <tblProductStatus>(objSubmit.ID); UpdateModel(obj); objSubmit.DateUpdated = DateTime.Now; productStatusRepository.Update(obj); } return(Json(new { Error = false }, JsonRequestBehavior.AllowGet)); }
public ProductStatus GetById(int?id) { return(_repository.GetById(id)); }