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