public void HienthiNguyenLieu(List <ChiTietPhieuNhap> list)
 {
     if (list.Count() > 0)
     {
         foreach (var item in list)
         {
             if (item.ChiTietNguyenLieu == null)
             {
                 item.ChiTietNguyenLieu = CChiTietNguyenLieu_BUS.findCT(item.maChitietNguyenLieu);
             }
             if (item.PhieuNhapNguyenLieu == null)
             {
                 item.PhieuNhapNguyenLieu = CPhieuNhapNguyenLieu_BUS.find(item.maPhieuNhap);
             }
         }
         dgChiTietNguyenLieu.ItemsSource = list.Select(x => new
         {
             maChiTietNguyenLieu = x.maChitietNguyenLieu.Substring(10),
             tenNguyenLieu       = CNguyenLieu_BUS.findTenByMaChiTietNguyenLieu(x.maChitietNguyenLieu),
             donGia     = x.donGia,
             soLuong    = x.soLuong,
             ngayNhap   = x.PhieuNhapNguyenLieu.ngayNhap.Value.ToString("dd/MM/yyyy"),
             ngayHetHan = x.ChiTietNguyenLieu.ngayHetHan.Value.ToString("dd/MM/yyyy")
         });
     }
 }
Example #2
0
        private void dgDSPhieuNhap_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (dgDSPhieuNhap.SelectedItem == null)
            {
                return;
            }
            var maPhieuNhap = dgDSPhieuNhap.SelectedValue.ToString();

            PhieuNhapNguyenLieuSelect = CPhieuNhapNguyenLieu_BUS.find(maPhieuNhap);
        }