public DoctorLogin()
        {
            InitializeComponent();

            doctor             = new DoctorSystem();
            doctor.doctorlogin = this;
        }
 public DoctorLogin(Open open)
 {
     InitializeComponent();
     open1              = open;
     doctor             = new DoctorSystem();
     doctor.doctorlogin = this;
 }
Example #3
0
 public Open()
 {
     InitializeComponent();
     login       = new Login(this);
     member      = new MemberSystem();
     doctor      = new DoctorSystem();
     doctorlogin = new DoctorLogin(this);
 }
 public Login()
 {
     InitializeComponent();
     member         = new MemberSystem();
     hospital       = new HospitalSystem();
     doctor         = new DoctorSystem();
     member.login   = this;
     hospital.login = this;
     doctor.login   = this;
 }
        private void loginButton_Click(object sender, EventArgs e)
        {
            try
            {
                DoctorSystem doctor = new DoctorSystem(this);
                id        = ıdtextBox.Text;
                controlid = controlıdtxtbox.Text;
                if (ıdtextBox.Text == "" && passwordtextBox.Text != "")
                {
                    MessageBox.Show("Please enter your ID", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else if (passwordtextBox.Text == "" && ıdtextBox.Text != "")
                {
                    MessageBox.Show("Please enter your Password", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else if (ıdtextBox.Text == "" && passwordtextBox.Text == "")
                {
                    MessageBox.Show("Please enter your ID and Password", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    conn = new SqlConnection("Data Source=DESKTOP-UQ0368S\\SQLEXPRESS; Initial Catalog=Hospital_Appointment_System; User Id=sa; password=sqlserver;");
                    kmt  = new SqlCommand();
                    conn.Open();
                    kmt.Connection  = conn;
                    kmt.CommandText = "SELECT * FROM Doctor WHERE doctorID='" + ıdtextBox.Text + "' AND password='******'";
                    dr = kmt.ExecuteReader();

                    if (controlıdtxtbox.Text == "7564")
                    {
                        if (dr.Read())
                        {
                            doctor.textBox1.Text = id;
                            doctor.Show();
                            this.Hide();
                        }
                        else
                        {
                            MessageBox.Show("Wrong ID or Password!");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Wrong Control ID!");
                    }

                    conn.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }