当前位置: 首页>>代码示例>>C#>>正文


C# Entities.Count方法代码示例

本文整理汇总了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)
            {

            }
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:58,代码来源:frmBaoCaoHanSuDung.cs

示例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;
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:27,代码来源:frmXuLy_DieuChuyenKhoNoiBo.cs

示例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();
        }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:31,代码来源:frmBaoCaoTongHopThuChi.cs


注:本文中的Entities.Count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。