public ActionResult ComboHMaster_Destroy([DataSourceRequest] DataSourceRequest request, ComboHMaster combohmaster) { if (ModelState.IsValid) { var entity = new ComboHMaster { CBMRowid = combohmaster.CBMRowid //CBMClass = combohmaster.CBMClass, //CBMDescription = combohmaster.CBMDescription, //CBMRemark = combohmaster.CBMRemark, //CBMGroup = combohmaster.CBMGroup, //CBMLastModifiedDateTime = combohmaster.CBMLastModifiedDateTime, //CBMModifiedUserRowid = combohmaster.CBMModifiedUserRowid }; db.ComboHMaster.Attach(entity); db.ComboHMaster.Remove(entity); db.SaveChanges(); } return(Json(new[] { combohmaster }.ToDataSourceResult(request, ModelState))); }
public ActionResult ComboHMaster_Create(ViewModel_ComboHMaster combohmaster, string param) { if (combohmaster != null && ModelState.IsValid) { var target = new ComboHMaster(); target.CBMRowid = Guid.NewGuid().ToString(); target.CBMHospRowid = param; target.CBMClass = combohmaster.CBMClass; target.CBMDescription = combohmaster.CBMDescription; target.CBMRemark = combohmaster.CBMRemark; target.CBMGroup = combohmaster.CBMGroup; target.CBMLastModifiedDateTime = combohmaster.CBMLastModifiedDateTime; target.CBMModifiedUserRowid = combohmaster.CBMModifiedUserRowid; db.ComboHMaster.Add(target); db.SaveChanges(); combohmaster.CBMRowid = target.CBMRowid; } return(Json(new[] { combohmaster }.ToDataSourceResult(new DataSourceRequest(), ModelState))); }
public ActionResult ComboHMaster_Update([DataSourceRequest] DataSourceRequest request, ComboHMaster combohmaster, string param) { if (ModelState.IsValid) { var entity = new ComboHMaster { CBMRowid = combohmaster.CBMRowid, CBMHospRowid = param, CBMClass = combohmaster.CBMClass, CBMDescription = combohmaster.CBMDescription, CBMRemark = combohmaster.CBMRemark, CBMGroup = combohmaster.CBMGroup, CBMLastModifiedDateTime = combohmaster.CBMLastModifiedDateTime, CBMModifiedUserRowid = combohmaster.CBMModifiedUserRowid }; db.ComboHMaster.Attach(entity); db.Entry(entity).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } return(Json(new[] { combohmaster }.ToDataSourceResult(request, ModelState))); }