コード例 #1
0
        /// <summary>
        /// Saves the routine check if fields are valid
        /// </summary>
        private void saveButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.areEntryFieldsValid())
                {
                    var routineCheck = this.buildRoutineCheck();

                    if (this.IsEditing)
                    {
                        RoutineCheckDAL.UpdateRoutineCheck(routineCheck);
                        this.showRoutineCheckSavedMessage(routineCheck);
                        this.Close();
                    }
                    else
                    {
                        RoutineCheckDAL.InsertNewRoutineCheck(routineCheck);
                        this.showRoutineCheckSavedMessage(routineCheck);
                        this.Close();
                    }
                }
            } catch (Exception err)
            {
                ExceptionMessage.ShowError(err);
            }
        }
コード例 #2
0
 private void loadRoutineCheck()
 {
     this.Appointment.RoutineCheck             = RoutineCheckDAL.GetAppointmentRoutineCheck(this.Appointment.ID);
     this.Appointment.RoutineCheck.Appointment = this.Appointment;
     this.initializeRoutineCheckControls();
 }