List <BindItem> GetBindItemList()
        {
            var entities = new Models.PriceCheckerEntities();
            var arbo     = new BO.AllotmentRecordBO(entities);
            var rtbo     = new BO.AllotmentRoomTypeBO(entities);
            var hbo      = new BO.HotelBO(entities);

            var rr  = arbo.GetQueryable();
            var rts = rtbo.GetQueryable();
            var hh  = hbo.GetQueryable(null);
            var qq  = from r in rr
                      join rt in rts on r.AllotmentRoomTypeId equals rt.RecordId
                      join h in hh on rt.HotelId equals h.HotelId
                      where h.CheckAllotment & r.CurrentAllotment < rt.DefaultAllotment && !r.Acknowledged & !rt.IgnoreThisRoomType
                      select new BindItem
            {
                Acknowledged  = r.Acknowledged,
                HotelId       = h.HotelId,
                HotelName     = h.HotelName,
                AllotmentDate = r.AllotmentDate,
                RecordId      = r.RecordId,
                RoomName      = rt.RoomName,
                //    Allotment = r.CurrentAllotment
            };
            var lst = qq.OrderBy(q => q.HotelName).ThenBy(q => q.RoomName).ToList();

            return(lst);
        }
        List <BindingItem> GetBindingItemList()
        {
            var entities = new Models.PriceCheckerEntities();

            rtbo = new BO.AllotmentRoomTypeBO(entities);
            rbo  = new BO.AllotmentRecordBO(entities);
            var rts = rtbo.GetQueryable();
            var rr  = rbo.GetQueryable();
            var qq  = from r in rr
                      join rt in rts on r.AllotmentRoomTypeId equals rt.RecordId
                      where rt.HotelId == _hotel.HotelId && r.CurrentAllotment < rt.DefaultAllotment
                      & !rt.IgnoreThisRoomType
                      select new { rt, r };

            if (_currentRoomType != null && _currentRoomType.RecordId != 0)
            {
                qq = qq.Where(x => x.rt.RecordId == _currentRoomType.RecordId);
            }

            if (cxNotAcknowledgedOnly.Checked)
            {
                qq = qq.Where(q => !q.r.Acknowledged);
            }

            var items = qq.Select(x => new BindingItem
            {
                Acknowledged     = x.r.Acknowledged,
                CurrentAllotment = x.r.CurrentAllotment,
                Date             = x.r.AllotmentDate,
                RecordId         = x.r.RecordId,
                RoomName         = x.rt.RoomName
            }).OrderBy(x => x.Acknowledged).ThenBy(x => x.RoomName).ThenBy(x => x.Date).ToList();

            return(items);
        }
Exemple #3
0
 public AllotmentRecordRepository(PriceCheckerEntities ent)
 {
     entities = ent;
 }
Exemple #4
0
 public AllotmentRecordRepository()
 {
     entities = new Models.PriceCheckerEntities();
 }
Exemple #5
0
 public CityRepository()
 {
     entities = new Models.PriceCheckerEntities();
 }
Exemple #6
0
 public CityRepository(PriceCheckerEntities entities)
 {
     this.entities = entities;
 }
 public AllotmentRoomTypeRepository(Models.PriceCheckerEntities entities)
 {
     this.entities = entities;
 }
 public AllotmentRoomTypeRepository()
 {
     entities = new Models.PriceCheckerEntities();
 }
 public RoomTypeRepository(PriceCheckerEntities entities)
 {
     this.entities = entities;
 }
 public HotelRepository(PriceCheckerEntities entities)
 {
     this.entities = entities;
 }
Exemple #11
0
 public ContractRoomRepository(PriceCheckerEntities entities)
 {
     this.entities = entities;
 }
Exemple #12
0
 public ContractRoomRepository()
 {
     entities = new Models.PriceCheckerEntities();
 }
Exemple #13
0
 public ElementlabelRepository(PriceCheckerEntities ent)
 {
     entities = ent;
 }
Exemple #14
0
 public ElementlabelRepository()
 {
     entities = new Models.PriceCheckerEntities();
 }