Example #1
0
 private void LoadUIInfo()
 {
     lblRoomNo.Text = mRoomInfo.RoomNo;
     lblRoomStatus.Text = hml.ToLookupCodeDesc("BAS_ROOM_INFO", "STATUS", mRoomInfo.Status.ToString());
     mCustomerStay = hml.GetStayInRoomInfo(mRoomInfo, 'I', "M");
     txtNotice.Text = mRoomInfo.RoomNotice;
     //if (mCustomerStay != null)
     //{
     //    lblDeposit.Text = mCustomerStay.Deposit.ToString();
     //    lblTotal.Text = hml.GetTotalRates(mCustomerStay, mCustomerStay.ConSumeDetailList, listSysParameter).ToString();
     //}
 }
Example #2
0
 public List<BasRoomModel> GetTeamRoomList(CustomerStayModel mCustomerStay, ObjectControls oCtrl)
 {
     string sql = @"SELECT A.ROOM_ID,D.MAIN_ROOM_ID, A.ROOM_NO, A.ROOM_TYPE,C.CODE_DESC AS ROOM_TYPE_DESC, A.ROOM_RATES, A.STATUS,
                      A.CREATE_DATE, A.CREATE_USERID, A.ROOM_PHONE,A.ROOM_NOTICE, A.UPDATE_DATE,A.UPDATE_USERID,
                      B.FLOOR_ID, B.FLOOR_NAME, B.STATUS AS FLOOR_STATUS
                      FROM BAS_ROOM_INFO AS A INNER JOIN
                       CUSTOMER_STAY_INFO AS D ON A.ROOM_ID=D.ROOM_ID  INNER JOIN
                      BAS_FLOOR_INFO AS B ON A.FLOOR_ID = B.FLOOR_ID
                     INNER JOIN SYS_LOOKUP_CODE AS C ON A.ROOM_TYPE=C.CODE_NO AND C.TABLE_NAME='BAS_ROOM_INFO'
                      AND C.COLUMN_NAME='ROOM_TYPE' ";
     oCtrl.Helper(oCtrl.Exsit(MCtrl.ByRoomId) && oCtrl.Append(ref sql, " AND A.ROOM_ID=" + mCustomerStay.RoomId));
     oCtrl.Helper(oCtrl.Exsit(MCtrl.ByMainRoomId) && oCtrl.Append(ref sql, " AND D.MAIN_ROOM_ID=" + mCustomerStay.MainRoomId));
     oCtrl.Helper(oCtrl.Exsit(MCtrl.ByStayStatus) && oCtrl.Append(ref sql, " AND D.STATUS=" + SQL(mCustomerStay.Status)));
     oCtrl.Helper(oCtrl.Exsit(MCtrl.ByRoomNo) && oCtrl.Append(ref sql, " AND A.ROOM_NO=" + SQL(mCustomerStay.RoomInfo.RoomNo)));
     oCtrl.Helper(oCtrl.Exsit(MCtrl.ByRoomStatus) && oCtrl.Append(ref sql, " AND A.STATUS=" + SQL(mCustomerStay.RoomInfo.Status)));
     oCtrl.Helper(oCtrl.Exsit(MCtrl.ByRoomStatusGroup) && oCtrl.Append(ref sql, " AND A.STATUS IN (" + mCustomerStay.RoomInfo.StatusGroup + ")"));
     oCtrl.Helper(oCtrl.Exsit(MCtrl.ByRoomType) && oCtrl.Append(ref sql, " AND A.ROOM_TYPE=" + SQL(mCustomerStay.RoomInfo.RoomType)));
     oCtrl.Helper(oCtrl.Exsit(MCtrl.ByFloorId) && oCtrl.Append(ref sql, " AND B.FLOOR_ID=" + mCustomerStay.RoomInfo.FloorInfo.FloorId));
     oCtrl.Helper(oCtrl.Exsit(MCtrl.ByFloorName) && oCtrl.Append(ref sql, " AND B.FLOOR_NAME=" + SQL(mCustomerStay.RoomInfo.FloorInfo.FloorName)));
     sdr = ExecuteReader(sql);
     List<BasRoomModel> listRoomInfo = new List<BasRoomModel>();
     using (sdr)
     {
         while (sdr.Read())
         {
             BasRoomModel mBasRoomInfo = new BasRoomModel();
             mBasRoomInfo.RoomId = ToInt32(sdr["ROOM_ID"]);
             mBasRoomInfo.MainRoomId = ToInt32(sdr["MAIN_ROOM_ID"]);
             mBasRoomInfo.RoomNo = ToString(sdr["ROOM_NO"]);
             mBasRoomInfo.RoomPhone = ToString(sdr["ROOM_PHONE"]);
             mBasRoomInfo.RoomRate = ToDouble(sdr["ROOM_RATES"]);
             mBasRoomInfo.RoomType = ToChar(sdr["ROOM_TYPE"]);
             mBasRoomInfo.RoomTypeDesc = ToString(sdr["ROOM_TYPE_DESC"]);
             mBasRoomInfo.RoomNotice = ToString(sdr["ROOM_NOTICE"]);
             mBasRoomInfo.Status = ToChar(sdr["STATUS"]);
             mBasRoomInfo.CommonInfo = new CommonModel();
             mBasRoomInfo.CommonInfo.CreateDate = ToDateTime(sdr["CREATE_DATE"]);
             mBasRoomInfo.CommonInfo.CreateUserId = ToInt32(sdr["CREATE_USERID"]);
             mBasRoomInfo.CommonInfo.UpdateDate = ToDateTime(sdr["UPDATE_DATE"]);
             mBasRoomInfo.CommonInfo.UpdateUserId = ToInt32(sdr["UPDATE_USERID"]);
             mBasRoomInfo.FloorInfo = new BasFloorModel();
             mBasRoomInfo.FloorInfo.FloorId = ToInt32(sdr["FLOOR_ID"]);
             mBasRoomInfo.FloorInfo.FloorName = ToString(sdr["FLOOR_NAME"]);
             mBasRoomInfo.FloorInfo.Status = ToChar(sdr["FLOOR_STATUS"]);
             listRoomInfo.Add(mBasRoomInfo);
         }
     }
     return listRoomInfo;
 }
Example #3
0
 public List<CustomerStayModel> GetMainRoomGroup()
 {
     string sql = @"SELECT DISTINCT A.MAIN_ROOM_ID,B.NAME,D.ROOM_NO,B.CUSTOMER_ID
                         FROM CUSTOMER_STAY_INFO A,CUSTOMER_INFO B,CUSTOMER_STAY_HIS C,BAS_ROOM_INFO D
                         WHERE A.STAY_ID=C.STAY_ID AND C.CUSTOMER_ID=B.CUSTOMER_ID
                         AND A.MAIN_ROOM_ID=D.ROOM_ID
                         AND A.STATUS='I'
                         AND C.HIS_STATUS='E'
                         AND C.STAY_TYPE='M'
                         AND MAIN_ROOM_ID>0";
     sdr = ExecuteReader(sql);
     List<CustomerStayModel> listTeamRoom = new List<CustomerStayModel>();
     using (sdr)
     {
         while (sdr.Read())
         {
             CustomerStayModel mCustomerStay = new CustomerStayModel();
             mCustomerStay.MainRoomId = ToInt32(sdr["MAIN_ROOM_ID"]);
             mCustomerStay.RoomInfo.RoomNo = ToString(sdr["ROOM_NO"]);
             mCustomerStay.CustomerList = new List<CustomerModel>();
             CustomerModel mc = new CustomerModel();
             mc.CustomerId = ToInt32(sdr["CUSTOMER_ID"]);
             mc.Name = ToString(sdr["NAME"]);
             mCustomerStay.CustomerList.Add(mc);
             listTeamRoom.Add(mCustomerStay);
         }
     }
     return listTeamRoom;
 }
Example #4
0
 public FormConsumeDetail(CustomerStayModel mCustomerStay)
 {
     InitializeComponent();
     dtmNow = cmn.DateBaseDate;
     this.mCustomerStay = mCustomerStay;
 }
