Esempio n. 1
0
        public static List <SearchDaily> LayDaiLytheoTimKiem(SearchDaily serach)
        {
            DBQLPhatHanhSachEntities model      = new DBQLPhatHanhSachEntities();
            List <SearchDaily>       ListSearch = new List <SearchDaily>();
            var _daily = (from p in model.Daily
                          select p);

            if (serach.Madaily != "")
            {
                _daily = _daily.Where(q => q.Madaily.Trim().Equals(serach.Madaily));
            }
            if (serach.notu != 0 && serach.noden != 0)
            {
                _daily = _daily.Where(q => q.No >= serach.notu && q.No <= serach.noden);
            }
            else if (serach.notu != 0 && serach.noden == 0)
            {
                _daily = _daily.Where(q => q.No >= serach.notu);
            }
            else if (serach.notu == 0 && serach.noden != 0)
            {
                _daily = _daily.Where(q => q.No <= serach.noden);
            }
            foreach (var row in _daily)
            {
                SearchDaily _Search = new SearchDaily();
                _Search.Tendaily = row.Tendaily.Trim();
                _Search.Madaily  = row.Madaily.Trim();
                _Search.Duong    = row.Diachi.Trim();
                _Search.Quan     = row.Diachi.Trim();
                ListSearch.Add(_Search);
            }
            return(ListSearch);
        }
Esempio n. 2
0
 public static List<SearchDaily> LayDaiLytheoTimKiem(SearchDaily serach)
 {
     DBQLPhatHanhSachEntities model = new DBQLPhatHanhSachEntities();
     List<SearchDaily> ListSearch = new List<SearchDaily>();
     var _daily = (from p in model.Daily
                 select p);
     if(serach.Madaily!="")
     {
         _daily = _daily.Where(q => q.Madaily.Trim().Equals(serach.Madaily));
     }
     if (serach.notu != 0 && serach.noden != 0)
     {
         _daily = _daily.Where(q => q.No >= serach.notu && q.No <= serach.noden);
     }
     else if (serach.notu != 0 && serach.noden == 0)
     {
         _daily = _daily.Where(q => q.No >= serach.notu);
     }
     else if (serach.notu == 0 && serach.noden != 0)
     {
         _daily = _daily.Where(q => q.No <= serach.noden);
     }
     foreach (var row in _daily)
     {
         SearchDaily _Search = new SearchDaily();
         _Search.Tendaily = row.Tendaily.Trim();
         _Search.Madaily = row.Madaily.Trim();
         _Search.Duong = row.Diachi.Trim();
         _Search.Quan = row.Diachi.Trim();
         ListSearch.Add(_Search);
     }
     return ListSearch;
 }
Esempio n. 3
0
 public BUSDaiLy(SearchDaily Search)
 {
     this.Search = Search;
 }