示例#1
0
        private void groupControl1_Paint(object sender, EventArgs e)
        {
            var dataTable2 = khohang.GetAllData();

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

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

            var dataTable1 = tnd.GetAllDataNV();
            cbNguoiChuyen.Properties.DataSource = dataTable1;
            cbNguoiChuyen.Properties.DisplayMember = "HoTen";
            cbNguoiChuyen.Properties.ValueMember = "MaNV";

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

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

            cbNguoiNhan.EditValue = dataTable1.Rows[1][0];

            DateTime today = DateTime.UtcNow.Date;
            cbNgay.DateTime = today;

           

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

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

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


            var dt = hdn.GetDataSource();

            gridControl1.DataSource = dt;

            loadSP();
            loadDonVi();

            LookUpEditDonVi.BestFitMode = BestFitMode.BestFitResizePopup;
            LookUpMaHang.BestFitMode = BestFitMode.BestFitResizePopup;

        }
示例#2
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();
        }
示例#3
0
        private void groupControl1_Paint(object sender, EventArgs e)
        {
            var table = ncc.GetAllData();

            cbTenNCC.Properties.DataSource    = table;
            cbTenNCC.Properties.DisplayMember = "Tên";
            cbTenNCC.Properties.ValueMember   = "Mã";

            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];

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

            string mhd;

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

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


            var dt = cthdn_bus.GetDataSource();

            gridControl1.DataSource = dt;

            LookUpMaHang.BestFitMode    = BestFitMode.BestFitResizePopup;
            LookUpEditDonVi.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];
        }