private void pictureBox1_Click_1(object sender, EventArgs e) { this.Close(); Admin_Dashboard admin = new Admin_Dashboard(); admin.Show(); }
private void button2_Click(object sender, EventArgs e) { Admin_Dashboard ad = new Admin_Dashboard(); ad.Show(); this.Close(); }
private void bunifuThinButton21_Click(object sender, EventArgs e) { if (text1.Text == "admin" && text2.Text == "admin") { Admin_Dashboard admindash = new Admin_Dashboard(); this.Hide(); admindash.Show(); } else if (text1.Text != "admin") { SqlConnection sql = new SqlConnection(conn); sql.Open(); string query = "select * from EmployeeData where Name = '" + text1.Text + "' and Password='******' "; SqlCommand cmd = new SqlCommand(query, sql); SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows == true) { this.Hide(); Employee_Dashboard dash = new Employee_Dashboard(); dash.Show(); } else { MessageBox.Show("Enter Correct username & Password", "Login Failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Enter Correct username & Password", "Login Failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void button1_Click_1(object sender, EventArgs e) { if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox6.Text == "") { MessageBox.Show("Please Enter Information", "Boxes are empty!"); } else { if (int.Parse(textBox6.Text) < 0) { MessageBox.Show("Quentity cannot be negative"); } else { var date = DateTime.Now; var dt = date.ToString("MM/dd/yyyy"); SqlConnection sql = new SqlConnection(Admin.conn); string qry = @"insert into products (Product_Id,Name,Price,Quantity,Category,Details,Date) VALUES('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox6.Text + "','" + comboBox1.Text + "','" + textBox5.Text + "','" + dt + "')"; sql.Open(); SqlCommand sd = new SqlCommand(qry, sql); sd.ExecuteNonQuery(); sql.Close(); MessageBox.Show("Your Product has been added successfully", "Added Product"); this.Close(); Admin_Dashboard ad = new Admin_Dashboard(); ad.Refresh(); } // Refresh(); //changing } }