Example #5
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            try
            {
                RoomLogicType eType;
                if (!cmn.CheckEOF(listCustomer))
                {
                    cmn.Show("请先添加宾客信息!");
                    return;
                }
                if (!cmn.Confirm("确定收取押金数为 " + txtCurrentDeposit.Text + "\r支付方式为 " + cboPayType.Text+"\r这将会影响最终的结账方式以及收费金额."))
                {
                    return;
                }
                if (cmn.CheckEOF(listCustomerStay))
                {
                    #region 修改宾客入住信息

                    listCustomerStay[0].Deposit = cmn.CheckIsDouble(txtCurrentDeposit, "押金数");
                    listCustomerStay[0].MainRoomId = listCustomerStay[0].MainRoomId;
                    listCustomerStay[0].Notice = txtNotice.Text;
                    listCustomerStay[0].PayType = cmn.ToChar(cboPayType.SelectedValue);
                    listCustomerStay[0].RoomId = mRoomInfo.RoomId;
                    listCustomerStay[0].RoomRate = cmn.CheckIsDouble(txtCurrentRate, "房价");
                    int nDays = chkHourRoom.Checked ? 1 : cmn.CheckIsInt(txtDay, "入住天数");
                    listCustomerStay[0].Hours = nDays * 24;
                    listCustomerStay[0].RoomStayType = chkHourRoom.Checked ? 'H' : 'D';
                    listCustomerStay[0].CommonInfo.EndDate = hml.GetEndDateByStayDays(listCustomerStay[0].CommonInfo.StartDate, nDays, listSysParameter);
                    listCustomerStay[0].CommonInfo.UpdateUserId = UserInfo.UserId;
                    eType = RoomLogicType.EditRoomInfo;

                    #endregion
                }
                else
                {
                    #region 散客开房

                    CustomerStayModel mCustomerStay = new CustomerStayModel();
                    mCustomerStay.Deposit = cmn.CheckIsDouble(txtCurrentDeposit, "押金数");
                    mCustomerStay.MainRoomId = -1;
                    mCustomerStay.PaidMoney = 0.0;
                    mCustomerStay.Notice = txtNotice.Text;
                    mCustomerStay.PayType = cmn.ToChar(cboPayType.SelectedValue);
                    mCustomerStay.RoomId = mRoomInfo.RoomId;
                    mCustomerStay.RoomRate = cmn.CheckIsDouble(txtCurrentRate, "房价");
                    mCustomerStay.Status = 'I';
                    mCustomerStay.RoomInfo = new BasRoomModel();
                    mCustomerStay.RoomInfo.Status = 'I';
                    mCustomerStay.CommonInfo = new CommonModel();
                    mCustomerStay.CommonInfo.StartDate = cmn.DateBaseDate;
                    int nDays = chkHourRoom.Checked ? 1 : cmn.CheckIsInt(txtDay, "入住天数");
                    mCustomerStay.Hours = nDays * 24;
                    mCustomerStay.RoomStayType = chkHourRoom.Checked ? 'H' : 'D';
                    mCustomerStay.CommonInfo.EndDate = hml.GetEndDateByStayDays(mCustomerStay.CommonInfo.StartDate, nDays, listSysParameter);
                    mCustomerStay.CommonInfo.CreateUserId = UserInfo.UserId;
                    mCustomerStay.CommonInfo.UpdateUserId = UserInfo.UserId;
                    listCustomerStay.Add(mCustomerStay);
                    eType = RoomLogicType.OpenRoom;

                    #endregion
                }
                if (hml.OpendOrUpdateRoom(listCustomerStay, listCustomer, eType))
                {
                    #region 如果有预定,将预定状态改为已入住

                    if (mOrderInfo != null)
                    {
                        OrdersInfo bOrder = new OrdersInfo();
                        mOrderInfo.Status = 'I';
                        oCtrl.Reset();
                        oCtrl.Add(MCtrl.SetOrderStatus);
                        bOrder.UpdateOrderInfo(mOrderInfo, oCtrl);
                    }
                    #endregion

                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
            }
            catch (Exception err)
            {
                cmn.Show(err.Message);
            }
        }
Example #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            CustomerStayInfo bs = new CustomerStayInfo();
            CustomerStayModel mcs = new CustomerStayModel();
            mcs.Status = 'O';
            oCtrl.Reset();
            oCtrl.Add(MCtrl.ByStayStatus);
            List<CustomerStayModel> listC =bs.GetCustomerStayList(mcs, oCtrl);
            foreach (CustomerStayModel m in listC)
            {
                foreach (CustomerModel c in m.CustomerList)
                {
                    if (c.CustomerStayHisInfo.HisStatus == 'E')
                    {
                        c.CustomerStayHisInfo.CommonInfo.EndDate = m.CommonInfo.EndDate;
                        bs.UpdateStayHis(c.CustomerStayHisInfo, new ObjectControls(MCtrl.SetEndDate));
                    }
                }
            }

            bs = new CustomerStayInfo();
            mcs = new CustomerStayModel();
            mcs.Status = 'I';
            oCtrl.Reset();
            oCtrl.Add(MCtrl.ByStayStatus);
            listC = bs.GetCustomerStayList(mcs, oCtrl);
            foreach (CustomerStayModel m in listC)
            {
                foreach (CustomerModel c in m.CustomerList)
                {
                    if (c.CustomerStayHisInfo.HisStatus == 'E')
                    {
                        c.CustomerStayHisInfo.CommonInfo.EndDate = m.CommonInfo.EndDate;
                        bs.UpdateStayHis(c.CustomerStayHisInfo, new ObjectControls(MCtrl.SetEndDate));
                    }
                }
            }
        }
Example #7
0
 /// <summary>
 /// 保存备注信息.如房间已近入住,则备注保存于CUSTOMER_STAY_INFO 的notice,否则保存到BAS_ROOM_INFO 的ROOM_NOTICE栏位
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void pbtnSaveNotice_Click(object sender, EventArgs e)
 {
     if (txtNotice.Tag != null && cmn.Confirm("保存备注?"))
     {
         if (txtNotice.Tag.ToString() == "E")
         {
             BasRoomModel mr = new BasRoomModel();
             mr.RoomId = int.Parse(txtNotice.AccessibleName);
             mr.RoomNotice = txtNotice.Text;
             mr.CommonInfo.UpdateUserId = UserInfo.UserId;
             bRoomInfo.UpdateRoomInfo(mr, new ObjectControls(MCtrl.SetNotice));
         }
         else
         {
             CustomerStayModel mcs = new CustomerStayModel();
             mcs.StayId = int.Parse(txtNotice.Tag.ToString());
             mcs.Notice = txtNotice.Text;
             mcs.CommonInfo.UpdateUserId = UserInfo.UserId;
             bStay.UpdateCustomerStay(mcs, new ObjectControls(MCtrl.SetNotice));
         }
         cmn.Show("保存完毕!");
         ShowRoom(int.Parse(tbcRoomInfo.SelectedTab.Name));
     }
 }
Example #8
0
 private void LoadUIInfo()
 {
     try
     {
         mCustomerStay = hml.GetStayInRoomInfo(mRoomInfo, 'I',"M");
         if (mCustomerStay != null)
         {
             if (mCustomerStay.CommonInfo.EndDate.Date <= cmn.DateBaseDate.Date)
             {
                 throw new Exception("已到达退房日期,请先续住后再换房");
             }
             lblRoomNo.Text = mRoomInfo.RoomNo;
             oCtrl.Reset();
             oCtrl.Add(MCtrl.ByRoomStatus);
             BasRoomModel mRoom = new BasRoomModel();
             mRoom.Status = 'E';
             listRoomInfo = bRoom.GetRoomInfo(mRoom, oCtrl);
             if (cmn.CheckEOF(listRoomInfo))
             {
                 cboNewRoom.DataSource = listRoomInfo;
                 cboNewRoom.DisplayMember = "RoomNo";
                 cboNewRoom.ValueMember = "RoomId";
                 txtRoomRate.Text = listRoomInfo[0].RoomRate.ToString();
             }
         }
         else
         {
             throw new Exception("该房间无入住信息,无法换房");
         }
     }
     catch (Exception err)
     {
         cmn.Show(err.Message);
         this.Close();
     }
 }
