Ejemplo n.º 1
0
        // Add a new mealschedule to database
        public void AddMealSchedule(string topic, string participants, string location, string startDate, string endDate, string lastEditorUserId)
        {
            //for datamaintainer to add meal

            MealSchedule ms = new MealSchedule(Utils.CreateIdByType("MealSchedule", dataHandler.FindLastMealscheduleId()), topic, participants, location, startDate, endDate, lastEditorUserId);

            dataHandler.AddMealschedule(ms);
        }
Ejemplo n.º 2
0
 // Find meal sechdule by Id
 public MealSchedule FindMealScheduleById(string id)
 {
     MealSchedule mealSchedule;
     try
     {
         var x = mealScheduleTableAdapter.FindMealScheduleById(id).ToList().First();
         mealSchedule = new MealSchedule(x.Id, x.Topic, x.Participants, x.Location, x.StartDate, x.EndDate, x.LastEditUserId);
     }
     catch
     {
         mealSchedule = null;
     }
     return mealSchedule;
 }
Ejemplo n.º 3
0
 // Add a mealschedule data into database
 public void AddMealschedule(MealSchedule mealSchedule)
 {
     mealScheduleTableAdapter.Insert(mealSchedule.Id, mealSchedule.Topic, mealSchedule.Participants, mealSchedule.Location, mealSchedule.StartDate, mealSchedule.EndDate, mealSchedule.LastEditUserId);
 }