Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 3
0
 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);
 }