public List<RoomExtStatusEN> GetListStatusRoom(DateTime now) { RoomsBO aRoomsBO = new RoomsBO(); List<Rooms> aList = aRoomsBO.Select_All().Where(p => p.IDLang == 1).ToList(); List<RoomExtStatusEN> ret = new List<RoomExtStatusEN>(); try { ret = this.GetStatusRoom(aList.Select(p => p.Code).ToList(), now); } catch (Exception e) { throw new Exception("Có lỗi khi lấy trạng thái phòng : " + e.Message.ToString()); } return ret; }
public List<RoomExtStatusEN> GetListStatusRoom(DateTime now) { RoomsBO aRoomsBO = new RoomsBO(); List<Rooms> aList = aRoomsBO.Select_All().Where(p => p.IDLang == 1 && p.Disable == false).ToList(); List<RoomExtStatusEN> ret = new List<RoomExtStatusEN>(); for (int i = 0; i < aList.Count; i++) { try { ret.Add(this.GetStatusRoom(aList[i].ID, now)); } catch (Exception e) { throw new Exception("Có lỗi khi lấy trạng thái phòng " + aList[i].ID.ToString() + "-" + aList[i].Sku + "|" + e.Message.ToString()); } } return ret; }
private void frmTsk_CheckOut_Load(object sender, EventArgs e) { List<BookingRooms> aListTemp = new List<BookingRooms>(); if (aIDBookingRoom_Old == -1) { aListTemp.Clear(); // aListTemp = aBookingRoomsBO.Select_ByStatus_ByTime(DateTime.Now, Status); aListTemp = aBookingRoomsBO.Select_ByStatus(Status); } else { aListTemp.Clear(); aListTemp.Add(aBookingRoomsBO.Select_ByID(aIDBookingRoom_Old)); } RoomsBO aRoomsBO = new RoomsBO(); this.aListRooms = aRoomsBO.Select_All(); dgvBookingRooms.DataSource = this.GetListBookingRooms(aListTemp, this.aListRooms); dgvBookingRooms.RefreshDataSource(); }
//Hiennv 26/11/2014 ham dung de load toan bo du lieu theo IDBookingR public CheckInEN InitData(int IDBookingR) { try { CheckInEN aCheckInEN = new CheckInEN(); BookingRsBO aBookingRsBO = new BookingRsBO(); BookingRs aBookingRs = new BookingRs(); aBookingRs = aBookingRsBO.Select_ByID(IDBookingR); if(aBookingRs != null) { aCheckInEN.IDBookingR = aBookingRs.ID; aCheckInEN.CustomerType = aBookingRs.CustomerType.GetValueOrDefault(); aCheckInEN.BookingType = aBookingRs.BookingType.GetValueOrDefault(); aCheckInEN.Note = aBookingRs.Note; aCheckInEN.IDCustomerGroup = aBookingRs.IDCustomerGroup; aCheckInEN.IDCustomer = aBookingRs.IDCustomer; aCheckInEN.IDSystemUser = aBookingRs.IDSystemUser; aCheckInEN.PayMenthod = aBookingRs.PayMenthod.GetValueOrDefault(); aCheckInEN.StatusPay = aBookingRs.StatusPay.GetValueOrDefault(); aCheckInEN.BookingMoney = aBookingRs.BookingMoney.GetValueOrDefault(); aCheckInEN.ExchangeRate = aBookingRs.ExchangeRate.GetValueOrDefault(); aCheckInEN.Status = aBookingRs.Status.GetValueOrDefault(); aCheckInEN.Type = aBookingRs.Type.GetValueOrDefault(); aCheckInEN.Disable = aBookingRs.Disable.GetValueOrDefault(); aCheckInEN.Level = aBookingRs.Level; aCheckInEN.Subject = aBookingRs.Subject; aCheckInEN.Description = aBookingRs.Description; aCheckInEN.DatePay = aBookingRs.DatePay; aCheckInEN.DateEdit = aBookingRs.DateEdit; CustomerGroupsBO aCustomerGroupsBO = new CustomerGroupsBO(); CustomerGroups aCustomerGroups = new CustomerGroups(); aCustomerGroups = aCustomerGroupsBO.Select_ByID(aBookingRs.IDCustomerGroup); if(aCustomerGroups !=null) { aCheckInEN.IDCompany = aCustomerGroups.IDCompany; } } RoomsBO aRoomsBO = new RoomsBO(); List<Rooms> aListRooms = new List<Rooms>(); aListRooms = aRoomsBO.Select_All(); BookingRoomsBO aBookingRoomsBO = new BookingRoomsBO(); List<BookingRooms> aListBookingRooms = new List<BookingRooms>(); aListBookingRooms = aBookingRoomsBO.Select_ByIDBookingRs(IDBookingR); for (int i = 0; i < aListBookingRooms.Count; i++ ) { RoomMemberEN aRoomMemberEN = new RoomMemberEN(); aRoomMemberEN.IDBookingRooms = aListBookingRooms[i].ID; aRoomMemberEN.RoomCode = aListBookingRooms[i].CodeRoom; aRoomMemberEN.RoomSku = aCheckInEN.GetInfoRooms(aListRooms, aListBookingRooms[i].CodeRoom).Sku; aRoomMemberEN.RoomType = aCheckInEN.GetInfoRooms(aListRooms, aListBookingRooms[i].CodeRoom).Type.GetValueOrDefault(); aRoomMemberEN.RoomTypeDisplay = CORE.CONSTANTS.SelectedRoomsType(aCheckInEN.GetInfoRooms(aListRooms, aListBookingRooms[i].CodeRoom).Type.GetValueOrDefault()).Name; aRoomMemberEN.RoomBed1 = aCheckInEN.GetInfoRooms(aListRooms, aListBookingRooms[i].CodeRoom).Bed1.GetValueOrDefault(); aRoomMemberEN.RoomBed2 = aCheckInEN.GetInfoRooms(aListRooms, aListBookingRooms[i].CodeRoom).Bed2.GetValueOrDefault(); aRoomMemberEN.RoomCostRef = aCheckInEN.GetInfoRooms(aListRooms, aListBookingRooms[i].CodeRoom).CostRef.GetValueOrDefault(); aRoomMemberEN.RoomCost = aListBookingRooms[i].Cost.GetValueOrDefault(); aCheckInEN.InsertRoom(aRoomMemberEN); } return aCheckInEN; } catch (Exception ex) { MessageBox.Show("frmTsk_CheckInForRoomBooking.InitData()\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); return null; } }