// 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); }
// 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; }
// 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); }