Ejemplo n.º 1
0
        private void bSubmit_Click_1(object sender, EventArgs e)
        {
            bool status = false;
            f_ScheduleAppointment app = this;
            validationOfForms     val = new validationOfForms();

            status = val.validateAppointmentForm(app, tMRN.Text, cDate.Text, cMonth.Text, cYear.Text, cHour.Text, cMinutes.Text, cAmOrPm.Text);
            if (!(status))
            {
                manAll.Show();
                manDate.Show();
                manMrn.Show();
                manTime.Show();
                MessageBox.Show("Please fill up all the required information");
            }
        }
        //
        //
        //

        public bool validateChangePasswordForm(string role, string oldPassword, string newPassword, string confirm, out bool oldp, out bool newp, out bool confirmp)
        {
            oldp = newp = confirmp = false;
            if (oldPassword == "")
            {
                oldp = true;
            }
            if (newPassword == "")
            {
                newp = true;
            }
            if (confirm == "")
            {
                confirmp = true;
            }

            bChangePassword   change = new bChangePassword();
            validationOfForms val    = new validationOfForms();

            if (!(oldp || newp || confirmp))
            {
                if (change.checkNewPassword(role, oldPassword, newPassword, confirm))
                {
                    MessageBox.Show("Password Change Successful!!!");
                    //this.Dispose();
                    return(true);
                }

                else
                {
                    MessageBox.Show("Unsuccessful!\nTry Again");
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 3
0
        private void b_submit_Click(object sender, EventArgs e)
        {
            string r = c_role.Text;     //String role is being read from the form
            string u = t_username.Text; //String username is being read from the form
            string p = t_password.Text; //String password is being read from the form
            bool   flag;                // Flag holds the success state of login form validation

            //this.Hide();
            Form1 current = this;

            validationOfForms validForm = new validationOfForms(); //Class which validates the user enetered data

            flag = validForm.validateLoginForm(r, u, p, current);  // Function of Class ValidationForms is used

            if (flag)
            {
                current.Hide();
                // MessageBox.Show("Login successful");
            }
            else
            {
                MessageBox.Show("Login Failed. Try again");
            }
        }
Ejemplo n.º 4
0
        private void bOk_Click(object sender, EventArgs e)
        {
            bool oldp, newp, confirmp, status;

            oldPassword     = tOldPassword.Text;
            newPassword     = tNewPassword.Text;
            confirmPassword = tNewPasswordConfirm.Text;
            //bChangePassword change=new bChangePassword();
            changePasswordForm current = this;

            validationOfForms val = new validationOfForms();


            status = val.validateChangePasswordForm(role, oldPassword, newPassword, confirmPassword, out oldp, out newp, out confirmp);
            if (oldp)
            {
                mandatoryOld.Show();
            }
            else
            {
                mandatoryOld.Hide();
            }

            if (newp)
            {
                mandatoryNew.Show();
            }
            else
            {
                mandatoryNew.Hide();
            }

            if (confirmp)
            {
                mandatoryConfirm.Show();
            }
            else
            {
                mandatoryConfirm.Hide();
            }

            if (status)
            {
                current.Dispose();
            }


            /* if(!(oldp&&newp&&confirmp))
             * {
             *
             *   if (change.checkNewPassword(role, oldPassword, newPassword, confirmPassword))
             *   {
             *       MessageBox.Show("Password Change Successful!!!");
             *       this.Dispose();
             *
             *   }
             *   else
             *   {
             *       MessageBox.Show("Unsuccessful!\nTry Again");
             *
             *   }
             * }
             *
             * else
             * {
             *   MessageBox.Show("Try Again");
             * }*/
        }
        private void bSave1_Click_2(object sender, EventArgs e)
        {
            bool             gen, emer;
            f_PatientDetails current = this;


            bpatientInfo      patient = new bpatientInfo();
            bRegistration     reg     = new bRegistration();
            validationOfForms val     = new validationOfForms();

            //patient.male=rbMale.
            if (rbMale.Checked)
            {
                patient.gender = "Male";
            }
            else if (rbFemale.Checked)
            {
                patient.gender = "Female";
            }

            patient.dob = cMonth.Text + '/' + cDay.Text + '/' + cYear.Text;


            patient.firstName  = tFirstName.Text;
            patient.middleName = tMiddleName.Text;
            patient.lastName   = tLastName.Text;


            patient.fatherName = tFatherName.Text;
            patient.occupation = tOccupation.Text;

            //patient.mrn = Convert.ToInt32(tb_mrn.Text);
            patient.office    = tOffice.Text;
            patient.religion  = cReligion.Text;
            patient.ethnicity = tEthnicity.Text;
            patient.email     = tEmail.Text;


            patient.streetAddress2 = tStreetAddress2.Text;
            patient.city2          = tCity2.Text;
            patient.state2         = tState2.Text;
            patient.zipcode2       = tZipCode2.Text;

            patient.streetAddress3 = tStreetAddress3.Text;
            patient.city3          = tCity3.Text;
            patient.state3         = tState3.Text;
            patient.zipcode3       = tZipCode3.Text;


            patient.phoneHomeCode   = tHomePhoneCode.Text;
            patient.phoneOfficeCode = tOfficePhoneCode.Text;
            patient.phoneMobileCode = tMobileCode.Text;
            patient.phoneHome       = tHomePhone.Text;
            patient.phoneMobile     = tMobilePhone.Text;
            patient.phoneOffice     = tOfficePhone.Text;


            patient.eEmail           = tEmail1.Text;
            patient.eFirstName       = tFirstName1.Text;
            patient.eMiddleName      = tMiddleName1.Text;
            patient.eLastName        = tLastName1.Text;
            patient.eHomestreet      = tStreetAddress.Text;
            patient.eHomeCity        = tCity.Text;
            patient.eHomeState       = tState.Text;
            patient.eHomeZip         = tZipCode.Text;
            patient.eOfficeStreet    = tStreetAddress1.Text;
            patient.eOfficeCity      = tCity1.Text;
            patient.eOfficeState     = tState1.Text;
            patient.eOfficeZip       = tZipCode1.Text;
            patient.eHomePhoneCode   = tHomePhone1.Text;
            patient.eOfficePhoneCode = tOfficePhoneCode1.Text;
            patient.eMobilePhoneCode = tMobileCode.Text;
            patient.ePhoneHome       = tHomePhone.Text;
            patient.ePhoneOffice     = tOfficePhone1.Text;
            patient.ePhoneMobile     = tMobilePhone1.Text;


            val.validateRegistrationForm(patient, out gen, out emer);


            if (gen && emer)
            {
                reg.register(patient);

                MessageBox.Show("Successful Registration!!");

                //f_ReceptionHome rec = new f_ReceptionHome();
                //rec.Show();
                current.Dispose();
            }
            else if (gen)
            {
                tabEmergency.Show();
                tabEmergency.BringToFront();
                manEcity.Show();
                manEfirstName.Show();
                manEhomePhone.Show();
                manElastName.Show();
                manEstate.Show();
                manEstreet.Show();
                manEzip.Show();
                tabEmergency.Show();


                MessageBox.Show("\tFields are invalid!\nEnter the compulsory fields marked with *");
            }

            else
            {
                tabGeneral.Show();
                tabGeneral.BringToFront();

                mandatoryFirstName.Show();
                mandatoryFatherName.Show();
                mandatoryGender.Show();
                mandatoryHomeAddress.Show();
                mandatoryHomePhone.Show();
                mandatoryDOB.Show();
                mandatoryLastName.Show();
                mandatoryZip.Show();
                MessageBox.Show("enter the general items");
            }
        }