private void FrmThongKeSachBanDuoc_Load(object sender, EventArgs e) { dataGridView1.AutoGenerateColumns = false; cbDaily.DataSource = DALDaiLy.loadDaily(); cbDaily.DisplayMember = "Tendaily"; cbDaily.ValueMember = "Madaily"; txtmota.Hide(); labelmota.Hide(); }
public List <SearchDaily> timkiemNXB() { HotroTimKiemTheoTen convert = new HotroTimKiemTheoTen(); string SearchTenDaily = convert.ConvertString(Search.Tendaily).ToLower(); string SearchDuong = convert.ConvertString(Search.Duong).ToLower(); string SearchQuan = convert.ConvertString(Search.Quan).ToLower(); List <SearchDaily> ListSearch = DALDaiLy.LayDaiLytheoTimKiem(Search); if (Search.Tendaily != "") { ListSearch = ListSearch.FindAll(delegate(SearchDaily daily) { if (convert.ConvertString(daily.Tendaily).ToLower().Contains(SearchTenDaily)) { return(true); } else { return(false); } }); } if (Search.Duong != "") { ListSearch = ListSearch.FindAll(delegate(SearchDaily daily) { if (convert.ConvertString(daily.Duong).ToLower().Contains(SearchDuong)) { return(true); } else { return(false); } }); } if (Search.Quan != "") { ListSearch = ListSearch.FindAll(delegate(SearchDaily daily) { if (convert.ConvertString(daily.Duong).ToLower().Contains(SearchQuan)) { return(true); } else { return(false); } }); } return(ListSearch); }
private void GVDaily_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { DataGridViewRow row = GVDaily.Rows[e.RowIndex]; _madaily = row.Cells[0].Value.ToString(); } var DailySelected = DALDaiLy.Laydailytheoma(_madaily); txtTenDaily.Text = DailySelected.Tendaily; txtDiaChi.Text = DailySelected.Diachi; txtSDT.Text = DailySelected.SDT; txtTienNo.Text = DailySelected.No.ToString(); }
private void BTSua_Click(object sender, EventArgs e) { if (_madaily == "") { MessageBox.Show("Chưa chọn nhà xuất bản cần xóa"); } else { _daily.Madaily = _madaily; GanProperties(); bool result = DALDaiLy.UpdateDaily(_daily); if (result == true) { MessageBox.Show("Sửa thành công"); load(); } else { MessageBox.Show("Sửa thất bại"); } } }
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"); } } }
public string MaDaiLy() { return("DL" + (DALDaiLy.SoluongDaily() + 1).ToString()); }
public void load() { GVDaily.DataSource = DALDaiLy.loadDaily(); }