private void submit_Click(object sender, EventArgs e) { database objdata = new database(); if (string.IsNullOrEmpty(ID.Text) || string.IsNullOrEmpty(password.Text)) { MessageBox.Show("Please fill all the feilds", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { if (objdata.authenticate(ID.Text, password.Text)) { userIdCheckLogin = ID.Text; Menu objM = new Menu(); objM.userIdMenu = userIdCheckLogin; //byte[] file; //string path = @"C: \Users\sanaa\Downloads\download.jpg"; //using (var stream = new FileStream(path, FileMode.Open, FileAccess.Read)) //{ // using (var reader = new BinaryReader(stream)) // { // file = reader.ReadBytes((int)stream.Length); // } //} //database obj = new database(); //MessageBox.Show(userIdCheckLogin); //obj.saveImage(file, userIdCheckLogin); objM.Show(); this.Hide(); } else { MessageBox.Show("Please enter correct combination of ID and Password", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }
private void submit_Click(object sender, EventArgs e) { database objdata = new database(); if (string.IsNullOrEmpty(ID.Text) || string.IsNullOrEmpty(password.Text)) { MessageBox.Show("Please fill all the feilds", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { if (objdata.authenticate(ID.Text, password.Text)) { userIdCheckLogin = ID.Text; Menu objM = new Menu(); objM.userIdMenu = userIdCheckLogin; objM.Show(); this.Hide(); } else { MessageBox.Show("Please enter correct combination of ID and Password", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }