/// <summary> /// 获取在宾客信息清单 /// </summary> /// <param name="listRoomInfo"></param> /// <param name="cStayStatus">该入住单是否在住</param> /// <param name="sStayType">宾客类型,主客Or从客</param> /// <param name="HisStayStatus">宾客是否退房</param> /// <param name="IsCountConsume">是否统计消费</param> /// <returns></returns> public List <CustomerStayModel> GetStayInRoomInfo(List <BasRoomModel> listRoomInfo, char cStayStatus, string sStayType, bool IsCountConsume) { List <CustomerStayModel> listCustomerStayInfo = new List <CustomerStayModel>(); CustomerStayModel mStayInfo = new CustomerStayModel(); ObjectControls oCtrl = new ObjectControls(); foreach (BasRoomModel mRoom in listRoomInfo) { mStayInfo.RoomInfo.RoomIdGroup += Cmn.MakeGroup(mRoom.RoomId.ToString()); } mStayInfo.RoomInfo.RoomIdGroup = Cmn.RemoveLastDou(mStayInfo.RoomInfo.RoomIdGroup); mStayInfo.Status = cStayStatus; mStayInfo.CustomerList = new List <CustomerModel>(); CustomerModel mc = new CustomerModel(); mc.CustomerStayHisInfo = new CustomerStayHisModel(); if (!string.IsNullOrEmpty(sStayType)) { mc.CustomerStayHisInfo.StayType = Cmn.ToChar(sStayType); oCtrl.Add(MCtrl.ByStayType); } mc.CustomerStayHisInfo.HisStatus = cStayStatus == 'I' ? 'E' : 'O'; mStayInfo.CustomerList.Add(mc); if (Cmn.CheckEOF(listRoomInfo)) { oCtrl.Add(MCtrl.ByRoomIdGroup); } oCtrl.Add(MCtrl.ByStayStatus); oCtrl.Add(MCtrl.ByHisStatus); listCustomerStayInfo = bCustomerStay.GetCustomerStayList(mStayInfo, oCtrl); if (Cmn.CheckEOF(listCustomerStayInfo) && IsCountConsume) { foreach (CustomerStayModel mCustomerStay in listCustomerStayInfo) { List <ConsumeDetailModel> listGetConsumeDetail = new List <ConsumeDetailModel>(); ConsumeDetailModel mConsume = new ConsumeDetailModel(); mConsume.StayId = mCustomerStay.StayId; oCtrl.Reset(); oCtrl.Add(MCtrl.ByStayId); listGetConsumeDetail = bConsume.GetConsumeList(mConsume, oCtrl); if (Cmn.CheckEOF(listGetConsumeDetail)) { mCustomerStay.ConSumeDetailList = listGetConsumeDetail; } } } return(listCustomerStayInfo); }
/// <summary> /// 获取宾客入住信息,消费明细 /// </summary> /// <param name="mRoom">房间信息</param> /// <param name="cStayStatus">入住状态 I In / O off</param> /// <param name="sStayType">入住类型,主客M从客S,如包含主从则为""</param> /// <returns></returns> public CustomerStayModel GetStayInRoomInfo(BasRoomModel mRoom, char cStayStatus, string sStayType) { CustomerStayModel mStayInfo = new CustomerStayModel(); ObjectControls oCtrl = new ObjectControls(); mStayInfo.RoomId = mRoom.RoomId; mStayInfo.Status = cStayStatus; mStayInfo.CustomerList = new List <CustomerModel>(); CustomerModel mc = new CustomerModel(); mc.CustomerStayHisInfo = new CustomerStayHisModel(); if (!string.IsNullOrEmpty(sStayType)) { mc.CustomerStayHisInfo.StayType = Cmn.ToChar(sStayType); oCtrl.Add(MCtrl.ByStayType); } mc.CustomerStayHisInfo.HisStatus = cStayStatus == 'I' ? 'E' : 'O'; mStayInfo.CustomerList.Add(mc); oCtrl.Add(MCtrl.ByRoomId); oCtrl.Add(MCtrl.ByStayStatus); oCtrl.Add(MCtrl.ByHisStatus); CustomerStayModel mCustomerStay = bCustomerStay.GetCustomerStayInfo(mStayInfo, oCtrl); if (mCustomerStay != null) { List <ConsumeDetailModel> listGetConsumeDetail = new List <ConsumeDetailModel>(); ConsumeDetailModel mConsume = new ConsumeDetailModel(); mConsume.StayId = mCustomerStay.StayId; oCtrl.Reset(); oCtrl.Add(MCtrl.ByStayId); listGetConsumeDetail = bConsume.GetConsumeList(mConsume, oCtrl); if (Cmn.CheckEOF(listGetConsumeDetail)) { mCustomerStay.ConSumeDetailList = listGetConsumeDetail; } } return(mCustomerStay); }