/* private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
         * {
         *   f_ChangePassword aobj = new f_ChangePassword();
         *   aobj.Show();
         * }*/


        private void button2_Click(object sender, EventArgs e)
        {
            this.Dispose();
            //appointment_form app = new appointment_form();
            //app.Show();
            f_ScheduleAppointment aobj = new f_ScheduleAppointment();

            aobj.Show();
        }
Beispiel #2
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 validateAppointmentForm(f_ScheduleAppointment app, string mrntext, string daytext, string monthtext, string yeartext, string hourtext, string mintext, string amorpmtext)//appointment form validation
        {
            if (mrntext == "" || daytext == "DD" || monthtext == "MM" || yeartext == "YYYY" || hourtext == "Hr" || mintext == "Min")
            {
                return(false);
            }
            else
            {
                dbAppointment db   = new dbAppointment();
                bool          flag = db.checkMrn(mrntext);
                if (flag == true)
                {
                    app.Hide();
                    bAppointment appoint = new bAppointment(mrntext, daytext, monthtext, yeartext, hourtext, mintext, amorpmtext);
                    if (appoint.scheduleAppointment())
                    {
                        MessageBox.Show("Appointment fixed");
                        f_ReceptionHome rec = new f_ReceptionHome();
                        rec.Show();
                    }

                    else
                    {
                        MessageBox.Show("Time slot already booked! Try again!");
                        f_ReceptionHome rec = new f_ReceptionHome();
                        rec.Show();
                    }

                    return(true);
                }
                else
                {
                    MessageBox.Show("The MRN entered is not valid! Please enter a valid number");
                    return(true);
                }
            }
        }