private void button3_Click(object sender, EventArgs e) { AdminLayer al = new AdminLayer(); al.Show(); this.Hide(); }
private void button1_Click(object sender, EventArgs e) { if (textBox1.Text != "" && textBox2.Text != "") { using (DataInformationContext db = new DataInformationContext()) { var user = db.UserInfos.SingleOrDefault(u => u.UserName == textBox1.Text); if (user == null) { MessageBox.Show("UserName or Password is Wrong"); } else if (user.UserName == textBox1.Text && user.Password == textBox2.Text) { var type = user.UserType.ToString(); var password = user.Password.ToString(); if (password == user.Password && type == "Admin") { AdminLayer al = new AdminLayer(); al.Show(); this.Hide(); } else if (password == user.Password && type == "User") { UserLayer ul = new UserLayer(); ul.Show(); } } else { MessageBox.Show("UserName or Password Wrong"); } } } else { MessageBox.Show("Please Fill UserName and Password"); } }
private void button1_Click(object sender, EventArgs e) { int Order_Id; int Customer_Id; int Medicine_Id; DateTime Order_Date; Order_Id = Convert.ToInt32(textBox1.Text); Customer_Id = Convert.ToInt32(textBox2.Text); Medicine_Id = Convert.ToInt32(textBox3.Text); Order_Date = Convert.ToDateTime(dateTimePicker1.Text); OrderData.InsertOrderData(Order_Id, Customer_Id, Medicine_Id, Order_Date); MessageBox.Show("Customer Order Take Successful"); this.Hide(); AdminLayer al = new AdminLayer(); al.Show(); }