public frmThemHangHoa() { InitializeComponent(); txtMaHang.Text = HangHoaBUS.LayMaHH(); txtMaVach.Text = HangHoaBUS.LayMaHH(); gridlookupPhanLoaiHangHoa.Properties.DataSource = PhanLoaiHangHoaBUS.DanhSach(); gridlookupPhanLoaiHangHoa.Properties.DisplayMember = "TenPhanLoai"; gridlookupPhanLoaiHangHoa.Properties.ValueMember = "MaPhanLoai"; gridlookupKho.Properties.DataSource = KhoHangBUS.DanhSach(); gridlookupKho.Properties.DisplayMember = "Ten"; gridlookupKho.Properties.ValueMember = "MaKho"; gridlookupLoaiHangHoa.Properties.DataSource = NhomHangBUS.DanhSach(); gridlookupLoaiHangHoa.Properties.DisplayMember = "Ten"; gridlookupLoaiHangHoa.Properties.ValueMember = "MaNHH"; gridlookupNCC.Properties.DataSource = NhaCungCapBUS.DanhSach(); gridlookupNCC.Properties.DisplayMember = "TenNCC"; gridlookupNCC.Properties.ValueMember = "MaNCC"; gridlookupDonVi.Properties.DataSource = DonViBUS.DanhSach(); gridlookupDonVi.Properties.DisplayMember = "Ten"; gridlookupDonVi.Properties.ValueMember = "MaDV"; }
public FormNhomHang() { InitializeComponent(); themOrSua = 1; nhomHangBUS = new NhomHangBUS(); NH = new NhomHangO(); }
public FormNhomHang(int themOrSua, NhomHangO nh) { this.themOrSua = themOrSua; InitializeComponent(); nhomHangBUS = new NhomHangBUS(); NH = nh; }
public void btnLuu_Click(object sender, EventArgs e) { NhomHangDTO nh = new NhomHangDTO(); nh.MaNhomHang = Convert.ToInt32(txtMa.Text); nh.TenNhomHang = Convert.ToString(txtTen.Text.TrimEnd()); nh.GhiChu = Convert.ToString(txtGhiChu.Text.TrimEnd()); if (chxConQuanLy.Checked == true) { nh.ConQuanLy = true; } else { nh.ConQuanLy = false; } bool check = NhomHangBUS.KiemTraSua(nh); if (check) { if (eventSuaXongEvent != null) { eventSuaXongEvent(); } MessageBox.Show("Sửa thành công!"); Log_BUS.ThemNhatKy("Nhóm hàng", "Sửa thông tin nhóm hàng"); } else { MessageBox.Show("Sửa thất bại!"); } }
void initBUS() { hangHoaBUS = new HangHoaBUS(); khoBUS = new KhoBUS(); nhomHangBUS = new NhomHangBUS(); donViBUS = new DonViBUS(); nhaCungCapBUS = new NhaCungCapBUS(); HH = new HangHoaO(); }
private void LoadPhanLoai() { lkpPhanLoai.Properties.DataSource = NhomHangBUS.LoadNhomHang(); lkpPhanLoai.Properties.DisplayMember = "TenNhomHang"; lkpPhanLoai.Properties.ValueMember = "MaNhomHang"; if (!ReferenceEquals(((List <NhomHangDTO>)lkpPhanLoai.Properties.DataSource)[0], null)) { lkpPhanLoai.EditValue = ((List <NhomHangDTO>)lkpPhanLoai.Properties.DataSource)[0].MaNhomHang; } }
public IHttpActionResult GetAll() { List <NhomHangDTO> dtoes = new List <NhomHangDTO>(); dtoes = NhomHangBUS.getAll(); if (dtoes == null) { return(NotFound()); } return(Ok(dtoes)); }
public void btnXoa_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { switch (MessageBox.Show("Bạn có chắc chắn muốn xóa nhóm hàng này không?", "Hỏi Xóa", MessageBoxButtons.YesNo, MessageBoxIcon.Question)) { case DialogResult.Yes: int[] i = GridView1.GetSelectedRows(); int index = System.Convert.ToInt32(GridView1.GetRowCellValue(i[0], "MaNhomHang")); bool check = NhomHangBUS.KiemTraXoa(index); if (check) { LoadTatCaNhomHang(); MessageBox.Show("Xóa thành công!"); Log_BUS.ThemNhatKy("Nhóm hàng", "Xóa nhóm hàng"); } else { MessageBox.Show("Xóa thất bại!"); } break; case DialogResult.No: return; } }
private void LoadCotPhanLoai() { LoaiHangHoa.DataSource = NhomHangBUS.LoadNhomHang(); LoaiHangHoa.DisplayMember = "TenNhomHang"; LoaiHangHoa.ValueMember = "MaNhomHang"; }
public void LoadTatCaNhomHang() { GridControl1.DataSource = null; GridControl1.DataSource = NhomHangBUS.LoadNhomHang(); }
public UCNhomHang() { InitializeComponent(); nhomHangBUS = new NhomHangBUS(); nh = new NhomHangO(); }
private void LoadCotPhanLoai() { repositoryItemCheckedComboBoxEdit_2.DataSource = NhomHangBUS.LoadNhomHang(); repositoryItemCheckedComboBoxEdit_2.DisplayMember = "TenNhomHang"; repositoryItemCheckedComboBoxEdit_2.ValueMember = "MaNhomHang"; }