public void DeleteSlot(SlotBase slot) { Requires.NotNull(slot); Requires.PropertyNotNegative(slot, "SlotId"); using (var context = DataContext.Instance()) { var rep = context.GetRepository <SlotBase>(); rep.Delete(slot); } }
public void UpdateSlot(SlotBase slot, int userId) { Requires.NotNull(slot); Requires.PropertyNotNegative(slot, "SlotId"); slot.LastModifiedByUserID = userId; slot.LastModifiedOnDate = DateTime.Now; using (var context = DataContext.Instance()) { var rep = context.GetRepository <SlotBase>(); rep.Update(slot); } }
public int AddSlot(ref SlotBase slot, int userId) { Requires.NotNull(slot); slot.CreatedByUserID = userId; slot.CreatedOnDate = DateTime.Now; slot.LastModifiedByUserID = userId; slot.LastModifiedOnDate = DateTime.Now; using (var context = DataContext.Instance()) { var rep = context.GetRepository <SlotBase>(); rep.Insert(slot); } return(slot.SlotId); }