public ActionResult DicUpdate([DataSourceRequest] DataSourceRequest request, OBKReferenceLaboratoryRegulationModel dictionary, string type) { if (dictionary != null && ModelState.IsValid) { var d = db.OBK_Ref_LaboratoryRegulation.First(o => o.Id == dictionary.Id); d.NameRu = dictionary.NameRu; d.NameKz = dictionary.NameKz; db.SaveChanges(); } return(Json(new[] { dictionary }.ToDataSourceResult(request, ModelState))); }
public ActionResult DicCreate([DataSourceRequest] DataSourceRequest request, OBKReferenceLaboratoryRegulationModel dictionary, string type) { if (dictionary != null) { OBK_Ref_LaboratoryRegulation d = new OBK_Ref_LaboratoryRegulation() { Id = Guid.NewGuid(), NameRu = dictionary.NameRu, NameKz = dictionary.NameKz, IsDeleted = false }; db.OBK_Ref_LaboratoryRegulation.Add(d); db.SaveChanges(); dictionary.Id = d.Id; } return(Json(new[] { dictionary }.ToDataSourceResult(request, ModelState))); }
public ActionResult DicDestroy([DataSourceRequest] DataSourceRequest request, OBKReferenceLaboratoryRegulationModel dictionary, string type) { if (dictionary != null) { var d = db.OBK_Ref_LaboratoryRegulation.First(o => o.Id == dictionary.Id); d.IsDeleted = true; db.SaveChanges(); } return(Json(new[] { dictionary }.ToDataSourceResult(request, ModelState))); }