Ejemplo n.º 1
0
        private void frmBanHang_Load(object sender, EventArgs e)
        {
            var table = khachHang.GetAllData();

            cbTenKH.Properties.DataSource    = table;
            cbTenKH.Properties.DisplayMember = "Tên khách hàng";
            cbTenKH.Properties.ValueMember   = "Mã KH";

            var dataTable1 = tnd.GetAllDataNV();

            cbNhanVien.Properties.DataSource    = dataTable1;
            cbNhanVien.Properties.DisplayMember = "HoTen";
            cbNhanVien.Properties.ValueMember   = "MaNV";

            cbNhanVien.EditValue = dataTable1.Rows[0][0];

            DateTime today = DateTime.UtcNow.Date;

            cbNgay.DateTime = today;

            var dataTable2 = khohang.GetData();

            cbKhoHang.Properties.DataSource    = dataTable2;
            cbKhoHang.Properties.DisplayMember = "TenKho";
            cbKhoHang.Properties.ValueMember   = "MaKho";

            cbKhoHang.EditValue = dataTable2.Rows[0][0];

            int sl = db.GetSoLuong("HoaDonNhap") + 1;

            string mhd;

            if (sl < 10)
            {
                mhd = "HD00" + sl;
            }
            else
            {
                mhd = "HD0" + sl;
            }
            txtMaPhieu.Text = mhd;

            GridLookUpMaHang.NullText = @"Chọn mã sản phẩm";
            GridLookUpDonVi.NullText  = @"Chọn đơn vị";
            TextEditTenSP.NullText    = @"(Click vào đây)";


            var dt = hdn.GetDataSource();

            gridControl1.DataSource = dt;

            loadSPTheoMaHang();
            loadDonVi();
        }
Ejemplo n.º 2
0
        private void frmKhachHang_Load(object sender, EventArgs e)
        {
            int tag      = int.Parse(this.Tag.ToString());
            var roleform = GlobalVar.dictRoleForm[tag];

            usChucNang1.EnnableFunction(roleform);
            usChucNang1.Controls["btndong"].Click += dong;
            usChucNang1.Controls["btnthem"].Click += ThemKH;

            var dataTable = Bus_kh.GetAllData();

            gcKhachHang.DataSource = dataTable;
        }
Ejemplo n.º 3
0
        private void LoadData()
        {
            var dataTable = Bus_kh.GetAllData();

            gcKhachHang.DataSource = dataTable;
        }
Ejemplo n.º 4
0
        private void groupControl1_Paint(object sender, EventArgs e)
        {
            var table = khachHang.GetAllData();

            cbTenKH.Properties.DataSource    = table;
            cbTenKH.Properties.DisplayMember = "Tên khách hàng";
            cbTenKH.Properties.ValueMember   = "Mã KH";

            var dataTable1 = tnd.GetAllDataNV();

            cbNhanVien.Properties.DataSource    = dataTable1;
            cbNhanVien.Properties.DisplayMember = "HoTen";
            cbNhanVien.Properties.ValueMember   = "MaNV";

            cbNhanVien.EditValue = dataTable1.Rows[0][0];

            DateTime today = DateTime.UtcNow.Date;

            cbNgay.DateTime = today;

            var dataTable2 = khohang.GetAllData();

            cbKhoHang.Properties.DataSource    = dataTable2;
            cbKhoHang.Properties.DisplayMember = "Tên";
            cbKhoHang.Properties.ValueMember   = "Mã";

            cbKhoHang.EditValue = dataTable2.Rows[0][0];

            int sl = db.GetSoLuong("HoaDonBan") + 1;

            string mhd;

            if (sl < 10)
            {
                mhd = "HDB00" + sl;
            }
            else
            {
                mhd = "HDB0" + sl;
            }
            txtMaPhieu.Text = mhd;

            LookupEditMaHang.NullText = @"Chọn mã sản phẩm";
            LookUpDonVi.NullText      = @"Chọn đơn vị";
            TextEditTenSP.NullText    = @"(Click vào đây)";


            var dt = cthdb_bus.GetDataSource();

            gridControl1.DataSource = dt;

            loadSP();
            loadDonVi();

            LookUpDonVi.BestFitMode      = BestFitMode.BestFitResizePopup;
            LookupEditMaHang.BestFitMode = BestFitMode.BestFitResizePopup;

            txtVAT.EditValue = 10;
            txtCK.EditValue  = 0;

            DataTable dt2 = dieukhoan.GetAllData();

            cbDieuKhoan.Properties.DataSource    = dt2;
            cbDieuKhoan.Properties.DisplayMember = "MoTa";
            cbDieuKhoan.Properties.ValueMember   = "MaDieuKhoan";
            cbDieuKhoan.EditValue = dt2.Rows[0][0];

            DataTable dt3 = hinhthuc.GetAllData();

            cbHinhThuc.Properties.DataSource    = dt3;
            cbHinhThuc.Properties.DisplayMember = "MoTa";
            cbHinhThuc.Properties.ValueMember   = "MaHinhThuc";
            cbHinhThuc.EditValue = dt3.Rows[0][0];
        }