Example #9
0
        private void LoadUIInfo()
        {
            try
            {

                List<BasRoomModel> listRoom = new List<BasRoomModel>();
                BasRoomModel mRoom = new BasRoomModel();
                dtmNow = cmn.DateBaseDate;
                mRoom.StatusGroup = "'I','T'";
                IsCountPhone = hml.ToParameter(listSysParameter, "PHONE_JF").Value1.Equals("Y") ? true : false;
                btnPhoneList.Visible = IsCountPhone;
                listCat = bCall.GetPhoneCatList(null, oCtrl.EmptyCtrl);

                listRoom = bRoom.GetRoomInfo(mRoom, new ObjectControls(MCtrl.ByRoomStatusGroup));
                BindCodeInfo(cboPayType, "CUSTOMER_STAY_INFO", "PAY_TYPE");
                char cPayType = 'C';
                if (mRoomInfo.Status == 'I')
                {
                    #region 散客结账
                    mCustomerStay = hml.GetStayInRoomInfo(mRoomInfo, 'I',"");
                    if (mCustomerStay != null)
                    {
                        listCustomerStay.Add(mCustomerStay);
                        lblRoomNo.Text = mRoomInfo.RoomNo;
                        txtStayNo.Text = hml.GetStayNo(mCustomerStay.StayId, listSysParameter);
                        lblMainCustomer.Text = mCustomerStay.CustomerList[0].Name;
                        if (cmn.CheckEOF(mCustomerStay.CustomerList))
                        {
                            if (cmn.FileExsit(cmn.GetImgFilePath(mCustomerStay.CustomerList[0].Picture)))
                            {
                                pbxUserImg.Image = Image.FromFile(cmn.GetImgFilePath(mCustomerStay.CustomerList[0].Picture));
                            }
                            else
                            {
                                pbxUserImg.Image = mCustomerStay.CustomerList[0].Sex == "男" ? Properties.Resources.DefaultMan : Properties.Resources.DefaultWoman;
                            }
                            pbxUserImg.Size = pbxUserImg.Image.Size;
                        }
                        cPayType=mCustomerStay.PayType;
                        txtNotice.Text = mCustomerStay.Notice;
                        var q = listRoom.Where(c => c.RoomId == mRoomInfo.RoomId).First();
                        listRoom.Remove(q);
                        BindTreeViewRoom(tvUsedRooms, listRoom, "入住房间");
                        listRoom = new List<BasRoomModel>();
                        listRoom.Add(mRoomInfo);
                        BindTreeViewRoom(tvPayRooms, listRoom, "结账房间");
                        BindConsumeDetail(listCustomerStay);
                    }
                    else
                    {
                        cmn.Show("该房间不存在消费记录!");
                        this.Dispose();
                        return;
                    }
                    #endregion
                }
                else if (mRoomInfo.Status == 'T')
                {
                    #region 团队结账
                    List<BasRoomModel> listTeamRoom = hml.GetTeamRoomListByRoomId(mRoomInfo, 'I');
                    if (cmn.CheckEOF(listTeamRoom))
                    {
                        BindTreeViewRoom(tvPayRooms, listTeamRoom, "结账房间");
                        foreach (BasRoomModel mTeamRoom in listTeamRoom)
                        {
                            listRoom.Remove(listRoom.Where(c => c.RoomId == mTeamRoom.RoomId).FirstOrDefault());
                        }
                        listCustomerStay = hml.GetStayInRoomInfo(listTeamRoom, 'I',"", true);

                        BindTreeViewRoom(tvUsedRooms, listRoom, "入住房间");
                        BindConsumeDetail(listCustomerStay);

                        lblRoomNo.Text = "结账区域房间";
                        txtStayNo.Text = hml.GetStayNo(mCustomerStay.StayId, listSysParameter);
                        lblMainCustomer.Text = listCustomerStay[0].CustomerList[0].Name;
                        if (cmn.CheckEOF(listCustomerStay[0].CustomerList))
                        {
                            if (cmn.FileExsit(cmn.GetImgFilePath(listCustomerStay[0].CustomerList[0].Picture)))
                            {
                                pbxUserImg.Image = Image.FromFile(cmn.GetImgFilePath(listCustomerStay[0].CustomerList[0].Picture));
                            }
                            else
                            {
                                pbxUserImg.Image = listCustomerStay[0].CustomerList[0].Sex == "男" ? Properties.Resources.DefaultMan : Properties.Resources.DefaultWoman;
                            }
                            pbxUserImg.Size = pbxUserImg.Image.Size;
                        }
                        cPayType = listCustomerStay[0].PayType;
                        txtNotice.Text = listCustomerStay[0].Notice;
                    }
                    #endregion
                }
                else
                {
                    cmn.Show("该房间不存在消费记录!");
                    this.Close();
                }
                cboPayType.SelectedIndex = GetComboxIndexByKey(cboPayType,cPayType);
                CalculateTotal();
                CalculateChange();
            }
            catch (Exception err)
            {
                cmn.Show(err.Message);
            }
        }
Example #10
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;
        }
Example #11
0
 /// <summary>
 /// 根据一个RoomId获取团队所有房间
 /// </summary>
 /// <param name="mRoom"></param>
 /// <returns></returns>
 public List<BasRoomModel> GetTeamRoomListByRoomId(BasRoomModel mRoom,char cStayStatus)
 {
     CustomerStayModel mCustomerStay = new CustomerStayModel();
     mCustomerStay.RoomId = mRoom.RoomId;
     mCustomerStay.Status = cStayStatus;
     ObjectControls oCtrl = new ObjectControls();
     oCtrl.Add(MCtrl.ByStayStatus);
     oCtrl.Add(MCtrl.ByRoomId);
     CustomerStayModel mC = bCustomerStay.GetCustomerStayInfo(mCustomerStay, oCtrl);
     if (mC.MainRoomId > 0)
     {
         oCtrl.Reset();
         oCtrl.Add(MCtrl.ByStayStatus);
         oCtrl.Add(MCtrl.ByMainRoomId);
         return bRoom.GetTeamRoomList(mC, oCtrl);
     }
     else
     {
         return new List<BasRoomModel>();
     }
 }
Example #12
0
        /// <summary>
        /// 获取交接班信息
        /// </summary>
        /// <returns></returns>
        public HandOverModel GetHandOverInfo()
        {
            try
            {
                HandOverInfo bHandOver = new HandOverInfo();
                int nHandOverId = bHandOver.GetHandOverLatestId();
                ObjectControls oCtrl = new ObjectControls();
                List<HandOverModel> listHandOver = new List<HandOverModel>();
                HandOverModel mHandOver = new HandOverModel();
                CustomerStayModel mCustomerStay = new CustomerStayModel();

                if (nHandOverId > 0)
                {
                    mHandOver.HandOverId = nHandOverId;
                    listHandOver = bHandOver.GetHandOverList(mHandOver, new ObjectControls(MCtrl.ByHandOverId));
                    if (Cmn.CheckEOF(listHandOver))
                    {
                        mCustomerStay.CommonInfo.CreateDate = listHandOver[0].CommonInfo.EndDate;
                        mHandOver.CommonInfo.StartDate = listHandOver[0].CommonInfo.EndDate;
                        mHandOver.FromLastMoney = listHandOver[0].ToNextMoney;
                    }
                }
                else
                {
                    mCustomerStay.CommonInfo.CreateDate = DateTime.Parse("2005-01-01");
                    mHandOver.CommonInfo.StartDate = mCustomerStay.CommonInfo.CreateDate;
                    mHandOver.FromLastMoney = 0.0;
                }
                oCtrl.Add(MCtrl.ByCreateDate);
                mCustomerStay.Status = 'I';
                oCtrl.Add(MCtrl.ByStayStatus);
                mHandOver.CurrentDeposit = bCustomerStay.GetHandOverStayInfo(mCustomerStay, oCtrl).CurrentDeposit;
                mCustomerStay.Status = 'O';
                mHandOver.CurrentPaidMoney = bCustomerStay.GetHandOverStayInfo(mCustomerStay, oCtrl).CurrentPaidMoney;
                mHandOver.CommonInfo.EndDate = Cmn.DateBaseDate;
                mHandOver.HandInMoney = 0;
                mHandOver.HandOverMoney = mHandOver.FromLastMoney + mHandOver.CurrentDeposit + mHandOver.CurrentPaidMoney;
                mHandOver.ToNextMoney = mHandOver.HandOverMoney;
                return mHandOver;
            }
            catch (Exception err)
            {
                throw err;
            }
        }
Example #13
0
 /// <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;
 }
Example #14
0
 /// <summary>
 /// 仅获取宾客入住信息
 /// </summary>
 /// <param name="mRoom"></param>
 /// <param name="cStayStatus"></param>
 /// <returns></returns>
 public CustomerStayModel GetCustomerStayInfoByRoom(BasRoomModel mRoom, char cStayStatus)
 {
     CustomerStayModel mStayInfo = new CustomerStayModel();
     ObjectControls oCtrl = new ObjectControls();
     mStayInfo.RoomId = mRoom.RoomId;
     mStayInfo.Status = cStayStatus;
     oCtrl.Add(MCtrl.ByRoomId);
     oCtrl.Add(MCtrl.ByStayStatus);
     return bCustomerStay.GetCustomerStayInfo(mStayInfo, oCtrl);
 }
