本文整理汇总了C#中Entities.Count方法的典型用法代码示例。如果您正苦于以下问题:C# Entities.Count方法的具体用法?C# Entities.Count怎么用?C# Entities.Count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entities
的用法示例。
在下文中一共展示了Entities.Count方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Search
/// <summary>
/// Tim kiem hang hoa trong DataGridView.
/// </summary>
/// <param name="type"></param>
/// <param name="searchVal"></param>
/// <param name="arr"></param>
public void Search(string type, string searchVal, Entities.ChiTietKhoHang[] arr)
{
List<Entities.ChiTietKhoHang> ctList = new List<Entities.ChiTietKhoHang>();
try
{
if (arr == null || arr.Count() <= 0)
{
return;
}
switch (type)
{
case "MaHang":
for (int i = 0; i < arr.Length; i++)
{
int kiemtra = arr[i].MaHangHoa.ToString().ToUpper().IndexOf(searchVal.ToUpper());
if (kiemtra >= 0)
{
ctList.Add(arr[i]);
}
}
BinData(ctList.ToArray());
break;
case "TenHang":
for (int i = 0; i < arr.Length; i++)
{
int kiemtra = arr[i].TenHangHoa.ToString().ToUpper().IndexOf(searchVal.ToUpper());
if (kiemtra >= 0)
{
ctList.Add(arr[i]);
}
}
BinData(ctList.ToArray());
break;
case "HanSuDung":
for (int i = 0; i < arr.Length; i++)
{
int kiemtra = arr[i].HanSuDung.ToShortDateString().ToUpper().IndexOf(searchVal.ToUpper());
if (kiemtra >= 0)
{
ctList.Add(arr[i]);
}
}
BinData(ctList.ToArray());
break;
}
}
catch (Exception)
{
}
}
示例2: GetNgayHetHan
/// <summary>
/// Lay ngay het han
/// </summary>
/// <param name="maHangHoa"></param>
/// <param name="maKho"></param>
/// <returns></returns>
public DateTime GetNgayHetHan(string maHangHoa, Entities.ChiTietKhoHangTheoMa[] ctkhoArr)
{
DateTime dt = new DateTime();
try
{
if (ctkhoArr != null && ctkhoArr.Count() > 0)
{
foreach (Entities.ChiTietKhoHangTheoMa item in ctkhoArr)
{
if (maHangHoa.ToUpper().Equals(item.MaHangHoa))
dt = item.Ngayhethan;
}
}
}
catch (Exception)
{
}
return dt;
}
示例3: GetData
/// <summary>
/// Get Data
/// </summary>
/// <param name="sqArr"></param>
/// <returns></returns>
public Entities.TongHopThuChi[] GetData(Entities.SoQuy[] sqArr)
{
List<Entities.TongHopThuChi> list = new List<Entities.TongHopThuChi>();
try
{
if (sqArr != null && sqArr.Count() > 0)
{
foreach (Entities.SoQuy item in sqArr)
{
Entities.TongHopThuChi tc = new Entities.TongHopThuChi();
tc.MaPhieu = item.MaPhieu;
tc.NgayLap = item.NgayLap;
tc.PhatSinhNo = double.Parse(item.PhatSinhNo);
tc.PhatSinhCo = double.Parse(item.PhatSinhCo);
tc.Ton = double.Parse(item.Ton);
tc.DienGiai = item.DienGiai;
list.Add(tc);
}
}
}
catch (Exception)
{
}
return list.ToArray();
}