Exemple #1
0
        public void fillData(DataGridViewRow row)
        {
            try
            {
                textBoxMaPhieu.Text = row.Cells[0].Value.ToString();
                textBoxNgayTao.Text = row.Cells[1].Value.ToString();
                textBoxNguoiLapPhieu.Text = row.Cells[3].Value.ToString();

                HoTro ht = new HoTro();
                ht.TaiDuLieu(comboBoxKh, "Customer", "CustomerId", "CustomerName");
                string CusName = row.Cells[2].Value.ToString();
                CustomerManager pl = new CustomerManager();
                foreach (Customer p in pl.GetAll())
                {
                    if (p.CustomerName.Equals(CusName))
                    {
                        comboBoxKh.SelectedValue = p.ID;
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #2
0
 public void taiDuLieu()
 {
     HoTro ht = new HoTro();
     if (tabControl1.SelectedIndex == 0)
     {
         ht.TaiDuLieu(comboBoxId, "Product", "ProductId", "ProductId");
         ht.TaiDuLieu(comboBoxIdKh, "Customer", "CustomerId", "CustomerId");
     }
     else if (tabControl1.SelectedIndex == 1)
     {
         string caulenh = "select BillSaleId as 'Mã phiếu', convert(varchar,createDate,103)  as 'Ngày tạo',Customername as 'Tên khách hàng', FullName as 'Người lập phiếu' " +
                      "from BillSale join Customer" +
                      " on BillSale.CustomerId = Customer.CustomerId" +
                      " inner join Users " +
                      "on BillSale.UserId = Users.UserId";
         ht.HienThiVaoDataGridView(dataGridViewDSPhieuBan, caulenh);
     }
 }
Exemple #3
0
 public void taiDuLieu()
 {
     HoTro ht = new HoTro();
     if (tabQuanLyPhieuNhap.SelectedIndex == 0) {
         txtNgayThang.Text = DateTime.Now.ToString("dd/MM/yyyy");
         ht.TaiDuLieu(cboNhaCungCap, "Provider", "ProviderId", "ProviderName");
         ht.TaiDuLieu(cboLoaiSanPham, "Category", "CategoryId", "CategoryName");
         ht.TaiDuLieu(cboDonViTinh, "Units", "UnitId", "UnitName");
         ht.TaiDuLieu(cboTenSanPham, "ProductName", "ProductNameId", "ProdName");
         ht.TaiDuLieu(cboNguonGoc, "Country", "CountryId", "CountryName");
         ht.TaiDuLieu(cboNhaSanXuat, "Manufacturer", "ManId", "ManName");
     }
     else if (tabQuanLyPhieuNhap.SelectedIndex == 1) {
         string caulenh = "select BillPurchaseId as 'Mã phiếu', convert(varchar,createDate,103) as 'Ngày tạo', DeliveryStaff as 'Nhân viên giao hàng', ProviderName as 'Nhà cung cấp', FullName as 'Người lập phiếu' " +
                      "from BillPurchase join Provider" +
                      " on BillPurchase.ProviderId = Provider.ProviderId" +
                      " inner join Users " +
                      "on BillPurchase.UserId = Users.UserId";
         ht.HienThiVaoDataGridView(dataGridViewPhieuNhapHAng, caulenh);
     }
 }