public bool updateById(int id, EventsModel updateEvent)
 {
     try
     {
         var currentEvent = this.getEventById(id);
         if (currentEvent != null)
         {
             currentEvent.admin_id   = updateEvent.admin_id;
             currentEvent.image      = updateEvent.image;
             currentEvent.title      = updateEvent.title;
             currentEvent.content    = updateEvent.content;
             currentEvent.start_time = DateTime.Now;
             //currentEvent.top_hot = upd;
             currentEvent.status          = true;
             db.Entry(currentEvent).State = System.Data.Entity.EntityState.Modified;
             db.SaveChanges();
             return(true);
         }
         return(false);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
 public bool create(EventsModel newEvent)
 {
     try
     {
         @event @event = new @event();
         @event.admin_id   = newEvent.admin_id;
         @event.image      = newEvent.image;
         @event.title      = newEvent.title;
         @event.content    = newEvent.content;
         @event.start_time = DateTime.Now;
         @event.top_hot    = false;
         @event.status     = true;
         db.events.Add(@event);
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }