private void Button3_Click(object sender, EventArgs e) { if (user.employee_position.ToString() == "เจ้าของร้าน" || user.employee_position.ToString() == "พนักงานคลังสินค้า") { FormCollection fc = Application.OpenForms; bool FormFound = false; foreach (Form form in fc) { if (form.Name == "proForm1") { FormFound = true; form.Focus(); break; } } if (FormFound == false) { proForm1 pro = new proForm1(this); pro.MdiParent = this; pro.Show(); } } else { MessageBox.Show("คุณไม่มีสิทธิ์ในการเข้าถึงฟังก์ชันนี้"); } }
private void HomePage_Load(object sender, EventArgs e) { label1.Text = user.employee_user.ToString(); label2.Text = user.employee_position.ToString(); pictureBox1.Image = byteArrayToImage(user.employee_picture); if (user.employee_position.ToString() == "เจ้าของร้าน") { emForm1 em = new emForm1(this); em.MdiParent = this; em.Show(); } else if (user.employee_position.ToString() == "พนักงานคลังสินค้า") { proForm1 pro = new proForm1(this); pro.MdiParent = this; pro.Show(); } else if (user.employee_position.ToString() == "พนักงานขายหน้าร้าน") { sellProduct pro = new sellProduct(user, this); pro.MdiParent = this; pro.Show(); } }
public AddPro(proForm1 pro) { this.pro = pro; InitializeComponent(); }
public addSet(proForm1 pro) { this.pro = pro; InitializeComponent(); }
public editPro(proForm1 pro, string data) { this.pro = pro; this.data = data; InitializeComponent(); }