public void SuaXe_GUI_Load(object sender, EventArgs e)
        {
            tblHD = kh_BUS.Display("SELECT SOHD,NGSUA,NGHD,HOADON.TongGia,KHACHHANG.HOTEN,TENHANGXE,KHACHHANG.SODT,KHACHHANG.DIACHI,BIENSO,SOKM,SOKHUNG, MANVKT, MANVTV " +
                                   "FROM HOADON, KHACHHANG, HANGXE, NHANVIEN " +
                                   "WHERE HOADON.MAKH = KHACHHANG.MAKH AND  KHACHHANG.MAHANGXE = HANGXE.MAHANGXE AND HOADON.MANVTV = NHANVIEN.MANV AND HOADON.NGHD IS NULL");
            DataGridHD.DataSource         = tblHD;
            DataGridHD.AllowUserToAddRows = false;

            if (DataGridHD.RowCount != 0)
            {
                DataGridHD.CurrentCell = DataGridHD[0, DataGridHD.RowCount - 1];
                txtIDHD.Text           = DataGridHD.CurrentRow.Cells["IDHD"].Value.ToString();
            }
            else
            {
                txtIDHD.Text = "1";
            }

            txtIDKH.Text         = _txtIDKH;
            txtTenKhachHang.Text = _txtTenKhachHang;
            txtBienSo.Text       = _txtBienSo;
            txtSDT.Text          = _txtBienSo;
            txtLoaiXe.Text       = _txtLoaiXe;
            txtSoKM.Text         = _txtSoKM;
            txtSoKhung.Text      = _txtSoKhung;
            txtDiaChi.Text       = _txtDiaChi;
            txtNgaySua.Value     = DateTime.Now;

            tblNVTV               = nv_BUS.Display("SELECT HOTEN FROM NHANVIEN,CTNV WHERE CTNV.IDPHANQUYEN = NHANVIEN.IDPHANQUYEN AND CTNV.CHUC = 'NVTV'");
            txtNVTV.DataSource    = tblNVTV;
            txtNVTV.DisplayMember = "HOTEN";
            txtNVTV.ValueMember   = "HOTEN";

            tblNVKT               = nv_BUS.Display("SELECT HOTEN FROM NHANVIEN,CTNV WHERE CTNV.IDPHANQUYEN = NHANVIEN.IDPHANQUYEN AND CTNV.CHUC = 'NVKT'");
            txtNVKT.DataSource    = tblNVKT;
            txtNVKT.DisplayMember = "HOTEN";
            txtNVKT.ValueMember   = "HOTEN";
            loadSP();


            if (txtTenKhachHang.Text != "")
            {
                btnGhiPhieu.Enabled = true;
                btnXoaHD.Enabled    = true;
            }
        }
Example #2
0
        public void QLKhachHang_DTO_Load(object sender, EventArgs e)
        {
            tblKH = kh_BUS.Display("SELECT MAKH,HOTEN,BIENSO,SODT,TENHANGXE,SOKM,SOKHUNG,DIACHI " +
                                   "FROM KHACHHANG,HANGXE WHERE KHACHHANG.MAHANGXE = HANGXE.MAHANGXE " +
                                   "ORDER BY MAKH ASC");
            DataGridKhachHang.DataSource         = tblKH;
            DataGridKhachHang.AllowUserToAddRows = false;

            tblLX = hx_BUS.Display("SELECT * FROM HANGXE");
            txtLoaiXe.DataSource    = tblLX;
            txtLoaiXe.DisplayMember = "TENHANGXE";
            txtLoaiXe.ValueMember   = "TENHANGXE";

            if (tblKH.Rows.Count == 0)
            {
                MessageBox.Show("Chưa có khách hàng nào trong danh sách", "Thông Báo");
            }
        }
Example #3
0
        public void QLKhachHang2_GUI_Load(object sender, EventArgs e)
        {
            tblKH = kh_BUS.Display("SELECT KHACHHANG.MAKH,KHACHHANG.HOTEN,BIENSO,KHACHHANG.SODT,TENHANGXE,SOKM,SOKHUNG,KHACHHANG.DIACHI,COUNT(SOHD) AS SOLANSUA, SUM(TONGGIA) AS TONGTIENSUA " +
                                   "FROM KHACHHANG,HANGXE,HOADON " +
                                   "WHERE KHACHHANG.MAHANGXE = HANGXE.MAHANGXE AND KHACHHANG.MAKH = HOADON.MAKH " +
                                   "GROUP BY KHACHHANG.MAKH,KHACHHANG.HOTEN,BIENSO,KHACHHANG.SODT,TENHANGXE,SOKM,SOKHUNG,KHACHHANG.DIACHI ORDER BY MAKH ASC");

            DataGridKhachHang.DataSource         = tblKH;
            DataGridKhachHang.AllowUserToAddRows = false;

            tblLX = hx_BUS.Display("SELECT * FROM HANGXE");
            txtLoaiXe.DataSource    = tblLX;
            txtLoaiXe.DisplayMember = "TENHANGXE";
            txtLoaiXe.ValueMember   = "TENHANGXE";

            if (tblKH.Rows.Count == 0)
            {
                MessageBox.Show("Chưa có khách hàng nào trong danh sách", "Thông Báo");
            }
        }