private void signin_Click(object sender, EventArgs e) { // patient_main p = new patient_main(); //p.Show(); if (textBox1.Text == "" || password.Text == "")//validation part { MessageBox.Show("Please, insert all values"); } else { int r = controllerObj.loginh(textBox1.Text.ToString(), password.Text.ToString()); if (r > 0) // { hid = r; MessageBox.Show("you loged in successfuly"); menuh a = new menuh(); a.Show(); } else { MessageBox.Show("Username or Password incorrect. Please try again"); } } }
//static int ID; //public void setid(int id) //{ // ID = id; //} // public int getid() //{ // return ID; //} private void sign_Click(object sender, EventArgs e) { if (Username.Text == "" || Password.Text == "" || name.Text == "") { MessageBox.Show("you must insert username,password and name "); } else { int g = controllerObj.getmaxh(); g++; int r = controllerObj.inserth(g, name.Text.ToString(), Convert.ToInt32(no.Text), addr.Text.ToString(), city.Text.ToString()); if (r > 0) { int p = controllerObj.InsertUserh1(Username.Text.ToString(), Password.Text.ToString(), g); MessageBox.Show("thank you for signingup"); menuh a = new menuh(); a.Show(); } else { MessageBox.Show("Insertion Failed"); } } }