private void button1_Click(object sender, EventArgs e) { Create_Account CA = new Create_Account(); float qty = float.Parse(textBox3.Text); string[] product = ProdcomboBox.Text.Split(' '); string[] suppier = comboBox5.Text.Split(' '); int prodID = CA.getID("SELECT * FROM Product", product[0]); int supID = CA.getID("SELECT * FROM Supplier", suppier[0]); //MessageBox.Show((new Sales()).addOrder()+""); string add = "INSERT INTO SupplyProd VALUES(@Received, @Quantity, @Order_ID, @Product_ID, @Supplier_ID)"; addPO(add, qty, (new Sales()).addOrder(), prodID, supID); readAll(); }
public int addOrder() { try { CA = new Create_Account(); con = new SqlConnection(conStr); con.Open(); DateTime date = DateTime.Today; com = new SqlCommand("INSERT INTO OrderTable VALUES(@Date)", con); com.Parameters.AddWithValue("Date", date); com.ExecuteNonQuery(); con.Close(); int id = (CA).getID("SELECT * FROM OrderTable", date.ToString()); return(id); } catch (Exception ex) { MessageBox.Show(ex.Message); return(-1); } }
private void button1_Click(object sender, EventArgs e) { try { AcerLogisics AL = new AcerLogisics(); Create_Account CA = new Create_Account(); if (authenticate(txtID.Text, txtPassword.Text, ref UserID)) { //MessageBox.Show("User at " + CA.getID("SELECT * FROM Login", txtID.Text).ToString()); string[] tmp = getUserdet(readAEmpl, CA.getID("SELECT * FROM Login", txtID.Text)).Split(','); AL.label1.Text = "Logged in as " + tmp[0] + " " + tmp[1]; if (tmp[2] == "Manager") { AL.ShowDialog(); this.Close(); } else if (tmp[2] == "HR") { (new Human_Resources()).ShowDialog(); this.Close(); } } else { errorProvider1.SetError(txtPassword, "Invaid password"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void label6_Click(object sender, EventArgs e) { Create_Account newUser = new Create_Account(); newUser.ShowDialog(); }