コード例 #1
0
        private void BtnSaveAppointment_Click(object sender, EventArgs e)
        {
            Recipe recipe = new Recipe()
            {
                RecipeNumber = RecipeNumber
            };

            recipe = recipeController.GetRecipe(recipe);


            int sessionId   = examinationController.GetSessionId(SessionTimeId, doctor.DoctorId, DateTime.Today);
            int patientId   = patient.PatientId;
            int diognosisId = Convert.ToInt32(cmbDiagnosis.SelectedValue);
            int recipeId    = recipe.RecipeId;
            int exaStatu    = cmbExaminationStatus.SelectedIndex;

            if (cmbExaminationStatus.SelectedIndex != 0)
            {
                if (RecipeNumber == string.Empty)
                {
                    MessageBox.Show("Lütfen reçete yazınız.");
                }
                else
                {
                    if (examinationController.AddExamination(sessionId, patientId, diognosisId, recipeId, exaStatu))
                    {
                        MessageBox.Show("Muayene işlemi tamamlanmıştır.");
                        pnlPatientStatus.Visible = false;
                        CreateSession(DateTime.Today);
                    }
                    else
                    {
                        MessageBox.Show("Muayene eklerken sorun oluştu.");
                    }
                }
            }
            else
            {
                if (examinationController.AddExaminationAddExaminationForExaStatuZero(sessionId, patientId, diognosisId, exaStatu))
                {
                    MessageBox.Show("Muayene işlemi tamamlanmıştır.");
                    pnlPatientStatus.Visible = false;
                    CreateSession(DateTime.Today);
                }
                else
                {
                    MessageBox.Show("Muayene eklerken sorun oluştu.");
                }
            }
        }