public JsonResult Delete(int id) { try { if (id == 0) { return(Json(new { responseCode = "-10" })); } DrivingCategories model = this._drivingCategoriesBusiness.Get(id); model.Enable = false; this._drivingCategoriesBusiness.Save(model); var responseObject = new { responseCode = 0 }; return(Json(responseObject)); } catch (Exception) { return(Json(new { responseCode = "-10" })); } }
private void Update(DrivingCategories view) { DrivingCategories model = Get(view.Id); model.Code = view.Code; this.repository.Update(view); }
public void Save(DrivingCategories model) { if (model.Id > 0) { Update(model); } else { Create(model); } }
public JsonResult Get(int id) { DrivingCategories model = new DrivingCategories(); try { model = this._drivingCategoriesBusiness.Get(id); return(Json(model, JsonRequestBehavior.AllowGet)); } catch (Exception) { return(Json(new { responseCode = "-10" })); } }
public JsonResult Edit(DrivingCategories model) { try { if (model == null) { return(Json(new { responseCode = "-10" })); } this._drivingCategoriesBusiness.Save(model); var responseObject = new { responseCode = 0 }; return(Json(responseObject)); } catch (Exception) { return(Json(new { responseCode = "-10" })); } }
private void Create(DrivingCategories view) { view.Enable = true; this.repository.Insert(view); }