예제 #1
0
        /// <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);
        }