Example #15
0
        public void UpdateSingleRoomToTeamRoom(CustomerStayModel mCustomerStay,int nMainRoomId,int nTeamMainCustomerId,SysUserInfoModel mUserInfo)
        {
            try
            {
                mCustomerStay.MainRoomId = nMainRoomId;
                bCustomerStay.UpdateCustomerStay(mCustomerStay, new ObjectControls(MCtrl.SetMainRoomId));

                CustomerStayHisModel mHis = new CustomerStayHisModel();
                mHis.StayId = mCustomerStay.StayId;
                if (mCustomerStay.CustomerList[0].CustomerId > 0)
                {
                    if (mCustomerStay.CustomerList.Where(c => c.CustomerId == nTeamMainCustomerId).Count() == 0)
                    {
                        mHis.HisId = mCustomerStay.CustomerList[0].CustomerStayHisInfo.HisId;
                        mHis.StayType = 'S';
                        mHis.CommonInfo = new CommonModel();
                        mHis.CommonInfo.UpdateUserId = mUserInfo.UserId;
                        bCustomerStay.UpdateStayHis(mHis, new ObjectControls(MCtrl.SetHisType));

                        mHis.StayType = 'M';
                        mHis.HisStatus = 'E';
                        mHis.CustomerId = nTeamMainCustomerId;
                        mHis.CommonInfo = new CommonModel();
                        mHis.CommonInfo.CreateUserId = mUserInfo.UserId;
                        mHis.CommonInfo.UpdateUserId = mUserInfo.UserId;
                        bCustomerStay.InsertCustomerStayHis(mHis);
                    }
                }
                else
                {
                    mHis.StayType = 'M';
                    mHis.HisStatus = 'E';
                    mHis.CustomerId = nTeamMainCustomerId;
                    mHis.CommonInfo = new CommonModel();
                    mHis.CommonInfo.CreateUserId = mUserInfo.UserId;
                    mHis.CommonInfo.UpdateUserId = mUserInfo.UserId;
                    bCustomerStay.InsertCustomerStayHis(mHis);
                }
            }
            catch (Exception err)
            {
                throw err;
            }
        }
Example #16
0
        private void LoadInfo()
        {
            BindCodeInfo(cboPayType, "CUSTOMER_STAY_INFO", "PAY_TYPE");
            BindCodeInfo(cboCustomerType, "CUSTOMER_STAY_HIS", "STAY_TYPE");
            cboSex.SelectedIndex = 0;
            lblRoomInfo.Text = mRoomInfo.RoomNo;
            lblRoomType.Text = mRoomInfo.RoomTypeDesc;
            lblRoomRate.Text = mRoomInfo.RoomRate + "元";
            if (!mRoomInfo.Status.Equals('E'))
            {
                CustomerStayModel mCustomerStayInfo = new CustomerStayModel();
                mCustomerStayInfo.RoomId = mRoomInfo.RoomId;
                mCustomerStayInfo.Status = 'I';
                mCustomerStayInfo.CustomerList = new List<CustomerModel>();
                CustomerModel mc = new CustomerModel();
                mc.CustomerStayHisInfo = new CustomerStayHisModel();
                mc.CustomerStayHisInfo.HisStatus = 'E';
                mCustomerStayInfo.CustomerList.Add(mc);
                oCtrl = new ObjectControls();
                oCtrl.Add(MCtrl.ByRoomId);
                oCtrl.Add(MCtrl.ByStayStatus);
                oCtrl.Add(MCtrl.ByHisStatus);
                CustomerStayModel mCustomerStay =bCustomer.GetCustomerStayInfo(mCustomerStayInfo, oCtrl);
                if (mCustomerStay != null)
                {
                    this.Text = "修改登记";
                    listCustomerStay.Add(mCustomerStay);
                    txtDay.Text = (mCustomerStay.Hours / 24).ToString(); //hml.GetCustomerStayDays(mCustomerStay.CommonInfo.StartDate, mCustomerStay.CommonInfo.EndDate, listSysParameter).ToString("0.0"); //listSysParameter.Where(c => c.ParamNo == "DEFAULT_STAY_DAYS").Select(c => c.Value1).First();
                    txtCurrentDeposit.Text = mCustomerStay.Deposit.ToString();
                    txtCurrentRate.Text = mCustomerStay.RoomRate.ToString();
                    txtDiskonRate.Enabled = false;
                    //txtDiskonRate.Text = (mCustomerStay.RoomRate / mCustomerStay.RoomInfo.RoomRate).ToString("0.00");
                    txtCustomerNumber.Text = mCustomerStay.CustomerList.Count.ToString();
                    txtNotice.Text = mCustomerStay.Notice;
                    chkHourRoom.Checked = mCustomerStay.RoomStayType == 'H' ? true : false;
                    cboPayType.SelectedIndex = GetComboxIndexByKey(cboPayType, mCustomerStay.PayType);

                    if (cmn.FileExsit(cmn.GetImgFilePath(mCustomerStay.CustomerList[0].Picture)))
                    {
                        pbxUserImg.Image = Image.FromFile(cmn.GetImgFilePath(mCustomerStay.CustomerList[0].Picture));
                    }
                    listCustomer = mCustomerStay.CustomerList;
                    BindCustomer(listCustomer);
                    return;
                }
            }
            this.Text = "散客开单";

            List<OrderInfoModel> listOrder = hml.GetRoomOrder(mRoomInfo);
            if (cmn.CheckEOF(listOrder))
            {
                FormSelectOrder frmSelectOrder = new FormSelectOrder(listOrder);
                if (frmSelectOrder.ShowDialog() == DialogResult.OK)
                {
                    mOrderInfo = frmSelectOrder.mOrderInfo;
                    if (mOrderInfo != null)
                    {
                        txtCustomerName.Text = mOrderInfo.Name;
                        txtPhone.Text = mOrderInfo.Phone;
                        txtIDCard.Text = mOrderInfo.IdCardNo;
                        txtCurrentRate.Text = mOrderInfo.OrderRoomRate.ToString();
                        txtNotice.Text = mOrderInfo.Notice;
                        btnAddCustomer_Click(null, new EventArgs());
                    }
                }
            }
            txtDay.Text = hml.ToParameter(listSysParameter, "DEFAULT_STAY_DAYS").Value1; //listSysParameter.Where(c => c.ParamNo == "DEFAULT_STAY_DAYS").Select(c => c.Value1).First();
            txtCurrentDeposit.Text = hml.ToParameter(listSysParameter, "DEFAULT_DEPOSIT").Value1;
            txtCurrentRate.Text = txtCurrentRate.Text.Equals("") ? mRoomInfo.RoomRate.ToString() : txtCurrentRate.Text;
            txtDiskonRate.Text = hml.ToParameter(listSysParameter, "DEFAULT_DISKON").Value1;
            txtCustomerNumber.Text = hml.ToParameter(listSysParameter, "DEFAULT_CUSTOMER_NUMBER").Value1;
        }
Example #17
0
 public int InsertCustomerStay(CustomerStayModel mCustomerStay)
 {
     try
     {
         CUSTOMER_STAY_INFO cti = new CUSTOMER_STAY_INFO();
         cti.CREATE_DATE = GetDBTime;
         cti.CREATE_USERID = mCustomerStay.CommonInfo.CreateUserId;
         cti.DEPOSIT = mCustomerStay.Deposit;
         cti.END_DATE = mCustomerStay.CommonInfo.EndDate;
         cti.HOURS = mCustomerStay.Hours;
         cti.MAIN_ROOM_ID = mCustomerStay.MainRoomId;
         cti.NOTICE = mCustomerStay.Notice;
         cti.PAY_TYPE = mCustomerStay.PayType;
         cti.ROOM_ID = mCustomerStay.RoomId;
         cti.ROOM_RATES = mCustomerStay.RoomRate;
         cti.START_DATE = mCustomerStay.CommonInfo.StartDate;
         cti.STATUS = mCustomerStay.Status;
         cti.STAY_NO = mCustomerStay.StayNo;
         cti.PAID_MONEY = mCustomerStay.PaidMoney;
         cti.ROOM_STAY_TYPE = mCustomerStay.RoomStayType;
         cti.UPDATE_DATE = cti.CREATE_DATE;
         cti.UPDATE_USERID = mCustomerStay.CommonInfo.UpdateUserId;
         dc.CUSTOMER_STAY_INFO.InsertOnSubmit(cti);
         dc.SubmitChanges();
         return cti.STAY_ID;
     }
     catch (Exception err)
     {
         throw err;
     }
 }
