public static Response ValidateRelation(RelationAddEditModel relation, Response response = null) { response = response ?? new Response(); if (relation.TypeId == 0) { response.AddMessage(false, "Select a Relation Type", ResponseMessageType.Warning); } return(response); }
public static async Task<Utils.Messages.Response> EditRelationAsync(RelationAddEditModel relationModel) { var response = new Response(); var context = new AdminDbContext(); ValidateRelation(relationModel, response); if (!response.Success) { return response; } var relation = context.Relations.Find(relationModel.Id); relation.TypeId = relationModel.TypeId; await context.SaveChangesAsync(); return response; }
public static async Task <Utils.Messages.Response> EditRelationAsync(RelationAddEditModel relationModel) { var response = new Response(); var context = new AdminDbContext(); ValidateRelation(relationModel, response); if (!response.Success) { return(response); } var relation = context.Relations.Find(relationModel.Id); relation.TypeId = relationModel.TypeId; await context.SaveChangesAsync(); return(response); }
public async Task<JsonResult> EditRelation(RelationAddEditModel relation) { Quince.Utils.Messages.Response response = await RelationManager.EditRelationAsync(relation); return Json(response); }
public async Task <JsonResult> EditRelation(RelationAddEditModel relation) { Quince.Utils.Messages.Response response = await RelationManager.EditRelationAsync(relation); return(Json(response)); }
public static Response ValidateRelation(RelationAddEditModel relation, Response response = null) { response = response ?? new Response(); if (relation.TypeId == 0) { response.AddMessage(false, "Select a Relation Type", ResponseMessageType.Warning); } return response; }