private void BtThem_Click(object sender, EventArgs e) { BUSDaiLy _busdaily = new BUSDaiLy(); if (txtTenDaily.Text== "" || txtDiaChi.Text == "" || txtDiaChi.Text == "" || txtSDT.Text == "") { MessageBox.Show("Nhập thiếu thông tin"); } else { _daily.Madaily = _busdaily.MaDaiLy(); GanProperties(); bool result = DALDaiLy.AddDaily(_daily); if (result == true) { MessageBox.Show("Thêm thành công"); load(); } else { MessageBox.Show("Thêm thất bại"); } } }
private void btTim_Click(object sender, EventArgs e) { _Search.Madaily = txtSdaily.Text; _Search.Tendaily = txtSTenDaily.Text.Trim(); _Search.Duong = txtSDuong.Text.Trim(); _Search.Quan = txtSQuan.Text.Trim(); _Search.notu = Convert.ToInt64(txtSNotu.Text); _Search.noden = Convert.ToInt64(txtSNoden.Text); BUSDaiLy _busdaily = new BUSDaiLy(_Search); GVDaily.DataSource = _busdaily.timkiemNXB(); txtSDuong.Text = ""; txtSNoden.Text = "0"; txtSNotu.Text = "0"; txtSQuan.Text = ""; txtSTenDaily.Text = ""; }