Example #18
0
        /// <summary>
        /// 计算总费用
        /// </summary>
        /// <param name="mCustomerStay">宾客信息</param>
        /// <param name="listConsumeInfo">费用明细</param>
        /// <param name="listSysParameter">系统参数</param>
        /// <param name="dtNow">当前时间</param>
        /// <param name="mJf">电话号码,入住起始结束时间</param>
        /// <returns></returns>
        public double GetTotalRates(CustomerStayModel mCustomerStay, List<ConsumeDetailModel> listConsumeInfo, List<SysParameterModel> listSysParameter,DateTime dtNow,double dPhoneRate)
        {
            DateTime dtEndDate = dtNow;
            double dTotal = 0.0;

            #region 计算商品费用

            if (Cmn.CheckEOF(listConsumeInfo))
            {
                foreach (ConsumeDetailModel mConsume in listConsumeInfo)
                {
                    dTotal += mConsume.Total;
                }
            }

            #endregion

            #region 计算电话费用

            if (dPhoneRate > 0 && ToParameter(listSysParameter, "PHONE_JF").Value1.Equals("Y"))
            {
                //List<JFModel> listJF = new List<JFModel>();
                //listJF = GetPhoneList(mJf, dtNow);
                dTotal += dPhoneRate;//GetPhoneJFFromWS(listJF, mJf.CatList);
            }
            #endregion

            #region 计算房间费

            if (mCustomerStay.RoomStayType == 'D')
            {
                double dDays = GetCustomerStayDays(mCustomerStay.CommonInfo.StartDate, dtEndDate,dtNow, RoomStayType.Day, listSysParameter);
                dTotal += mCustomerStay.RoomRate * dDays;
            }
            else
            {
                double dHour = GetStayHours(mCustomerStay.CommonInfo.StartDate, dtEndDate, listSysParameter);
                dTotal += mCustomerStay.RoomRate * dHour;
            }

            #endregion

            return dTotal;
        }
Example #19
0
        public int UpdateCustomerStay(CustomerStayModel mCustomerStay, ObjectControls oCtrl)
        {
            string sql = "UPDATE  CUSTOMER_STAY_INFO SET CREATE_DATE=CREATE_DATE";
            oCtrl.Helper(oCtrl.Exsit(MCtrl.SetStayNo) && oCtrl.Append(ref sql, ",STAY_NO=" + SQL(mCustomerStay.StayNo)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.SetRoomId) && oCtrl.Append(ref sql, ",ROOM_ID=" + SQL(mCustomerStay.RoomId)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.SetMainRoomId) && oCtrl.Append(ref sql, ",MAIN_ROOM_ID=" + SQL(mCustomerStay.MainRoomId)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.SetHours) && oCtrl.Append(ref sql, ",HOURS=" + SQL(mCustomerStay.Hours)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.SetRoomStayType) && oCtrl.Append(ref sql, ",ROOM_STAY_TYPE=" + SQL(mCustomerStay.RoomStayType)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.SetStartDate) && oCtrl.Append(ref sql, ",START_DATE=" + SQL(mCustomerStay.CommonInfo.StartDate)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.SetEndDate) && oCtrl.Append(ref sql, ",END_DATE=" + SQL(mCustomerStay.CommonInfo.EndDate)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.SetDeposit) && oCtrl.Append(ref sql, ",DEPOSIT=" + SQL(mCustomerStay.Deposit)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.SetRoomRate) && oCtrl.Append(ref sql, ",ROOM_RATES=" + SQL(mCustomerStay.RoomRate)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.SetTotal) && oCtrl.Append(ref sql, ",TOTAL_MONEY=" + SQL(mCustomerStay.Total)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.SetPayType) && oCtrl.Append(ref sql, ",PAY_TYPE=" + SQL(mCustomerStay.PayType)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.SetCustomerStayStatus) && oCtrl.Append(ref sql, ",STATUS=" + SQL(mCustomerStay.Status)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.SetPaidMoney) && oCtrl.Append(ref sql, ",PAID_MONEY=" + SQL(mCustomerStay.PaidMoney)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.SetNotice) && oCtrl.Append(ref sql, ",NOTICE=" + SQL(mCustomerStay.Notice)));

            sql += ",UPDATE_DATE=" + SQL(GetDBTime);
            sql += ",UPDATE_USERID=" + SQL(mCustomerStay.CommonInfo.UpdateUserId);
            sql += " WHERE STAY_ID=" + mCustomerStay.StayId;
            return ExcuteNonQuery(sql);
        }
Example #20
0
        /// <summary>
        /// 换房逻辑,换房只能从一个已入住房间换到状态为可用的房间.
        /// </summary>
        /// <param name="mCustomerStay">入住信息</param>
        /// <param name="mNewRoomInfo">新房信息</param>
        /// <param name="dNewRoomRate">新房费用</param>
        /// <param name="mUserInfo">系统用户信息</param>
        /// <param name="listSysParameter">系统参数</param>
        public void ChangeRoom(CustomerStayModel mCustomerStay, BasRoomModel mNewRoomInfo,double dNewRoomRate, SysUserInfoModel mUserInfo, List<SysParameterModel> listSysParameter)
        {
            try
            {
                #region 将之前房间费用(光房间费用)加入到消费清单中.

                ConsumeDetailModel mConsume = new ConsumeDetailModel();
                BasGoodsModel mGoods = new BasGoodsModel();
                mGoods.Type = 'R';
                List<BasGoodsModel> listGoods = bGoods.GetGoodsInfo(mGoods, new ObjectControls(MCtrl.ByGoodsType));
                if (Cmn.CheckEOF(listGoods))
                {
                    mConsume.GoodsId = listGoods[0].GoodsId;
                }
                else
                {
                    throw new Exception("未定义类型的R的商品,该类型为房间费.");
                }
                mConsume.StayId = mCustomerStay.StayId;
                mConsume.UnitPrice = mCustomerStay.RoomRate;
                RoomStayType eRst = mCustomerStay.RoomStayType == 'D' ? RoomStayType.Day : RoomStayType.Hour;
                DateTime dtNow = Cmn.DateBaseDate;
                mConsume.Number = GetCustomerStayDays(mCustomerStay.CommonInfo.StartDate, dtNow,dtNow, eRst, listSysParameter);
                mConsume.Total = GetTotalRates(mCustomerStay, null, listSysParameter, dtNow, 0.0);
                mConsume.CommonInfo = new CommonModel();
                mConsume.CommonInfo.CreateDate = mCustomerStay.CommonInfo.StartDate;
                mConsume.CommonInfo.CreateUserId = mUserInfo.UserId;
                mConsume.CommonInfo.UpdateUserId = mUserInfo.UserId;
                bConsume.InsertConsumeDetail(mConsume);

                #endregion

                #region 是否团队房间
                if (mCustomerStay.MainRoomId == mCustomerStay.RoomId)
                {
                    if (Cmn.Confirm(string.Format("{0}为主房间,变更后{1}将成为主房间,是否继续?", mCustomerStay.RoomInfo.RoomNo, mNewRoomInfo.RoomNo)))
                    {
                        #region 将团队房间的MainRoomId变为新ID
                        List<BasRoomModel> listTeamRoom = GetTeamRoomListByRoomId(mCustomerStay.RoomInfo, 'I');
                        if (Cmn.CheckEOF(listTeamRoom))
                        {
                            ObjectControls oCtrl = new ObjectControls();
                            oCtrl.Add(MCtrl.SetMainRoomId);
                            foreach (BasRoomModel mRoom in listTeamRoom)
                            {
                                CustomerStayModel mCs = new CustomerStayModel();
                                mCs.RoomId = mRoom.RoomId;
                                mCs.Status = 'I';
                                ObjectControls oc = new ObjectControls();
                                oc.Add(MCtrl.ByStayStatus);
                                oc.Add(MCtrl.ByRoomId);
                                mCs = bCustomerStay.GetCustomerStayInfo(mCs, oc);
                                if (mCs != null)
                                {
                                    mCs.MainRoomId = mNewRoomInfo.RoomId;
                                    bCustomerStay.UpdateCustomerStay(mCs, oCtrl);
                                }
                            }
                        }
                        #endregion
                    }
                }
                #endregion

                #region 将原来房间置为清理,将新房间设置为入住

                ObjectControls oCtrlMain = new ObjectControls();
                oCtrlMain.Add(MCtrl.SetRoomId);
                oCtrlMain.Add(MCtrl.SetStartDate);
                oCtrlMain.Add(MCtrl.SetHours);
                oCtrlMain.Add(MCtrl.SetRoomRate);
                mCustomerStay.RoomId = mNewRoomInfo.RoomId;
                mCustomerStay.CommonInfo.StartDate = Cmn.DateBaseDate;
                double dDays = GetCustomerStayDays(mCustomerStay.CommonInfo.StartDate, mCustomerStay.CommonInfo.EndDate,mCustomerStay.CommonInfo.StartDate, eRst, listSysParameter);

                mCustomerStay.Hours = eRst == RoomStayType.Day ? Convert.ToInt32(dDays * 24) : Convert.ToInt32(dDays);
                mCustomerStay.RoomRate = dNewRoomRate;
                bCustomerStay.UpdateCustomerStay(mCustomerStay, oCtrlMain);

                mNewRoomInfo.Status = mCustomerStay.RoomInfo.Status;
                UpdateRoomStatusByRoomId(mNewRoomInfo, mUserInfo);

                mCustomerStay.RoomInfo.Status = 'C';
                UpdateRoomStatusByRoomId(mCustomerStay.RoomInfo, mUserInfo);

                #endregion
            }
            catch (Exception err)
            {
                throw err;
            }
        }
