Exemple #1
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;
        }
Exemple #2
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;
        }