Exemplo n.º 1
0
 public async Task <JsonResult> GetByID(string id)
 {
     try {
         var data = ItemSubCategoryService.GetByID(Guid.Parse(id));
         return(Success(ItemSubCategoryVM.MToVM(data)));
     } catch { return(Failed(MessageUtility.ServerError())); }
 }
Exemplo n.º 2
0
 public static bool Insert(Guid id, string name, Guid catID)
 {
     try {
         using (var context = new GeopersonContext()) {
             var model = ItemSubCategoryVM.Set(id, name, catID, false);
             context.ItemSubCategoryDB.Add(model);
             context.SaveChanges();
             return(true);
         }
     } catch { return(false); }
 }