Example #21
0
 private List<CustomerStayModel> GetSelectedNodesConsume(TreeNode tn, bool IsContainCurrentNode)
 {
     List<CustomerStayModel> listTmp = new List<CustomerStayModel>();
     CustomerStayModel mSelectedRoomConsume = new CustomerStayModel();
     if (IsContainCurrentNode)
     {
         mSelectedRoomConsume = hml.GetStayInRoomInfo(new BasRoomModel(int.Parse(tn.Name)), 'I', "");
         if (mSelectedRoomConsume != null)
         {
             listTmp.Add(mSelectedRoomConsume);
         }
     }
     foreach (TreeNode tnC in tn.Nodes)
     {
         if (tnC.Nodes.Count > 0)
         {
             foreach (TreeNode tnC1 in tnC.Nodes)
             {
                 mSelectedRoomConsume = hml.GetStayInRoomInfo(new BasRoomModel(int.Parse(tnC1.Name)), 'I', "");
                 if (mSelectedRoomConsume != null)
                 {
                     listTmp.Add(mSelectedRoomConsume);
                 }
             }
         }
         mSelectedRoomConsume = hml.GetStayInRoomInfo(new BasRoomModel(int.Parse(tnC.Name)), 'I', "");
         if (mSelectedRoomConsume != null)
         {
             listTmp.Add(mSelectedRoomConsume);
         }
     }
     return listTmp;
 }
Example #22
0
        /// <summary>
        /// 更新团体房间的MainId,用于将团体房变为散客房
        /// </summary>
        /// <param name="mCustomerStay"></param>
        /// <returns></returns>
        public bool UpdateCustomerStayMainRoomId(CustomerStayModel mCustomerStay)
        {
            try
            {
                ObjectControls oCtrl = new ObjectControls();
                oCtrl.Add(MCtrl.ByStayStatus);
                oCtrl.Add(MCtrl.ByMainRoomId);
                //获取该房所在的团体所有房间
                List<BasRoomModel> listTeamRoom = bRoom.GetTeamRoomList(mCustomerStay, oCtrl);
                //是否有其他房间可以作为主房间
                var query = listTeamRoom.Where(c => c.RoomId != mCustomerStay.RoomId);
                if (query.Count() > 0)
                {
                    if (Cmn.Confirm(string.Format("房间{0}是主房间,变为散客房之后,团队的主房间将变为{1},继续?", mCustomerStay.RoomInfo.RoomNo, query.First().RoomNo)))
                    {
                        List<CustomerStayModel> listTeamCustomer = new List<CustomerStayModel>();
                        listTeamCustomer = GetStayInRoomInfo(listTeamRoom, 'I',"M", false);

                        int nMainRoomId = query.First().RoomId;
                        foreach (CustomerStayModel mcs in listTeamCustomer)
                        {
                            if (mcs.RoomId == mCustomerStay.RoomId)
                            {
                                mcs.MainRoomId = -1; ;
                            }
                            else
                            {
                                mcs.MainRoomId = nMainRoomId;
                            }
                            bCustomerStay.UpdateCustomerStay(mcs, new ObjectControls(MCtrl.SetMainRoomId));
                        }
                        return true;
                    }
                }
                else
                {
                    throw new Exception("无主房间可供接替,无法变更为散客房!");
                }
                return false;
            }
            catch (Exception err)
            {
                throw err;
            }
        }
Example #23
0
 private void pbxAdd_Click(object sender, EventArgs e)
 {
     if (tvUsedRooms.SelectedNode == null)
     {
         return;
     }
     if (tvUsedRooms.SelectedNode.Level > 1)
     {
         MessageBox.Show("团队房间不能单独结账");
         return;
     }
     if (tvUsedRooms.SelectedNode.Level == 1)
     {
         TreeNode tn = new TreeNode();
         tn = (TreeNode)tvUsedRooms.SelectedNode.Clone();
         if (!tvPayRooms.Nodes[0].Nodes.Contains(tn))
         {
             tvPayRooms.Nodes[0].Nodes.Add(tn);
             tvUsedRooms.SelectedNode.Remove();
             CustomerStayModel mSelectedRoomConsume = new CustomerStayModel();
             mSelectedRoomConsume = hml.GetStayInRoomInfo(new BasRoomModel(int.Parse(tn.Name)), 'I', "");
             if (listCustomerStay.Where(c => c.RoomId == int.Parse(tn.Name)).Count() == 0)
             {
                 listCustomerStay.Add(mSelectedRoomConsume);
             }
             foreach (TreeNode tn1 in tn.Nodes)
             {
                 mSelectedRoomConsume = hml.GetStayInRoomInfo(new BasRoomModel(int.Parse(tn1.Name)), 'I', "");
                 if (listCustomerStay.Where(c => c.RoomId == int.Parse(tn1.Name)).Count() == 0)
                 {
                     listCustomerStay.Add(mSelectedRoomConsume);
                 }
             }
             BindConsumeDetail(listCustomerStay);
             CalculateTotal();
         }
     }
 }
Example #24
0
 public int DeleteCustomerStay(CustomerStayModel mCustomerStay)
 {
     string sql = "DELETE FROM CUSTOMER_STAY_INFO WHERE STAY_ID=" + mCustomerStay.StayId;
     return ExcuteNonQuery(sql);
 }
Example #25
0
 /// <summary>
 /// 获取电话清单
 /// </summary>
 /// <param name="mcs"></param>
 /// <param name="IsCountJF"></param>
 private void GetCustomerStayJF(CustomerStayModel mcs,bool IsCountJF)
 {
     if (IsCountPhone)
     {
         JFModel mJf = new JFModel();
         mJf.CommonInfo.StartDate = mcs.CommonInfo.StartDate;
         mJf.CommonInfo.EndDate = cmn.DateBaseDate;
         mJf.PhoneNoGroup = cmn.MakeGroup(mcs.RoomInfo.RoomPhone);
         mJf.CatList = listCat;
         listJf = hml.GetPhoneList(mJf, mJf.CommonInfo.EndDate);
     }
 }
Example #26
0
 public int UpdateCustomerStay(CustomerStayModel mCustomerStay, ObjectControls oCtrl)
 {
     return dCustomerStay.UpdateCustomerStay(mCustomerStay, oCtrl);
 }
Example #27
0
 private void FormConsumeDetail_Load(object sender, EventArgs e)
 {
     listCat = bCall.GetPhoneCatList(null, oCtrl.EmptyCtrl);
     mCustomerStay = hml.GetStayInRoomInfo(this.mCustomerStay.RoomInfo, 'O', "M");
     if (mCustomerStay != null)
     {
         listCustomerStay.Add(mCustomerStay);
         BindConsumeDetail(listCustomerStay);
     }
 }
Example #28
0
        public HandOverModel GetHandOverStayInfo(CustomerStayModel mCustomerStay, ObjectControls oCtrl)
        {
            string sql = "SELECT ";
            if (mCustomerStay.Status == 'I')
            {
                sql += "ISNULL(SUM(A.DEPOSIT),0) MONEY";
            }
            else
            {
                sql += "ISNULL(SUM(A.PAID_MONEY),0) MONEY";
            }
            sql += " FROM CUSTOMER_STAY_INFO A WHERE 1=1";
            oCtrl.Helper(oCtrl.Exsit(MCtrl.ByStayStatus) && oCtrl.Append(ref sql, " AND A.STATUS=" + SQL(mCustomerStay.Status)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.ByCreateDate) && oCtrl.Append(ref sql, " AND A.CREATE_DATE >" + SQL(mCustomerStay.CommonInfo.CreateDate)));

            sdr = ExecuteReader(sql);
            using (sdr)
            {
                HandOverModel mHandOver = new HandOverModel();

                while (sdr.Read())
                {
                    if (mCustomerStay.Status == 'I')
                    {
                        mHandOver.CurrentDeposit = ToDouble(sdr["MONEY"]);
                    }
                    else
                    {
                        mHandOver.CurrentPaidMoney = ToDouble(sdr["MONEY"]);
                    }
                }
                return mHandOver;
            }
        }
