图形界面/PayDeposit.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using 数据访问与类库;

namespace 图形界面
{
    public partial class PayDeposit : Form
    {
        private DataSet ds = new DataSet();
        private int id;//用户的ID
        private int deposit;//之前交的押金

        public PayDeposit()
        {
            InitializeComponent();
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnSearch_Click(object sender, EventArgs e)
        {
            int roomNumber;
            if (!int.TryParse(txtInpuyRoomNumber.Text.Trim(), out roomNumber))
            {
                MessageBox.Show("输入有误!");
                return;
            }
            ds =DBHelper.ExecuteQuery("select * from CustomerInfo where RoomNumber='" + roomNumber + "'");
            if (!(ds.Tables[0].Rows.Count>0))
            {
                MessageBox.Show("没有此房间的信息!");
                return;
            }
            id = int.Parse(ds.Tables[0].Rows[0][0].ToString());
            deposit = int.Parse(ds.Tables[0].Rows[0][5].ToString());
            txtCustomerName.Text = ds.Tables[0].Rows[0][1].ToString();
            txtRoomNumber.Text = ds.Tables[0].Rows[0][10].ToString();
            txtCheckInTime.Text = ds.Tables[0].Rows[0][6].ToString();
            txtRoomPrice.Text = ds.Tables[0].Rows[0][8].ToString();
            txtDeposit.Text = deposit.ToString();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            int newMoney;
            if (!int.TryParse(txtPayDeposit.Text.Trim(),out newMoney))
            {
                MessageBox.Show("补交输入有误!");
                return;
            }
            deposit += newMoney;
后面还有 13 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。