コード例 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="kiemtra"></param>
 /// <returns></returns>
 public Entities.HienThiBaoCao[] KiemTraNhomHangHoa(Entities.HienThiBaoCao[] kiemtra)
 {
     Entities.HienThiBaoCao[] tra = null;
     try
     {
         ArrayList arr = new ArrayList();
         for (int i = 0; i < kiemtra.Length; i++)
         {
             Entities.TruyenGiaTri      giatri = new TruyenGiaTri("", kiemtra[i].Ma);
             Entities.ThongTinHangHoa[] data   = Select(giatri);
             if (data.Length > 0)
             {
                 arr.Add(kiemtra[i]);
             }
             else
             {
                 continue;
             }
         }
         int n = arr.Count;
         if (n == 0)
         {
             tra = null;
         }
         tra = new Entities.HienThiBaoCao[n];
         for (int i = 0; i < n; i++)
         {
             tra[i] = (Entities.HienThiBaoCao)arr[i];
         }
     }
     catch (Exception ex)
     { string s = ex.Message; tra = null; }
     return(tra);
 }
コード例 #2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="kiemtra"></param>
 /// <returns></returns>
 public Entities.HienThiBaoCao[] KiemTraNhomHangHoa(Entities.HienThiBaoCao[] kiemtra)
 {
     Entities.HienThiBaoCao[] tra = null;
     try
     {
         ArrayList arr = new ArrayList();
         for (int i = 0; i < kiemtra.Length; i++)
         {
             Entities.TruyenGiaTri giatri = new TruyenGiaTri("", kiemtra[i].Ma);
             Entities.ThongTinHangHoa[] data = Select(giatri);
             if (data.Length > 0)
             {
                 arr.Add(kiemtra[i]);
             }
             else
             { continue; }
         }
         int n = arr.Count;
         if (n == 0) { tra = null; }
         tra = new Entities.HienThiBaoCao[n];
         for (int i = 0; i < n; i++)
         {
             tra[i] = (Entities.HienThiBaoCao)arr[i];
         }
     }
     catch (Exception ex)
     { string s = ex.Message; tra = null; }
     return tra;
 }