Example #29
0
        public CustomerStayModel GetCustomerStayInfo(CustomerStayModel mCustomerStay, ObjectControls oCtrl)
        {
            string sql = @"SELECT A.STAY_ID,A.STAY_NO, A.ROOM_ID, A.MAIN_ROOM_ID, A.ROOM_STAY_TYPE,
                      A.START_DATE, A.END_DATE,A.HOURS, A.DEPOSIT, A.ROOM_RATES AS CURRENT_RATE,A.PAID_MONEY, A.PAY_TYPE,A.TOTAL_MONEY, A.STATUS,
                      A.NOTICE, A.CREATE_DATE, A.CREATE_USERID,F.USER_NAME AS CREATE_USER_NAME,G.USER_NAME AS UPDATE_USER_NAME, A.UPDATE_DATE,
                      A.UPDATE_USERID, B.CUSTOMER_ID, B.ID_CARD, B.NAME, B.SEX, B.NATION,
                      B.BIRTHDAY, B.ADDRESS, B.COMPANY, B.PHONE, B.PICTURE, B.TYPE, E.STAY_TYPE,E.HIS_STATUS,E.HIS_ID,
                        E.START_TIME,E.END_TIME,
                      C.ROOM_NO, C.ROOM_TYPE, C.ROOM_RATES AS DEFAULT_RATE, C.ROOM_NOTICE,
                      C.ROOM_PHONE, C.STATUS AS ROOM_STATUS, C.FLOOR_ID,D.FLOOR_NAME
                     FROM CUSTOMER_STAY_INFO AS A INNER JOIN
                      CUSTOMER_STAY_HIS E ON A.STAY_ID =E.STAY_ID";
            oCtrl.Helper(oCtrl.Exsit(MCtrl.ByStayType) && oCtrl.Append(ref sql, " AND E.STAY_TYPE=" + SQL(mCustomerStay.CustomerList[0].CustomerStayHisInfo.StayType)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.ByHisStatus) && oCtrl.Append(ref sql, " AND E.HIS_STATUS=" + SQL(mCustomerStay.CustomerList[0].CustomerStayHisInfo.HisStatus)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.ByHisStatusNotEqual) && oCtrl.Append(ref sql, " AND E.HIS_STATUS !=" + SQL(mCustomerStay.CustomerList[0].CustomerStayHisInfo.HisStatus)));

            oCtrl.Helper(oCtrl.Exsit(MCtrl.ByHisStartTime) && oCtrl.Append(ref sql, " AND E.START_TIME BETWEEN " + SQL(mCustomerStay.CustomerList[0].CustomerStayHisInfo.CommonInfo.StartDate) + " AND " + SQL(mCustomerStay.CustomerList[0].CustomerStayHisInfo.CommonInfo.EndDate)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.ByHisEndTime) && oCtrl.Append(ref sql, " AND E.END_TIME BETWEEN " + SQL(mCustomerStay.CustomerList[0].CustomerStayHisInfo.CommonInfo.StartDate) + " AND " + SQL(mCustomerStay.CustomerList[0].CustomerStayHisInfo.CommonInfo.EndDate)));

            oCtrl.Helper(oCtrl.Exsit(MCtrl.ByHisStartOrEndTime) && oCtrl.Append(ref sql, " AND (E.START_TIME BETWEEN " + SQL(mCustomerStay.CustomerList[0].CustomerStayHisInfo.CommonInfo.StartDate)
                + " AND " + SQL(mCustomerStay.CustomerList[0].CustomerStayHisInfo.CommonInfo.EndDate)
                + " OR E.END_TIME BETWEEN " + SQL(mCustomerStay.CustomerList[0].CustomerStayHisInfo.CommonInfo.StartDate)
                + " AND " + SQL(mCustomerStay.CustomerList[0].CustomerStayHisInfo.CommonInfo.EndDate) + ")"));
            sql += @" INNER JOIN
                      CUSTOMER_INFO AS B ON E.CUSTOMER_ID = B.CUSTOMER_ID ";
            oCtrl.Helper(oCtrl.Exsit(MCtrl.ByName) && oCtrl.Append(ref sql, " AND B.NAME=" + SQL(mCustomerStay.CustomerList[0].Name)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.ByPhone) && oCtrl.Append(ref sql, " AND B.PHONE=" + SQL(mCustomerStay.CustomerList[0].Phone)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.ByCustomerType) && oCtrl.Append(ref sql, " AND B.TYPE=" + SQL(mCustomerStay.CustomerList[0].Type)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.ByCustomerId) && oCtrl.Append(ref sql, " AND B.CUSTOMER_ID=" + mCustomerStay.CustomerList[0].CustomerId));
            sql+=@" INNER JOIN
                      BAS_ROOM_INFO AS C ON A.ROOM_ID = C.ROOM_ID INNER JOIN
                       SYS_USER_INFO AS F ON A.CREATE_USERID = F.USER_ID INNER JOIN
                    SYS_USER_INFO AS G ON A.UPDATE_USERID = G.USER_ID INNER JOIN
                      BAS_FLOOR_INFO AS D ON C.FLOOR_ID = D.FLOOR_ID";
            sql += " WHERE 1=1";
            oCtrl.Helper(oCtrl.Exsit(MCtrl.ByRoomId) &&  oCtrl.Append(ref sql, " AND A.ROOM_ID=" + mCustomerStay.RoomId));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.ByFloorId) &&  oCtrl.Append(ref sql, " AND D.FLOOR_ID=" + mCustomerStay.RoomInfo.FloorInfo.FloorId));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.ByRoomNo) &&  oCtrl.Append(ref sql, " AND C.ROOM_NO=" + SQL(mCustomerStay.RoomInfo.RoomNo)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.ByStartDate) &&  oCtrl.Append(ref sql, " AND A.START_DATE=" + SQL(mCustomerStay.CommonInfo.StartDate)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.ByEndDate)&& oCtrl.Append(ref sql, " AND A.END_DATE=" + SQL(mCustomerStay.CommonInfo.EndDate)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.ByStayStatus) &&  oCtrl.Append(ref sql, " AND A.STATUS=" + SQL(mCustomerStay.Status)));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.ByRoomStayType) && oCtrl.Append(ref sql, " AND A.ROOM_STAY_TYPE=" + mCustomerStay.RoomStayType));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.ByStayNo) && oCtrl.Append(ref sql, " AND A.STAY_NO=" + mCustomerStay.StayNo));
            oCtrl.Helper(oCtrl.Exsit(MCtrl.ByStayId) &&  oCtrl.Append(ref sql, " AND A.STAY_ID=" + mCustomerStay.StayId));

            sdr = ExecuteReader(sql);

            using (sdr)
            {
                if (!sdr.HasRows)
                {
                    return null;
                }
                CustomerStayModel mCustomerStayInfo = new CustomerStayModel();
                mCustomerStayInfo.CustomerList = new List<CustomerModel>();
                while(sdr.Read())
                {
                    mCustomerStayInfo.CommonInfo = new CommonModel();
                    mCustomerStayInfo.StayNo = ToString(sdr["STAY_NO"]);
                    mCustomerStayInfo.StayId = ToInt32(sdr["STAY_ID"]);
                    mCustomerStayInfo.RoomId = ToInt32(sdr["ROOM_ID"]);
                    mCustomerStayInfo.MainRoomId = ToInt32(sdr["MAIN_ROOM_ID"]);
                    mCustomerStayInfo.CommonInfo.StartDate = ToDateTime(sdr["START_DATE"]);
                    mCustomerStayInfo.CommonInfo.EndDate = ToDateTime(sdr["END_DATE"]);
                    mCustomerStayInfo.Deposit = ToDouble(sdr["DEPOSIT"]);
                    mCustomerStayInfo.RoomRate = ToInt32(sdr["CURRENT_RATE"]);
                    mCustomerStayInfo.Total = ToDouble(sdr["TOTAL_MONEY"]);
                    mCustomerStayInfo.PayType = ToChar(sdr["PAY_TYPE"]);
                    mCustomerStayInfo.Status = ToChar(sdr["STATUS"]);
                    mCustomerStayInfo.Notice = ToString(sdr["NOTICE"]);
                    mCustomerStayInfo.Hours = ToInt32(sdr["HOURS"]);
                    mCustomerStayInfo.RoomStayType = ToChar(sdr["ROOM_STAY_TYPE"]);
                    mCustomerStayInfo.PaidMoney = ToDouble(sdr["PAID_MONEY"]);
                    mCustomerStayInfo.CommonInfo.CreateDate = ToDateTime(sdr["CREATE_DATE"]);
                    mCustomerStayInfo.CommonInfo.CreateUserId = ToInt32(sdr["CREATE_USERID"]);
                    mCustomerStayInfo.CommonInfo.CreateUserName = ToString(sdr["CREATE_USER_NAME"]);
                    mCustomerStayInfo.CommonInfo.UpdateDate = ToDateTime(sdr["UPDATE_DATE"]);
                    mCustomerStayInfo.CommonInfo.UpdateUserId = ToInt32(sdr["UPDATE_USERID"]);
                    mCustomerStayInfo.CommonInfo.UpateUserName = ToString(sdr["UPDATE_USER_NAME"]);

                    CustomerModel mCustomerInfo = new CustomerModel();
                    mCustomerInfo.CustomerId = ToInt32(sdr["CUSTOMER_ID"]);
                    mCustomerInfo.IdCardNo = ToString(sdr["ID_CARD"]);
                    mCustomerInfo.Name = ToString(sdr["NAME"]);
                    mCustomerInfo.Nation = ToString(sdr["NATION"]);
                    mCustomerInfo.Phone = ToString(sdr["PHONE"]);
                    mCustomerInfo.Picture = ToString(sdr["PICTURE"]);
                    mCustomerInfo.Type = ToChar(sdr["TYPE"]);
                    mCustomerInfo.Sex = ToString(sdr["SEX"]);
                    mCustomerInfo.Birthday = ToDateTime(sdr["BIRTHDAY"]);
                    mCustomerInfo.Address = ToString(sdr["ADDRESS"]);
                    mCustomerInfo.Company = ToString(sdr["COMPANY"]);

                    mCustomerInfo.CustomerStayHisInfo = new CustomerStayHisModel();
                    mCustomerInfo.CustomerStayHisInfo.HisId = ToInt32(sdr["HIS_ID"]);
                    mCustomerInfo.CustomerStayHisInfo.StayId = ToInt32(sdr["STAY_ID"]);
                    mCustomerInfo.CustomerStayHisInfo.CustomerId = ToInt32(sdr["CUSTOMER_ID"]);
                    mCustomerInfo.CustomerStayHisInfo.StayType = ToChar(sdr["STAY_TYPE"]);
                    mCustomerInfo.CustomerStayHisInfo.HisStatus = ToChar(sdr["HIS_STATUS"]);
                    mCustomerInfo.CustomerStayHisInfo.CommonInfo.StartDate = ToDateTime(sdr["START_TIME"]);
                    mCustomerInfo.CustomerStayHisInfo.CommonInfo.EndDate = ToDateTime(sdr["END_TIME"]);
                    mCustomerInfo.CommonInfo = new CommonModel();
                    mCustomerStayInfo.CustomerList.Add(mCustomerInfo);

                    mCustomerStayInfo.RoomInfo = new BasRoomModel();
                    mCustomerStayInfo.RoomInfo.RoomId = ToInt32(sdr["ROOM_ID"]);
                    mCustomerStayInfo.RoomInfo.RoomNo = ToString(sdr["ROOM_NO"]);
                    mCustomerStayInfo.RoomInfo.RoomType = ToChar(sdr["ROOM_TYPE"]);
                    mCustomerStayInfo.RoomInfo.RoomRate = ToDouble(sdr["DEFAULT_RATE"]);
                    mCustomerStayInfo.RoomInfo.RoomPhone = ToString(sdr["ROOM_PHONE"]);
                    mCustomerStayInfo.RoomInfo.Status = ToChar(sdr["ROOM_STATUS"]);
                    mCustomerStayInfo.RoomInfo.RoomNotice = ToString(sdr["ROOM_NOTICE"]);
                    mCustomerStayInfo.RoomInfo.FloorInfo = new BasFloorModel();
                    mCustomerStayInfo.RoomInfo.FloorInfo.FloorId = ToInt32(sdr["FLOOR_ID"]);
                    mCustomerStayInfo.RoomInfo.FloorInfo.FloorName = ToString(sdr["FLOOR_NAME"]);
                }
                return mCustomerStayInfo;
            }
        }
