private void btSort_Click(object sender, EventArgs e) { if (cbbProperties.SelectedItem != null) { dataGridView1.DataSource = BLL_HD.Instance().Sort(cbbProperties.Text); } }
private void btDelete_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count > 0) { foreach (DataGridViewRow i in dataGridView1.SelectedRows) { int MAHD = Convert.ToInt32(i.Cells["mahopdong"].Value); BLL_HD.Instance().Delete(MAHD); } ShowAllHDViews(); } }
private void btSearchdate_Click(object sender, EventArgs e) { foreach (hopdong i in BLL_HD.Instance().GetAllHD()) { if ((dateTimePickerNgayKi.Value.Month.Equals(i.ngayki.Month) && dateTimePickerNgayKi.Value.Year.Equals(i.ngayki.Year))) //dateTimePickerNgayHetHan.Value.Month.Equals(i.ngayki.Month + Convert.ToDateTime(i.thoihan).Month)) { cbboxHD.Items.Add(new CBBItem { Value = i.mahopdong, Text = i.tenhopdong, }); } } }
private void BtsearchNameID_Click(object sender, EventArgs e) { if (TXTsearch.TextLength == 0) { ShowAllHDViews(); } else { if (TXTsearch.Text.All(char.IsDigit)) { int value = Convert.ToInt32(TXTsearch.Text); dataGridView1.DataSource = BLL_HD.Instance().GetHDbyIDViews(value); } else { string name = TXTsearch.Text; dataGridView1.DataSource = BLL_HD.Instance().GetHDByNameViews(name); } } }
public void ShowAllHDViews() { dataGridView1.DataSource = BLL_HD.Instance().GetALLHDViews(); }