示例#1
0
        public void Schedule_Item_Delete()
        {
            ScheduleController controller = new ScheduleController();
            Schedule           schedule   = CreateSchedule();

            controller.CreateScheduleItem(schedule, DateTime.Now, TestFactories.GetDefaultPerson(), new List <Baptizer>(),
                                          TestFactories.GetDefaultPerson(), true, "test user");

            ScheduleItem item   = schedule.ScheduleItems.First();
            int          itemID = item.ScheduleItemID;

            controller.DeleteScheduleItem(schedule, item.ScheduleItemID);
            string key = KeyHelper.GetKey <IScheduleItemRepository>();

            Assert.IsFalse(RepositoryFactory.GetRepository <IScheduleItemRepository>(key).Exists(itemID));
        }
示例#2
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     scheduleController.DeleteScheduleItem(schedule, scheduleItem.ScheduleItemID);
     Response.Redirect(string.Format("~/default.aspx?page={0}&schedule={1}",
                                     ScheduleItemListPageSetting, schedule.ScheduleID));
 }