Example #30
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            try
            {
                if (!cmn.CheckEOF(listSelectedRoom))
                {
                    throw new Exception("请选择房间");
                }
                if (string.IsNullOrEmpty(txtCustomerName.Text.Trim()))
                {
                    throw new Exception("请输入主客姓名");
                }
                if (string.IsNullOrEmpty(txtIDCard.Text.Trim()))
                {
                    throw new Exception("请输入证件号码");
                }
                if (string.IsNullOrEmpty(txtStayDays.Text.Trim()))
                {
                    throw new Exception("请输入预住天数");
                }
                if (string.IsNullOrEmpty(txtDeposit.Text.Trim()))
                {
                    throw new Exception("请输入押金数");
                }
                int nRoomCount = listSelectedRoom.Count;
                if (nRoomCount < 2)
                {
                    throw new Exception("团队房间数不能小于2间,否则请使用散客开单功能.");
                }
                double dDeposit = cmn.CheckIsDouble(txtDeposit, "押金");
                int nMainRoomId = int.Parse(cboMainRoom.SelectedValue.ToString());
                List<CustomerStayModel> listCustomerStay = new List<CustomerStayModel>();
               double dEachDeposit=0.0;
               if (chkAvgDeposit.Checked)
               {
                   dEachDeposit = (dDeposit - dDeposit % listSelectedRoom.Count) / nRoomCount;
               }
               else
               {
                   dEachDeposit = dDeposit;
               }

               for (int i = 0; i < nRoomCount; i++)
                {
                    CustomerStayModel mTeamCustomerStay = new CustomerStayModel();
                    if (chkAvgDeposit.Checked)
                    {
                        mTeamCustomerStay.Deposit = i == nRoomCount - 1 ? dEachDeposit + dDeposit % nRoomCount : dEachDeposit;
                    }
                    else
                    {
                        mTeamCustomerStay.Deposit = listSelectedRoom[i].RoomId == nMainRoomId ? dEachDeposit : 0.0;
                    }
                    mTeamCustomerStay.Hours = cmn.CheckIsInt(txtStayDays, "入住天数") * 24;
                    mTeamCustomerStay.MainRoomId = nMainRoomId;
                    mTeamCustomerStay.Notice = txtNotice.Text;
                    mTeamCustomerStay.PayType = cmn.ToChar(cboPayType.SelectedValue);
                    mTeamCustomerStay.RoomStayType = 'D';
                    mTeamCustomerStay.Status = 'I';
                    mTeamCustomerStay.CommonInfo = new CommonModel();
                    mTeamCustomerStay.CommonInfo.CreateUserId = UserInfo.UserId;
                    mTeamCustomerStay.CommonInfo.UpdateUserId = UserInfo.UserId;
                    mTeamCustomerStay.CommonInfo.StartDate = cmn.DateBaseDate;
                    mTeamCustomerStay.CommonInfo.EndDate = hml.GetEndDateByStayDays(mTeamCustomerStay.CommonInfo.StartDate, cmn.CheckIsInt(txtStayDays, "入住天数"), listSysParameter);
                    mTeamCustomerStay.RoomRate = listSelectedRoom[i].RoomRate * dDiskon;
                    mTeamCustomerStay.RoomId = listSelectedRoom[i].RoomId;
                    mTeamCustomerStay.RoomInfo = new BasRoomModel();
                    mTeamCustomerStay.RoomInfo.Status = 'T';

                    mTeamCustomerStay.CustomerList = new List<CustomerModel>();
                    //CustomerModel mCustomer = new CustomerModel();
                    mCustomer.Name = txtCustomerName.Text;
                    mCustomer.IdCardNo = txtIDCard.Text;
                    mCustomer.Sex = cboSex.SelectedItem.ToString();
                    mCustomer.Phone = txtPhone.Text;
                    mCustomer.Company = txtCompany.Text;
                    mCustomer.Address = txtAddress.Text;
                    if (pbxUserImg.Image != null)
                    {
                        mCustomer.Picture = cmn.SaveImage(pbxUserImg.Image, cmn.DateBaseDate.ToString("yyyyMMddHHmmss"), "CARD_IMG");
                    }
                    mCustomer.CommonInfo = mTeamCustomerStay.CommonInfo;
                    mCustomer.CustomerStayHisInfo = new CustomerStayHisModel();
                    mCustomer.CustomerStayHisInfo.HisStatus = 'E';
                    mCustomer.CustomerStayHisInfo.StayType = 'M';
                    mCustomer.CustomerStayHisInfo.CommonInfo = mTeamCustomerStay.CommonInfo;
                    mTeamCustomerStay.CustomerList.Add(mCustomer);
                    listCustomerStay.Add(mTeamCustomerStay);
                }
                if (hml.OpendOrUpdateRoom(listCustomerStay, listCustomerStay[0].CustomerList, RoomLogicType.OpenRoom))
                {
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
            }
            catch (Exception err)
            {
                lblMsg.Text = err.Message;
            }
        }