private void btnCheckIn_Click(object sender, EventArgs e)
        {
            if (CheckInupt())
            {
                #region 获取添加消费信息所需的信息
                //Spend s = new Spend();
                //s.RoomNo = txtRoomNo.Text;
                //s.CustoNo = txtCustoNo.Text;
                //s.SpendName = "住房";
                //s.SpendAmount = Convert.ToInt32(txtCheckNum.Text);
                //s.SpendPrice = Convert.ToDecimal(txtMoney.Text);
                //s.SpendMoney = Convert.ToDecimal(Convert.ToDouble(txtMoney.Text));
                //s.SpendTime = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                //s.MoneyState = "未结算";
                #endregion

                if (CustoManager.SelectCustoByCustoNo(txtCustoNo.Text) != null)
                {
                    Room r = new Room();
                    r.CheckTime   = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                    r.CustoNo     = txtCustoNo.Text;
                    r.PersonNum   = txtPersonNum.Text;
                    r.RoomStateId = 1;
                    r.RoomNo      = txtRoomNo.Text;

                    int n = RoomManager.UpdateRoomInfo(r);
                    if (n > 0)
                    {
                        MessageBox.Show("登记入住成功!", "登记提示");
                        //SpendManager.InsertSpendInfo(s);
                        txtCustoNo.Text = "";
Example #2
0
        private void btnCheckIn_Click(object sender, EventArgs e)
        {
            if (CheckInupt())
            {
                #region 获取添加消费信息所需的信息
                Spend s = new Spend();
                s.RoomNo      = txtRoomNo.Text;
                s.CustoNo     = txtCustoNo.Text;
                s.SpendName   = "住房";
                s.SpendAmount = Convert.ToInt32(txtCheckNum.Text);
                s.SpendPrice  = Convert.ToDecimal(txtMoney.Text);
                s.SpendMoney  = Convert.ToDecimal(Convert.ToDouble(txtMoney.Text));
                s.SpendTime   = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                s.MoneyState  = "未结算";
                #endregion

                if (CustoManager.SelectCustoByCustoNo(txtCustoNo.Text) != null)
                {
                    Room r = new Room();
                    r.CheckTime   = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                    r.CustoNo     = txtCustoNo.Text;
                    r.PersonNum   = txtPersonNum.Text;
                    r.RoomStateId = 1;
                    r.RoomNo      = txtRoomNo.Text;

                    int n = RoomManager.UpdateRoomInfo(r);
                    if (n > 0)
                    {
                        MessageBox.Show("登记入住成功!", "登记提示");
                        SpendManager.InsertSpendInfo(s);
                        txtCustoNo.Text = "";
                        this.Close();
                        #region 获取添加操作日志所需的信息
                        Operation o = new Operation();
                        o.OperationTime    = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd,HH:mm:ss"));
                        o.Operationlog     = LoginInfo.WorkerClub + LoginInfo.WorkerPosition + LoginInfo.WorkerName + "于" + DateTime.Now + "帮助" + r.CustoNo + "进行了入住操作!";
                        o.OperationAccount = LoginInfo.WorkerClub + LoginInfo.WorkerPosition + LoginInfo.WorkerName;
                        #endregion
                        OperationManager.InsertOperationLog(o);
                    }
                    else
                    {
                        MessageBox.Show("登记入住失败!", "登记提示");
                    }
                }
                else
                {
                    MessageBox.Show("客户编号不存在!", "来自小T的提示");
                }
            }
        }
Example #3
0
 private void txtCustoNo_Validated(object sender, EventArgs e)
 {
     try
     {
         Custo c = CustoManager.SelectCustoByCustoNo(txtCustoNo.Text);
         txtCustoName.Text = c.CustoName;
         txtCustoTel.Text  = c.CustoTel;
         txtCustoType.Text = CustoTypeManager.SelectTypeNameByCustoTypeId(c.CustoType);
     }
     catch
     {
         txtCustoName.Text = "";
         txtCustoTel.Text  = "";
         txtCustoType.Text = "";
     }
 }
Example #4
0
        private void FrmSelectCustoInfo_Load(object sender, EventArgs e)
        {
            txtCustoNo.Text = ucRoomList.rm_CustoNo;
            Custo c = CustoManager.SelectCustoByCustoNo(txtCustoNo.Text);

            txtAddress.Text               = c.CustoAdress;
            txtCustoName.Text             = c.CustoName;
            txtPassportNum.Text           = c.CustoID;
            txtTel.Text                   = c.CustoTel;
            cboCustoSex.Text              = c.CustoSex;
            cboCustoType.SelectedIndex    = c.CustoType;
            cboPassportType.SelectedIndex = c.PassportType;
            dtpBirth.Value                = c.CustoBirth;
            //txtCustoName.Text = ucRoomList.us_CustoName;
            //cboCustoSex.Text = ucRoomList.us_CustoSex;
            //dtpBirth.Value = DateTime.Parse(ucRoomList.us_CustoBirthday);
            //txtAddress.Text = ucRoomList.us_CustoAddress;
            //txtTel.Text = ucRoomList.us_CustoTel;
            //cboCustoType.SelectedIndex = ucRoomList.us_CustoType;
            //txtPassportNum.Text = ucRoomList.us_CustoID;
            //cboPassportType.SelectedIndex = ucRoomList.us_CustoPassportType;
        }
        private void FrmCheckOutForm_Load(object sender, EventArgs e)
        {
            txtCustoNo.Text = ucRoomList.rm_CustoNo;
            CustoNo.Text    = ucRoomList.rm_CustoNo;
            txtRoomNo.Text  = ucRoomList.rm_RoomNo;
            CmpSetDgv();
            if (ucRoomList.co_CheckTime.ToString() == "0001-01-01 00:00:00")
            {
                dtpCheckTime.Value = DateTime.Now;
            }
            else
            {
                dtpCheckTime.Value = Convert.ToDateTime(ucRoomList.co_CheckTime);
            }
            lblDay.Text = Convert.ToString(Convert.ToInt32(RoomManager.DayByRoomNo(txtRoomNo.Text).ToString()));
            w           = new Wti()
            {
                CustoNo  = txtCustoNo.Text,
                EndDate  = Convert.ToDateTime(DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"))),
                PowerUse = Convert.ToDecimal(Convert.ToInt32(RoomManager.DayByRoomNo(txtRoomNo.Text).ToString()) * 3 * 1),
                WaterUse = Convert.ToDecimal(Convert.ToDouble(RoomManager.DayByRoomNo(txtRoomNo.Text).ToString()) * 80 * 0.002),
                RoomNo   = txtRoomNo.Text,
                Record   = "admin",
                UseDate  = Convert.ToDateTime(DateTime.Parse(dtpCheckTime.Text)),
            };

            #region 加载客户信息
            Custo cto = CustoManager.SelectCustoByCustoNo(CustoNo.Text.ToString());
            try
            {
                CustoName.Text                = cto.CustoName;
                txtCustoName.Text             = cto.CustoName;
                txtTel.Text                   = cto.CustoTel;
                cboCustoSex.Text              = cto.CustoSex;
                cboCustoType.SelectedIndex    = cto.CustoType;
                cboPassportType.SelectedIndex = cto.PassportType;
                dtpBirth.Value                = cto.CustoBirth;
                txtPassportNum.Text           = cto.CustoID;
            }
            catch
            {
            }


            #endregion

            #region 加载消费信息
            string RoomNo = txtRoomNo.Text;
            dgvSpendList.DataSource          = SpendManager.SelectSpendInfoRoomNo(RoomNo);
            dgvSpendList.AutoGenerateColumns = false;
            lblGetReceipts.Text = SpendManager.SelectMoneyByRoomNoAndTime(RoomNo).ToString();
            #endregion

            if (cboCustoType.Text == "钻石会员")
            {
                double m = Convert.ToDouble(Convert.ToDouble(lblGetReceipts.Text));
                lblVIPPrice.Text = Convert.ToString(Convert.ToDouble(m * 0.60));
                lblVIP.Text      = "六折";
            }
            else if (cboCustoType.Text == "白金会员")
            {
                double m = Convert.ToDouble(Convert.ToDouble(lblGetReceipts.Text));
                lblVIPPrice.Text = Convert.ToString(Convert.ToDouble(m * 0.80));
                lblVIP.Text      = "八折";
            }
            else if (cboCustoType.Text == "黄金会员")
            {
                double m = Convert.ToDouble(Convert.ToDouble(lblGetReceipts.Text));
                lblVIPPrice.Text = Convert.ToString(Convert.ToDouble(m * 0.90));
                lblVIP.Text      = "九折";
            }
            else if (cboCustoType.Text == "普通会员")
            {
                double m = Convert.ToDouble(Convert.ToDouble(lblGetReceipts.Text));
                lblVIPPrice.Text = Convert.ToString(Convert.ToDouble(m * 0.95));
                lblVIP.Text      = "九五折";
            }
            else if (cboCustoType.Text == "普通用户")
            {
                double m = Convert.ToDouble(Convert.ToDouble(lblGetReceipts.Text));
                lblVIPPrice.Text = Convert.ToString(Convert.ToDouble(m));
                lblVIP.Text      = "不  打  折";
            }
        }
Example #6
0
        private void FrmCheckOutForm_Load(object sender, EventArgs e)
        {
            double sum = 0;

            txtCustoNo.Text = ucRoomList.rm_CustoNo;
            CustoNo.Text    = ucRoomList.rm_CustoNo;
            txtRoomNo.Text  = ucRoomList.rm_RoomNo;
            string rn = txtRoomNo.Text.ToString();
            string rs = rn.Substring(0, 2);

            CmpSetDgv();
            if (ucRoomList.co_CheckTime.ToString() == "0001-01-01 00:00:00")
            {
                dtpCheckTime.Value = DateTime.Now;
            }
            else
            {
                dtpCheckTime.Value = Convert.ToDateTime(ucRoomList.co_CheckTime);
            }
            if (rs == "BD")
            {
                sum = Convert.ToDouble(Convert.ToString(Convert.ToInt32(RoomManager.DayByRoomNo(txtRoomNo.Text).ToString()) * 300));
            }
            if (rs == "BS")
            {
                sum = Convert.ToDouble(Convert.ToString(Convert.ToInt32(RoomManager.DayByRoomNo(txtRoomNo.Text).ToString()) * 425));
            }
            if (rs == "HD")
            {
                sum = Convert.ToDouble(Convert.ToString(Convert.ToInt32(RoomManager.DayByRoomNo(txtRoomNo.Text).ToString()) * 625));
            }
            if (rs == "HS")
            {
                sum = Convert.ToDouble(Convert.ToString(Convert.ToInt32(RoomManager.DayByRoomNo(txtRoomNo.Text).ToString()) * 660));
            }
            if (rs == "QL")
            {
                sum = Convert.ToDouble(Convert.ToString(Convert.ToInt32(RoomManager.DayByRoomNo(txtRoomNo.Text).ToString()) * 845));
            }
            if (rs == "ZT")
            {
                sum = Convert.ToDouble(Convert.ToString(Convert.ToInt32(RoomManager.DayByRoomNo(txtRoomNo.Text).ToString()) * 1080));
            }
            lblDay.Text = Convert.ToString(Convert.ToInt32(RoomManager.DayByRoomNo(txtRoomNo.Text).ToString()));
            w           = new Wti()
            {
                CustoNo  = txtCustoNo.Text,
                EndDate  = Convert.ToDateTime(DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"))),
                PowerUse = Convert.ToDecimal(Convert.ToInt32(RoomManager.DayByRoomNo(txtRoomNo.Text).ToString()) * 3 * 1),
                WaterUse = Convert.ToDecimal(Convert.ToDouble(RoomManager.DayByRoomNo(txtRoomNo.Text).ToString()) * 80 * 0.002),
                RoomNo   = txtRoomNo.Text,
                Record   = "admin",
                UseDate  = Convert.ToDateTime(DateTime.Parse(dtpCheckTime.Text)),
            };

            #region 加载客户信息
            Custo cto = CustoManager.SelectCustoByCustoNo(CustoNo.Text.ToString());
            try
            {
                CustoName.Text                = cto.CustoName;
                txtCustoName.Text             = cto.CustoName;
                txtTel.Text                   = cto.CustoTel;
                cboCustoSex.Text              = cto.CustoSex;
                cboCustoType.SelectedIndex    = cto.CustoType;
                cboPassportType.SelectedIndex = cto.PassportType;
                dtpBirth.Value                = cto.CustoBirth;
                txtPassportNum.Text           = cto.CustoID;
            }
            catch
            {
            }


            #endregion

            #region 加载消费信息
            string RoomNo = txtRoomNo.Text;
            dgvSpendList.DataSource          = SpendManager.SelectSpendInfoRoomNo(RoomNo);
            dgvSpendList.AutoGenerateColumns = false;
            double result = 0;
        private void FrmCheckOutForm_Load(object sender, EventArgs e)
        {
            double sum = 0;

            txtCustoNo.Text = ucRoomList.rm_CustoNo;
            CustoNo.Text    = ucRoomList.rm_CustoNo;
            txtRoomNo.Text  = ucRoomList.rm_RoomNo;
            string rn = txtRoomNo.Text.ToString();
            string rs = rn.Substring(0, 2);

            CmpSetDgv();
            if (ucRoomList.co_CheckTime == null)
            {
                dtpCheckTime.Value = DateTime.Now;
            }
            else
            {
                dtpCheckTime.Value = Convert.ToDateTime(ucRoomList.co_CheckTime);
            }
            if (rs == "BD")
            {
                sum = Convert.ToDouble(Convert.ToString(Convert.ToInt32(RoomManager.DayByRoomNo(txtRoomNo.Text).ToString()) * 300));
            }
            if (rs == "BS")
            {
                sum = Convert.ToDouble(Convert.ToString(Convert.ToInt32(RoomManager.DayByRoomNo(txtRoomNo.Text).ToString()) * 425));
            }
            if (rs == "HD")
            {
                sum = Convert.ToDouble(Convert.ToString(Convert.ToInt32(RoomManager.DayByRoomNo(txtRoomNo.Text).ToString()) * 625));
            }
            if (rs == "HS")
            {
                sum = Convert.ToDouble(Convert.ToString(Convert.ToInt32(RoomManager.DayByRoomNo(txtRoomNo.Text).ToString()) * 660));
            }
            if (rs == "QL")
            {
                sum = Convert.ToDouble(Convert.ToString(Convert.ToInt32(RoomManager.DayByRoomNo(txtRoomNo.Text).ToString()) * 845));
            }
            if (rs == "ZT")
            {
                sum = Convert.ToDouble(Convert.ToString(Convert.ToInt32(RoomManager.DayByRoomNo(txtRoomNo.Text).ToString()) * 1080));
            }
            lblDay.Text = Convert.ToString(Convert.ToInt32(RoomManager.DayByRoomNo(txtRoomNo.Text).ToString()));
            w           = new Wti()
            {
                CustoNo  = txtCustoNo.Text,
                EndDate  = Convert.ToDateTime(DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"))),
                PowerUse = Convert.ToDecimal(Convert.ToInt32(RoomManager.DayByRoomNo(txtRoomNo.Text).ToString()) * 3 * 1),
                WaterUse = Convert.ToDecimal(Convert.ToDouble(RoomManager.DayByRoomNo(txtRoomNo.Text).ToString()) * 80 * 0.002),
                RoomNo   = txtRoomNo.Text,
                Record   = "admin",
                UseDate  = Convert.ToDateTime(DateTime.Parse(dtpCheckTime.Text)),
            };

            #region 加载客户信息
            Custo cto = CustoManager.SelectCustoByCustoNo(CustoNo.Text.ToString());
            try
            {
                CustoName.Text                = cto.CustoName;
                txtCustoName.Text             = cto.CustoName;
                txtTel.Text                   = cto.CustoTel;
                cboCustoSex.Text              = cto.CustoSex == 1 ? "男" : "女";
                cboCustoType.SelectedIndex    = cto.CustoType;
                cboPassportType.SelectedIndex = cto.PassportType;
                dtpBirth.Value                = cto.CustoBirth;
                txtPassportNum.Text           = cto.CustoID;
            }
            catch
            {
            }


            #endregion

            #region 加载消费信息
            string RoomNo = txtRoomNo.Text;
            dgvSpendList.DataSource          = SpendManager.SelectSpendInfoRoomNo(RoomNo);
            dgvSpendList.AutoGenerateColumns = false;
            double result = 0;
            if (dgvSpendList.Rows.Count == 0)
            {
                result = 0;
            }
            else
            {
                result = Convert.ToDouble(SpendManager.SelectMoneyByRoomNoAndTime(RoomNo, CustoNo.Text.ToString()));
            }

            #endregion

            if (cboCustoType.Text == "钻石会员")
            {
                double m = result + sum;
                lblGetReceipts.Text = m.ToString();
                lblVIPPrice.Text    = Convert.ToString(m * 0.60);
                lblVIP.Text         = "六折";
            }
            else if (cboCustoType.Text == "白金会员")
            {
                double m = result + sum;
                lblGetReceipts.Text = m.ToString();
                lblVIPPrice.Text    = Convert.ToString(m * 0.80);
                lblVIP.Text         = "八折";
            }
            else if (cboCustoType.Text == "黄金会员")
            {
                double m = result + sum;
                lblGetReceipts.Text = m.ToString();
                lblVIPPrice.Text    = Convert.ToString(m * 0.90);
                lblVIP.Text         = "九折";
            }
            else if (cboCustoType.Text == "普通会员")
            {
                double m = result + sum;
                lblGetReceipts.Text = m.ToString();
                lblVIPPrice.Text    = Convert.ToString(m * 0.95);
                lblVIP.Text         = "九五折";
            }
            else if (cboCustoType.Text == "普通用户")
            {
                //39525
                double m = result + sum;
                lblGetReceipts.Text = m.ToString();
                lblVIPPrice.Text    = Convert.ToString(m);
                lblVIP.Text         = "不  打  折";
            }
        }