Пример #1
0
        private void OpenForm(LessonPlanEntity entity)
        {
            EditTimetable form = new EditTimetable(entity);

            form.Show();
            Close();
        }
Пример #2
0
 public EditTimetable(LessonPlanEntity lessonPlan)
 {
     InitializeComponent();
     LoadComboBoxes();
     if (lessonPlan.Id != 0)
     {
         _lessonPlanEntity = lessonPlan;
     }
 }
Пример #3
0
 public async Task DeletePlan(LessonPlanEntity lessonPlan)
 {
     using var unitOfWork = new UnitOfWork();
     try
     {
         await unitOfWork.LessonPlans.RemoveAsync(x => x.Id == lessonPlan.Id);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Пример #4
0
 public async Task UpdatePlan(LessonPlanEntity lessonPlan)
 {
     using var unitOfWork = new UnitOfWork();
     try
     {
         await unitOfWork.LessonPlans.UpdateAsync(lessonPlan, lesson => lesson.Id == lessonPlan.Id);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Пример #5
0
 public async Task InsertPlan(LessonPlanEntity lessonPlan)
 {
     using var unitOfWork = new UnitOfWork();
     try
     {
         await unitOfWork.LessonPlans.AddAsync(lessonPlan);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }