Beispiel #1
0
        private void btnSetAppmntToday_Click(object sender, EventArgs e)
        {
            string date = DateTime.Now.ToString("yyyy-MM-dd");

            if (labappmnt.isAppointmentAllowed(date))
            {
                labappmnt.Adate = date;
                MessageBox.Show("Appointment Date is set ", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Beispiel #2
0
        /*update patients detals on button click*/

        private void btnLPUpdate_Click(object sender, EventArgs e)
        {
            Validation val = new Validation();

            if (fieldCheck(txtLPNameUpdate.Text, "name", "lblLPUpdateNameErr", "lblLPUpdateNamePicErr", "grpBoxLPUpdate") & fieldCheck(txtLPAgeUpdate.Text, "age", "lblLPUpdateAgeErr", "lblLPUpdateAgePicErr", "grpBoxLPUpdate") & fieldCheck(txtLPPhoneUpdate.Text, "phone", "lblLPUpdatePhoneErr", "lblLPUpdatePhonePicErr", "grpBoxLPUpdate") & fieldCheck(txtLPEmailUpdate.Text, "email", "lblLPUpdateEmailErr", "lblLPUpdateEmailPicErr", "grpBoxLPUpdate") & fieldCheck(cmbLPGenderUpdate.SelectedItem.ToString(), null, null, "lblLPUpdateGenderPicErr", "grpBoxLPUpdate"))
            {
                string upName = txtLPNameUpdate.Text, upAge = txtLPAgeUpdate.Text, upPhone = txtLPPhoneUpdate.Text, upEmail = txtLPEmailUpdate.Text, upAppmntDate = dateLPAppDateUpdate.Value.ToString("yyyy-MM-dd"), upGender = cmbLPGenderUpdate.SelectedItem.ToString();

                DialogResult dialogResult = MessageBox.Show("Are you sure you want to update?", "Update Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (dialogResult == DialogResult.Yes)
                {
                    if (manipulateLabPatient.Name != upName)
                    {
                        manipulateLabPatient.Name = upName;
                        manipulateLabPatient.updateLabPatientData("Name");
                    }

                    if (manipulateLabPatient.Age.ToString() != upAge)
                    {
                        manipulateLabPatient.Age = Convert.ToInt32(upAge);
                        manipulateLabPatient.updateLabPatientData("Age");
                    }

                    if (manipulateLabPatient.Phone != upPhone)
                    {
                        manipulateLabPatient.Phone = upPhone;
                        manipulateLabPatient.updateLabPatientData("Phone");
                    }

                    if (manipulateLabPatient.Email != upEmail)
                    {
                        manipulateLabPatient.Email = upEmail;
                        manipulateLabPatient.updateLabPatientData("Email");
                    }

                    if (manipulateLabAppmnt.Adate != upAppmntDate && manipulateLabAppmnt.isAppointmentAllowed(upAppmntDate))
                    {
                        manipulateLabAppmnt.Adate = upAppmntDate;
                        manipulateLabAppmnt.updateLabAppointmentDate();
                    }

                    if (manipulateLabPatient.Gender != upGender)
                    {
                        manipulateLabPatient.Gender = upGender;
                        manipulateLabPatient.updateLabPatientData("Gender");
                    }

                    FillAppointments();
                }

                else if (dialogResult == DialogResult.No)
                {
                    emptyUpdateFormData();
                }
            }
            //else
            //{
            //    MessageBox.Show("please select a field ", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //}
        }