private void button1_Click(object sender, EventArgs e) { try { string query = "select count(*) from admins where Username='******' and Password='******' and Position='" + position.Text + "'"; con.Open(); cmd = con.CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = query; int x = Convert.ToInt32(cmd.ExecuteScalar()); con.Close(); if (x == 1) { if (position.Text == "Sales Manager") { SalesSub s1 = new SalesSub(textBox1.Text); s1.Show(); this.Hide(); } else if (position.Text == "HR Manager") { HarasaraSystem.SubInterface.Employee.EmployeeSub e1 = new HarasaraSystem.SubInterface.Employee.EmployeeSub(textBox1.Text); e1.Show(); this.Hide(); } else if (position.Text == "Adminstration") { HarasaraSystem.SubInterface.Administration.AdministrationSub a1 = new SubInterface.Administration.AdministrationSub(textBox1.Text); a1.Show(); this.Hide(); } else if (position.Text == "Finance") { HarasaraSystem.SubInterface.Finance.FinanceSub f1 = new SubInterface.Finance.FinanceSub(textBox1.Text); f1.Show(); this.Hide(); } else if (position.Text == "Products") { HarasaraSystem.SubInterface.Production.ProductionSub p1 = new SubInterface.Production.ProductionSub(textBox1.Text); p1.Show(); this.Hide(); } else if (position.Text == "Inventory") { HarasaraSystem.SubInterface.Inventory.InventorySub i1 = new SubInterface.Inventory.InventorySub(textBox1.Text); i1.Show(); this.Hide(); } else { << << << < HEAD Transport.Main t1 = new Transport.Main();
private void btnAddItem_Click(object sender, EventArgs e) { //if (!panel3.Controls.Contains(HarasaraSystem.SubInterface.Production.ProductItems.Instance)) //{ // HarasaraSystem.SubInterface.Production.ProductItems.Instance.pid = txtPId.Text; // panel3.Controls.Add(HarasaraSystem.SubInterface.Production.ProductItems.Instance); // HarasaraSystem.SubInterface.Production.ProductItems.Instance.Dock = DockStyle.Fill; // HarasaraSystem.SubInterface.Production.ProductItems.Instance.BringToFront(); //} //else //{ // HarasaraSystem.SubInterface.Production.ProductItems.Instance.pid = txtPId.Text; // HarasaraSystem.SubInterface.Production.ProductItems.Instance.BringToFront(); //} ProductItem.ItemId = txtPId.Text; ProductionSub ps = new ProductionSub(""); ProductItems myForm = new ProductItems(); myForm.TopLevel = false; myForm.AutoScroll = true; this.panel3.Controls.Add(myForm); myForm.Show(); }