Ejemplo n.º 1
0
 public int Insert(AirPortModel.Models.Category obj)
 {
     try
     {
         obj.DateCreate = DateTime.Now;
         obj.LastUpdate = DateTime.Now;
         obj.IsDelete   = false;
         _db.categories.Add(obj);
         _db.SaveChanges();
         return(obj.Id);
     }
     catch (Exception)
     {
         return(0);
     }
 }
Ejemplo n.º 2
0
 public ProgressStatus Update(AirPortModel.Models.Category obj)
 {
     try
     {
         obj.LastUpdate = DateTime.Now.Date;
         _db.categories.Update(obj);
         _db.SaveChanges();
         var result = new ProgressStatus {
             Number = 1, Title = "Delete Successful", Message = "Category Has been Update"
         };
         return(result);
     }
     catch (Exception ex)
     {
         var result = new ProgressStatus {
             Number = 0, Title = "Delete Error", Message = "Category  can't be Update"
         };
         return(result);
     }
 }