コード例 #1
0
 public void AddEvent(string EventNam)
 {
     DataBaseECont.EventBase.Add(new EventBase {
         EventName = EventNam
     });
     DataBaseECont.SaveChanges();
 }
コード例 #2
0
 public bool AddEventsFromEventCreator(List <EventDataCreator> Inlist)
 {
     try
     {
         DataBaseECont.Database.Connection.Open();
         DataBaseECont.EventBase.Add(new EventBase {
             EventName = Inlist.First().EventName, EventTimeTable = CollectionFromEventDateCreator(Inlist)
         });                                                                                                                                           //ВЫбрать между этим или Foreach ниже
         foreach (EventDataCreator DT in Inlist)
         {
             DataBaseECont.EventTimeTable.Add(new EventTimeTable
             {
                 EventDateTime   = DT.EventDate,
                 EventID         = DataBaseECont.EventBase.Local.Last().EventID,
                 UserID          = (short)DataBaseECont.GetNowUserID(),
                 EverywhatRemind = DT.RemindEvery
             });
         }
         DataBaseECont.SaveChanges();
         DataBaseECont.Database.Connection.Close();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
コード例 #3
0
 public bool AddRemindsFromRemindCreator(List <RemindDataCreator> InList, int InID)
 {
     try
     {
         DataBaseECont.Database.Connection.Open();
         foreach (RemindDataCreator DT in InList)
         {
             DataBaseECont.EventRemindTable.Add(new EventRemindTable
             {
                 EventID         = InID,
                 DateUntilRemind = DT.RemindUntil,
                 UserID          = (short)DataBaseECont.GetNowUserID(),
                 TypeOfRemind    = DT.HowToRemind,
                 //TODO
             });
         }
         DataBaseECont.SaveChanges();
         DataBaseECont.Database.Connection.Close();
         return(true);
     }
     catch { return(false); }
 }