Пример #1
0
 public ActionResult Update([DataSourceRequest] DataSourceRequest request, MW_UsuariosResponsabilidades record)
 {
     // Test if Register object and modelstate is valid.
     if (record != null && ModelState.IsValid)
     {
         // Update Register to UoW.
         _database.UsuariosResponsabilidades.Update(record);
         // Save updated Register to database using UoW.
         _database.Save();
     }
     // Return modelstate info back to client side in json format.
     return(Json(ModelState.ToDataSourceResult()));
 }
Пример #2
0
 public ActionResult Delete([DataSourceRequest] DataSourceRequest request, MW_UsuariosResponsabilidades record)
 {
     // Test if Register object and modelstate is valid.
     if (record != null && ModelState.IsValid)
     {
         // Delete Register from UoW.
         _database.UsuariosResponsabilidades.Delete(record);
         // Call to database and delete the deleted record.
         _database.Save();
     }
     // Return modelstate info back to client side in json format.
     return(Json(ModelState.ToDataSourceResult()));
 }
Пример #3
0
 public ActionResult Add([DataSourceRequest] DataSourceRequest request, MW_UsuariosResponsabilidades record)
 {
     // Test if Register object and modelstate is valid.
     if (record != null && ModelState.IsValid)
     {
         // Add Register to UoW.
         _database.UsuariosResponsabilidades.Add(record);
         // Save Register to database using UoW.
         _database.Save();
     }
     // Return added Register record back to client side in json format and embeded request, modelstate information.
     return(Json(new[] { record }.ToDataSourceResult(request, ModelState)));
 }