Exemple #1
0
        private void pbtnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                CustomerStayModel mCustomerStay = new CustomerStayModel();
                mCustomerStay.CommonInfo.StartDate = GetDateTimePickValue(dtpStart, cboHourS);
                mCustomerStay.CommonInfo.EndDate   = GetDateTimePickValue(dtpEnd, cboHourE);
                mCustomerStay.Status = 'O';
                ObjectControls oCtrl = new ObjectControls();

                mCustomerStay.CustomerList = new List <CustomerModel>();
                CustomerModel mc = new CustomerModel();
                mc.CustomerStayHisInfo = new CustomerStayHisModel();
                //mc.CustomerStayHisInfo.StayType = 'M';
                mc.CustomerStayHisInfo.HisStatus = 'O';//取离店宾客入住历史记录.
                mCustomerStay.CustomerList.Add(mc);

                oCtrl.Add(MCtrl.ByStayStatus);
                oCtrl.Add(MCtrl.ByHisStatus);
                oCtrl.Add(MCtrl.ByUpdateDate);
                listCustomerStay = bCustomerStay.GetCustomerStayList(mCustomerStay, oCtrl);
                BindDgv(listCustomerStay);
            }
            catch (Exception err)
            {
                cmn.Show(err.Message);
            }
        }
Exemple #2
0
        private void pbtnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                CustomerStayModel mCustomerStay = new CustomerStayModel();
                oCtrl.Reset();
                mCustomerStay.ConSumeDetailList = new List <ConsumeDetailModel>();
                CustomerModel mCustomer = new CustomerModel();
                mCustomer.Name = txtCondition.Text;


                mCustomerStay.RoomInfo        = new BasRoomModel();
                mCustomerStay.RoomInfo.RoomNo = txtCondition.Text;

                if (!string.IsNullOrEmpty(txtCondition.Text))
                {
                    oCtrl.Add(MCtrl.ByNPR);
                }
                if (cboStayStaus.SelectedIndex != 0)//如果选择在住或者离店
                {
                    //mCustomerStay.Status = cmn.ToChar(cboStayStaus.SelectedValue);
                    mCustomer.CustomerStayHisInfo.HisStatus = cmn.ToChar(cboStayStaus.SelectedValue) == 'I' ? 'E' : 'O';
                    oCtrl.Add(MCtrl.ByHisStatus);
                    //oCtrl.Add(MCtrl.ByStayStatus);
                }
                else//如果选择所有,则查询his中状态不为D的宾客.E为在住,O为离店.D为删除的用户.没有意义.
                {
                    //mCustomerStay.Status = cmn.ToChar(cboStayStaus.SelectedValue);
                    mCustomer.CustomerStayHisInfo.HisStatus = 'D';
                    oCtrl.Add(MCtrl.ByHisStatusNotEqual);
                }
                if (chkByDateTime.Checked)
                {
                    mCustomer.CustomerStayHisInfo.CommonInfo.StartDate = GetDateTimePickValue(dtpStart, cboHourS);
                    mCustomer.CustomerStayHisInfo.CommonInfo.EndDate   = GetDateTimePickValue(dtpEnd, cboHourE);
                    if (mCustomer.CustomerStayHisInfo.HisStatus == 'E')
                    {
                        oCtrl.Add(MCtrl.ByHisStartTime);
                    }
                    else if (mCustomer.CustomerStayHisInfo.HisStatus == 'O')
                    {
                        oCtrl.Add(MCtrl.ByHisEndTime);
                    }
                    else
                    {
                        oCtrl.Add(MCtrl.ByHisStartOrEndTime);
                    }
                }
                mCustomerStay.CustomerList.Add(mCustomer);
                List <CustomerStayModel> listCustomerStay = bCustomerStay.GetCustomerStayList(mCustomerStay, oCtrl);
                BindDgv(listCustomerStay);
            }
            catch (Exception err)
            {
                tslblMsg.Text = err.Message;
            }
        }
Exemple #3
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));
                    }
                }
            }
        }