Ejemplo n.º 1
0
 public void LoadData()
 {
     try
     {
         dt = hd.LayMatHang();
         cbMaHang.DataSource    = dt;
         cbMaHang.DisplayMember = "TenHang";
         cbMaHang.ValueMember   = "MaHang";
         dt = new DataTable();
         dt = dh.LayDonHang();
         cbMaDon.DataSource    = dt;
         cbMaDon.DisplayMember = "MaDonHang";
         cbMaDon.ValueMember   = "MaDonHang";
         if (MaDonHang.ToString() != "0")
         {
             cbMaDon.SelectedValue = MaDonHang.ToString();
             dgvDSHTD.DataSource   = hd.LayHoaDonTheoMaDonHang(MaDonHang);
         }
         else
         {
             dgvDSHTD.DataSource = hd.LayHoaDon();
         }
     }
     catch
     {
         MessageBox.Show("Chưa có mặt hàng nào. Vui lòng thêm mặt hàng!!!");
     }
     KH();
     LayTenNhanVien();
     DayLenToolStrips();
 }
Ejemplo n.º 2
0
 public void LoadData()
 {
     if (MaDonHang.ToString() != "0")
     {
         dataGridView2.DataSource = km.LayTongGiamGiaTheoMa(MaDonHang, MaHang);
     }
     else
     {
         dataGridView2.DataSource = km.LayTongGiamGia();
     }
     LayTenNhanVien();
     DayLenToolStrips();
 }
Ejemplo n.º 3
0
        public void LoadData()
        {
            try
            {
                dt = new DataTable();
                dt = dh.LayDonHang();
                cbMaDon.DataSource    = dt;
                cbMaDon.DisplayMember = "MaDonHang";
                cbMaDon.ValueMember   = "MaDonHang";

                DataTable dt1 = new DataTable();
                dt1 = mh.LayQua();
                comboBox1.DataSource    = dt1;
                comboBox1.DisplayMember = "TenHang";
                comboBox1.ValueMember   = "MaHang";

                DataTable dt2 = new DataTable();
                dt2 = mh.LayMatHang();

                cbMaQua.DataSource    = dt2;
                cbMaQua.DisplayMember = "TenHang";
                cbMaQua.ValueMember   = "MaHang";
                if (MaDonHang != 0)
                {
                    dgvTQ.DataSource      = tq.LayTangQuaTheoMa(Int32.Parse(MaDonHang.ToString()), MaHang.ToString());
                    cbMaDon.SelectedValue = MaDonHang;
                    cbMaQua.SelectedValue = MaHang;
                    int SLQua = SoLuong / 2;
                    txtSL.Text = SLQua.ToString();
                }
                else
                {
                    dgvTQ.DataSource = tq.LayTangQua();
                }
                //dgvTQ.DataSource = mh.LayMatHang();
                btnLuu.Enabled  = false;
                btnThem.Enabled = true;
                btnSua.Enabled  = true;
                btnXoa.Enabled  = true;
                tam             = -1;
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
            LayTenNhanVien();
            DayLenToolStrips();
        }
Ejemplo n.º 4
0
 public void LoadData()
 {
     if (MaDonHang.ToString() != "0")
     {
         dgvDSPS.DataSource = ps.LayPhiShipTheoMa(MaDonHang);
     }
     else
     {
         dgvDSPS.DataSource = ps.LayPhiShip();
     }
     txtMaDonHang.Text = MaDonHang.ToString();
     btnSua.Enabled    = true;
     btnluu.Enabled    = false;
     LayTenNhanVien();
     DayLenToolStrips();
 }
Ejemplo n.º 5
0
 public void LoadData()
 {
     if (MaDonHang.ToString() != "0")
     {
         try
         {
             dgvDonHang.DataSource = dh.F_LoadDonHang(MaDonHang);
             dgvHoaDon.DataSource  = dh.F_LoadHoaDon(MaDonHang);
             dgvTangQua.DataSource = dh.F_LoadTangQua(MaDonHang);
             dgvGiamGia.DataSource = dh.F_LoadGiamGia(MaDonHang);
             LoadLenGroup();
         }
         catch { MessageBox.Show("Không Load "); }
     }
     LayTenNhanVien();
     DayLenToolStrips();
 }