private void btnLogin_Click(object sender, EventArgs e) { u.id = this.txtID.Text; u.password = this.txtPassword.Text; bool d = URepo.Validation(u); if (d == true) { this.Visible = false; MessageBox.Show("Welcome " + u.name.ToUpper()); if (u.role == "admin") { FormAdmin fa = new FormAdmin(); fa.lblAdminName.Text = "Welcome, " + u.name.ToUpper(); fa.Visible = true; } if (u.role == "salesman") { FormSalesman fs = new FormSalesman(); fs.lblSalesmanName.Text = "Welcome, " + u.name.ToUpper(); fs.Visible = true; } } else { MessageBox.Show("Please Try Again"); ClearFields(); } }
private void LoadFormSalesman() { fs = new FormSalesman(); fs.Text = "Inventory"; fs.lblSalesmanName.Visible = false; fs.pboxSalesman.Visible = false; //fs.ControlBox = false; fs.Resizable = false; //fs.Location = new System.Drawing.Point(300, 65); //fs.StartPosition = System.Windows.Forms.FormStartPosition.Manual; //fs.ClientSize = new System.Drawing.Size(609, 383); // fs.Visible = true; fs.updateMedicineToolStripMenuItem.Enabled = true; fs.deleteMedicineToolStripMenuItem.Enabled = true; }