public bool RemoveCalendar(TblCalendar model) { try { using (var context = new SolutionsOnlineSellingEntities()) { context.Entry(model).State = System.Data.Entity.EntityState.Deleted; context.SaveChanges(); return(true); } } catch (Exception ex) { Helpers.Logger.LogException(ex, true); return(false); } }
public bool ManageCalendar(TblCalendar model) { try { using (var context = new Model.SolutionsOnlineSellingEntities()) { context.Entry(model).State = model.EventId == 0 ? EntityState.Added : EntityState.Modified; context.SaveChanges(); return(true); } } catch (Exception ex) { Helpers.Logger.LogException(ex, true); return(false); } }