private void itemSettingClient_Click(object sender, EventArgs e) { FormClient form = new FormClient(); form.MdiParent = this; form.Show(); }
private void button1_Click(object sender, EventArgs e) { string queryString = "SELECT * FROM Account where username ='******' and password ='******'"; using (OleDbConnection connection = new OleDbConnection(connectionString)) //tạo lớp kết nối vào .mbd using (OleDbCommand command = new OleDbCommand(queryString, connection)) //tạo lớp lệnh sql sử dụng lớp kết nối trên { try { connection.Open(); //bắt đầu kết nối OleDbDataReader reader = command.ExecuteReader(); //thực thi sql và trả về kết quả if (reader.Read() == true) //đọc kết quả { FormClient client = new FormClient(); client.Text = txtUsername.Text; client.Show(); this.Hide(); FormClient.texttt = txtUsername.Text; } else { MessageBox.Show("thong tin dang nhap sai"); txtPassword.Text = ""; txtUsername.Text = ""; txtUsername.Focus(); } reader.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
private void login_Click(object sender, EventArgs e) { this._loginVO = this._loginBUS.getUser(textUser.Text, textPassw.Text); if (this._loginVO.type == null) { MessageBox.Show("Incorrect username or password!", "Not Found", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (this._loginVO.type == "Customer") { //MessageBox.Show(_loginVO.idClient.ToString(), "Result", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Hide(); FormClient fc = new FormClient(); fc.setId(this._loginVO.idClient); DataGridView dataGrid = fc.getGrid(); fc.refreshGrid(this._loginVO.idClient); fc.Show(); } else { this.Hide(); FormAdmin fa = new FormAdmin(); fa.refreshGrid(); fa.Show(); } }
private void buttonClient_Click(object sender, EventArgs e) { FormClient OpenClient = new FormClient(this); OpenClient.Show(); this.Hide(); }
public void Start(IPipeMessageSender thePipeMessageSender) { itsFormClient = new FormClient(thePipeMessageSender); itsFormClient.Show(); itsFormClient.FormClosing += FormClient_FormClosing; }
private void button1_Click(object sender, EventArgs e) { Form fr = new FormClient(); fr.Show(); }