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 = "";
        private void picGetCustoNo_Click(object sender, EventArgs e)
        {
            string cardId = CustoManager.GetRandomCustoNo();

            txtCustoNo.Text = cardId;
            picGetCustoNo.BackgroundImage = Resources.获取用户编号_ia;
        }
        private void FrmInputs_Load(object sender, EventArgs e)
        {
            foreach (Control label in this.Controls)
            {
                if (label.GetType().ToString() == "System.Windows.Forms.Label")
                {
                    label.Font = UI_FontUtil.SetControlFont();
                }
            }
            txtCustoNo.Text = CustoManager.GetRandomCustoNo();

            #region 加载客户类型信息
            List <CustoType> lstSourceGrid = CustoTypeManager.SelectCustoTypesAll();
            this.cbCustoType.DataSource    = lstSourceGrid;
            this.cbCustoType.DisplayMember = "TypeName";
            this.cbCustoType.ValueMember   = "UserType";
            this.cbCustoType.SelectedIndex = 0;
            this.cbCustoType.ReadOnly      = true;
            #endregion

            #region 加载证件类型信息
            List <PassPortType> passPorts = CustoTypeManager.SelectPassPortTypeAll();
            this.cbPassportType.DataSource    = passPorts;
            this.cbPassportType.DisplayMember = "PassportName";
            this.cbPassportType.ValueMember   = "PassportId";
            this.cbPassportType.SelectedIndex = 0;
예제 #4
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            string cardId = CustoManager.GetRandomCustoNo();

            txtCustoNo.Text   = cardId;
            txtCustoName.Text = dataGridView1.SelectedRows[0].Cells["clCustoName"].Value.ToString();
            txtTel.Text       = dataGridView1.SelectedRows[0].Cells["clCustoTel"].Value.ToString();
        }
        private void btnOK_BtnClick(object sender, EventArgs e)
        {
            try
            {
                if (txtCustoName.Text == "")
                {
                    MessageBox.Show("添加失败,必填信息不可为空");
                }
                else
                {
                    Custo custo = new Custo()
                    {
                        CustoNo      = txtCustoNo.Text,
                        CustoName    = txtCustoName.Text,
                        CustoSex     = cbSex.SelectedIndex,
                        CustoBirth   = dtpBirthday.Value,
                        CustoType    = cbCustoType.SelectedIndex,
                        PassportType = cbPassportType.SelectedIndex,
                        CustoID      = txtCardID.Text,
                        CustoTel     = txtTel.Text,
                        CustoAdress  = txtCustoAdress.Text
                    };
                    int count = CustoManager.InsertCustomerInfo(custo);
                    if (count > 0)
                    {
                        MessageBox.Show("添加成功");

                        #region 获取添加操作日志所需的信息
                        Operation o = new Operation();
                        o.OperationTime    = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd,HH:mm:ss"));
                        o.Operationlog     = "编号:" + LoginInfo.WorkerNo + "【" + FrmMain.wk_WorkerName + "】" + "于" + DateTime.Now + "插入了一条数据!";
                        o.OperationAccount = LoginInfo.WorkerNo;
                        OperationManager.InsertOperationLog(o);
                        #endregion
                    }

                    foreach (Control Ctrol in this.Controls)
                    {
                        if (Ctrol is Sunny.UI.UITextBox)
                        {
                            Ctrol.Text = "";
                        }
                        if (Ctrol is Sunny.UI.UIComboBox)
                        {
                            this.cbSex.SelectedIndex          = 0;
                            this.cbCustoType.SelectedIndex    = 0;
                            this.cbPassportType.SelectedIndex = 0;
                        }
                    }
                }
            }
            catch
            {
            }
        }
예제 #6
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的提示");
                }
            }
        }
예제 #7
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 = "";
     }
 }
예제 #8
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 picGetCustoNo_Click(object sender, EventArgs e)
        {
            string cardId = CustoManager.GetRandomCustoNo();

            txtCustoNo.Text = cardId;
        }
        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      = "不  打  折";
            }
        }
예제 #11
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         = "不  打  折";
            }
        }