예제 #1
0
 public int Insert(AirPortModel.Models.Faq obj)
 {
     try
     {
         obj.DateCreate = DateTime.Now;
         obj.LastUpdate = DateTime.Now;
         obj.IsDelete   = false;
         _db.faqs.Add(obj);
         _db.SaveChanges();
         return(obj.Id);
     }
     catch (Exception)
     {
         return(0);
     }
 }
예제 #2
0
 public ProgressStatus Update(AirPortModel.Models.Faq obj)
 {
     try
     {
         obj.LastUpdate = DateTime.Now.Date;
         _db.faqs.Update(obj);
         _db.SaveChanges();
         var Result = new ProgressStatus {
             Number = 1, Title = "Update Successful", Message = "Faq Has been Update"
         };
         return(Result);
     }
     catch (Exception ex)
     {
         string mes    = ex.Message;
         var    Result = new ProgressStatus {
             Number = 0, Title = "Update Error", Message = "Faq can't be Update"
         };
         return(Result);
     }
 }