Esempio n. 1
0
        private void LoadCBBLoaiHangHoa()
        {
            LoaiService loaiService = new LoaiService();

            cbbLoaiHangHoa.DataSource    = loaiService.GetAll();
            cbbLoaiHangHoa.DisplayMember = "TenLoai";
            cbbLoaiHangHoa.ValueMember   = "MaLoai";
        }
Esempio n. 2
0
        private void LoadCbbLoaiHangHoa()
        {
            LoaiService loaiService = new LoaiService();
            List <Loai> lLoai       = loaiService.GetAll();

            lLoai.Add(new Loai()
            {
                MaLoai  = 0,
                TenLoai = "Chọn Loại Hàng Hóa"
            });
            cbbLoaiHangHoa.DataSource    = lLoai;
            cbbLoaiHangHoa.DisplayMember = "TenLoai";
            cbbLoaiHangHoa.ValueMember   = "MaLoai";
            cbbLoaiHangHoa.SelectedValue = 0;
        }
Esempio n. 3
0
 private void btnThem_Click(object sender, EventArgs e)
 {
     try
     {
         Loai        nCC  = GetInputForm();
         LoaiService nccs = new LoaiService();
         nccs.Add(nCC);
         LoadDGVLoaiHangHoa();
         SetInputForm(new Loai());
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Lỗi",
                         MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 4
0
        private void LoadDGVLoaiHangHoa()
        {
            LoaiService loaiService = new LoaiService();

            dgvLoaiHangHoa.DataSource = loaiService.GetAll();
        }