private void AddEditBookingNote_Load(object sender, EventArgs e) { var unitOfWork = new UnitOfWork(); if(presetID!=null) { WorkingNote = unitOfWork.BookingClassificationRepository.GetByID(presetID.Value); } if(WorkingNote !=null) { tbNote.Text = WorkingNote.ClassificationName; } //stylesSheetManager1.ApplyStyles(); }
private void button1_Click(object sender, EventArgs e) { var unitOfWork = new UnitOfWork(); if (WorkingNote == null) { WorkingNote = new BookingClasification(); WorkingNote.ClassificationName = tbNote.Text; unitOfWork.BookingClassificationRepository.Insert(WorkingNote); } else { WorkingNote.ClassificationName = tbNote.Text; if(presetID!=null) unitOfWork.BookingClassificationRepository.Update(WorkingNote); } unitOfWork.Save(); DialogResult = DialogResult.OK; }