コード例 #1
0
        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();
        }
コード例 #2
0
        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;
        }