private void btnOrder_Click(object sender, EventArgs e) { OrderListView orderListView = new OrderListView(VendorID); this.Hide(); orderListView.ShowDialog(); this.Close(); }
private void btnLogin_Click(object sender, EventArgs e) { String username = txtUsername.Text; String password = txtPassword.Text; lbError.Text = ""; if (username == String.Empty || password == String.Empty) { lbError.Text = "Vui lòng nhập đầy đủ tên đăng nhập và mật khẩu"; } else { int vendorID = Authentication.authenticate(username, password, type); if (vendorID == -1) { lbError.Text = "Không tìm thấy tài khoản."; } else { this.Hide(); switch (type) { case 0: MaintenanceForm maintenanceForm = new MaintenanceForm(); maintenanceForm.ShowDialog(); break; case 1: SystemReportView systemReportView; systemReportView = (vendorID == 0) ? new SystemReportView(0, 0) : new SystemReportView(vendorID); systemReportView.ShowDialog(); break; case 2: OrderListView orderForm = new OrderListView(vendorID); orderForm.ShowDialog(); break; default: MessageBox.Show("Vui lòng kiểm tra lại database"); break; } this.Close(); } } }