public JsonResult UpdateClassificationTechniques([FromBody] List <ClassificationFilesTechniquesViewModel> data) { data.ForEach(x => { x.UpdateUser = User.Identity.Name; DBClassificationFilesTechniques.Update(DBClassificationFilesTechniques.ParseToDatabase(x)); }); return(Json(data)); }
public JsonResult CreateClassificationTechniques([FromBody] ClassificationFilesTechniquesViewModel data) { data.CreateUser = User.Identity.Name; if (DBClassificationFilesTechniques.Create(DBClassificationFilesTechniques.ParseToDatabase(data)) != null) { return(Json(data)); } else { return(null); } }
public JsonResult DeleteClassificationTechniques([FromBody] ClassificationFilesTechniquesViewModel data) { //Delete lines of Groups if (data.Type == 1) { if (DBClassificationFilesTechniques.GetTypeFiles(0).Exists(x => x.Grupo == data.Code)) { return(Json(null)); } } // Delete Group var result = DBClassificationFilesTechniques.Delete(DBClassificationFilesTechniques.ParseToDatabase(data)); return(Json(result)); }
//O : Lines of Groups //1 : Group public JsonResult GetClassificationFilesTechniques([FromBody] string option) { List <ClassificationFilesTechniquesViewModel> result; if (option == "Grupos") { result = DBClassificationFilesTechniques.ParseToViewModel(DBClassificationFilesTechniques.GetTypeFiles(1)); } else { result = DBClassificationFilesTechniques.ParseToViewModel(DBClassificationFilesTechniques.GetTypeFiles(0)); } return(Json(result)); }