private void LoginDiry_Click(object sender, EventArgs e) { if (UsertextBox.Text == "shakil" && PasswordtextBox.Text == "123") { ShowDiry diry = new ShowDiry(); diry.Show(); this.Hide(); } else { MessageBox.Show("invalid username or pasword!!"); } }
private void uploadImage_Click(object sender, EventArgs e) { OpenFileDialog fd1 = new OpenFileDialog(); fd1.Filter = "image files|*.jpg;*.png;*.gif;*.icon;.*;"; DialogResult dres1 = fd1.ShowDialog(); if (dres1 == DialogResult.Abort) { return; } if (dres1 == DialogResult.Cancel) { return; } imgtextBox.Text = fd1.FileName; ShowDiry sdiary = new ShowDiry(); //sdiary.EventpictureBox.Image= Image.FromFile(fd1.FileName); MemoryStream ms1 = new MemoryStream(); //sdiary.EventpictureBox.Image.Save(ms1, System.Drawing.Imaging.ImageFormat.Jpeg); }
private void LoginDiry_Click(object sender, EventArgs e) { if (UsertextBox.Text == "" || PasswordtextBox.Text == "") { MessageBox.Show("Username or Password can not be empty"); } else { UserDataServices userService = new UserDataServices(); bool result = userService.LoginValidation(UsertextBox.Text, PasswordtextBox.Text); if (result) { ShowDiry diary = new ShowDiry(); diary.Show(); this.Hide(); } else { MessageBox.Show("Invalid Username or Password"); } } }