NetBarManageSystem/Form_hj.cs

(开头部分) 3KB

这里只显示每个文件的开头 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;

namespace NetBarManageSystem_lihang
{
    public partial class Form_hj : Form
    {
        //定义全局变量,把主窗体传过来
        public From_main hj;
        public Form_hj()
        {
            InitializeComponent();
        }

        private void Form_hj_Load(object sender, EventArgs e)
        {
           
            //查询出正在上机的机器和未使用的机器

            string sql1 = "select *from pcInfo where pcUse=1";
            string sql2 = "select *from pcInfo where pcUse=0";

            //执行命令
            DataTable table1 = sql_zsgc.cx(sql1);
            DataTable table2 = sql_zsgc.cx(sql2);
            //绑定数据
            this.cbo_zzsyjq.DataSource = table1;//数据来源
            this.cbo_zzsyjq.DisplayMember = "pcId";//显示值
            this.cbo_zzsyjq.ValueMember = "pcId";//真实值


            this.cbo_wsyjq.DataSource = table2;
            this.cbo_wsyjq.DisplayMember = "pcId";//显示值
            this.cbo_wsyjq.ValueMember = "pcId";//真实值

        }

        private void button1_Click(object sender, EventArgs e)
        {
            //换机
            //1.修改计算机使用状态
            string sql1 = "update pcInfo set pcUse=0 where pcId="+this.cbo_zzsyjq.Text+"";//正在上机的机器改为未使用
            string sql2 = "update pcInfo set pcUse=1 where pcId=" + this.cbo_wsyjq.Text + "";//未上机的机器改为使用
            string sql3 = "update recordInfo set pcId="+this.cbo_wsyjq.Text+" where pcId=" + this.cbo_zzsyjq.Text + "";//未上机的机器改为使用
            
            
            //执行
            int result1 = sql_zsgc.zsg(sql1);
            int result2 = sql_zsgc.zsg(sql2);
            int result3 = sql_zsgc.zsg(sql3);

            int result = result1 + result2 + result3;

            if (result >= 3)
后面还有 38 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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