Ejemplo n.º 1
0
        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";
        }
Ejemplo n.º 2
0
 public FormNhomHang()
 {
     InitializeComponent();
     themOrSua   = 1;
     nhomHangBUS = new NhomHangBUS();
     NH          = new NhomHangO();
 }
Ejemplo n.º 3
0
 public FormNhomHang(int themOrSua, NhomHangO nh)
 {
     this.themOrSua = themOrSua;
     InitializeComponent();
     nhomHangBUS = new NhomHangBUS();
     NH          = nh;
 }
Ejemplo n.º 4
0
        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!");
            }
        }
Ejemplo n.º 5
0
 void initBUS()
 {
     hangHoaBUS    = new HangHoaBUS();
     khoBUS        = new KhoBUS();
     nhomHangBUS   = new NhomHangBUS();
     donViBUS      = new DonViBUS();
     nhaCungCapBUS = new NhaCungCapBUS();
     HH            = new HangHoaO();
 }
Ejemplo n.º 6
0
 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;
     }
 }
Ejemplo n.º 7
0
        public IHttpActionResult GetAll()
        {
            List <NhomHangDTO> dtoes = new List <NhomHangDTO>();

            dtoes = NhomHangBUS.getAll();
            if (dtoes == null)
            {
                return(NotFound());
            }
            return(Ok(dtoes));
        }
Ejemplo n.º 8
0
        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";
 }
Ejemplo n.º 10
0
 public void LoadTatCaNhomHang()
 {
     GridControl1.DataSource = null;
     GridControl1.DataSource = NhomHangBUS.LoadNhomHang();
 }
Ejemplo n.º 11
0
 public UCNhomHang()
 {
     InitializeComponent();
     nhomHangBUS = new NhomHangBUS();
     nh          = new NhomHangO();
 }
Ejemplo n.º 12
0
 private void LoadCotPhanLoai()
 {
     repositoryItemCheckedComboBoxEdit_2.DataSource    = NhomHangBUS.LoadNhomHang();
     repositoryItemCheckedComboBoxEdit_2.DisplayMember = "TenNhomHang";
     repositoryItemCheckedComboBoxEdit_2.ValueMember   = "MaNhomHang";
 }