private void OpenForm(LessonPlanEntity entity) { EditTimetable form = new EditTimetable(entity); form.Show(); Close(); }
public EditTimetable(LessonPlanEntity lessonPlan) { InitializeComponent(); LoadComboBoxes(); if (lessonPlan.Id != 0) { _lessonPlanEntity = lessonPlan; } }
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); } }
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); } }
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); } }