⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sysmain.cs

📁 简易专家系统程序
💻 CS
📖 第 1 页 / 共 4 页
字号:
			// 
			this.comboBox3.ItemHeight = 12;
			this.comboBox3.Location = new System.Drawing.Point(152, 80);
			this.comboBox3.Name = "comboBox3";
			this.comboBox3.Size = new System.Drawing.Size(80, 20);
			this.comboBox3.TabIndex = 7;
			this.comboBox3.Text = "comboBox3";
			// 
			// button17
			// 
			this.button17.Location = new System.Drawing.Point(152, 48);
			this.button17.Name = "button17";
			this.button17.TabIndex = 6;
			this.button17.Text = "选择结论";
			// 
			// textBox10
			// 
			this.textBox10.Location = new System.Drawing.Point(232, 24);
			this.textBox10.Name = "textBox10";
			this.textBox10.Size = new System.Drawing.Size(64, 21);
			this.textBox10.TabIndex = 5;
			this.textBox10.Text = "textBox10";
			// 
			// label22
			// 
			this.label22.Location = new System.Drawing.Point(160, 24);
			this.label22.Name = "label22";
			this.label22.Size = new System.Drawing.Size(64, 23);
			this.label22.TabIndex = 4;
			this.label22.Text = "可信度:";
			// 
			// listBox7
			// 
			this.listBox7.ItemHeight = 12;
			this.listBox7.Location = new System.Drawing.Point(8, 80);
			this.listBox7.Name = "listBox7";
			this.listBox7.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple;
			this.listBox7.Size = new System.Drawing.Size(120, 88);
			this.listBox7.TabIndex = 3;
			// 
			// textBox9
			// 
			this.textBox9.Location = new System.Drawing.Point(72, 24);
			this.textBox9.Name = "textBox9";
			this.textBox9.Size = new System.Drawing.Size(72, 21);
			this.textBox9.TabIndex = 2;
			this.textBox9.Text = "textBox9";
			// 
			// label21
			// 
			this.label21.Location = new System.Drawing.Point(16, 24);
			this.label21.Name = "label21";
			this.label21.Size = new System.Drawing.Size(56, 23);
			this.label21.TabIndex = 1;
			this.label21.Text = "规则号:";
			// 
			// button16
			// 
			this.button16.Location = new System.Drawing.Point(8, 48);
			this.button16.Name = "button16";
			this.button16.TabIndex = 0;
			this.button16.Text = "选择前提 ";
			// 
			// button15
			// 
			this.button15.Location = new System.Drawing.Point(104, 224);
			this.button15.Name = "button15";
			this.button15.TabIndex = 7;
			this.button15.Text = "刷新";
			this.button15.Click += new System.EventHandler(this.button15_Click);
			// 
			// groupBox1
			// 
			this.groupBox1.Controls.AddRange(new System.Windows.Forms.Control[] {
																					this.textBox8,
																					this.label20,
																					this.listBox6,
																					this.label19,
																					this.button14,
																					this.listBox5,
																					this.listBox2,
																					this.button13,
																					this.textBox7,
																					this.label18,
																					this.label17,
																					this.listBox1,
																					this.comboBox2,
																					this.label16,
																					this.button12});
			this.groupBox1.Location = new System.Drawing.Point(392, 256);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(376, 232);
			this.groupBox1.TabIndex = 6;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "规则编辑:";
			// 
			// textBox8
			// 
			this.textBox8.Location = new System.Drawing.Point(144, 200);
			this.textBox8.Name = "textBox8";
			this.textBox8.TabIndex = 19;
			this.textBox8.Text = "textBox8";
			// 
			// label20
			// 
			this.label20.Location = new System.Drawing.Point(144, 176);
			this.label20.Name = "label20";
			this.label20.Size = new System.Drawing.Size(144, 23);
			this.label20.TabIndex = 18;
			this.label20.Text = "当前可信度:(可修改)";
			// 
			// listBox6
			// 
			this.listBox6.ItemHeight = 12;
			this.listBox6.Location = new System.Drawing.Point(208, 24);
			this.listBox6.Name = "listBox6";
			this.listBox6.Size = new System.Drawing.Size(72, 16);
			this.listBox6.TabIndex = 17;
			// 
			// label19
			// 
			this.label19.Location = new System.Drawing.Point(248, 56);
			this.label19.Name = "label19";
			this.label19.TabIndex = 16;
			this.label19.Text = "新前提号:";
			// 
			// button14
			// 
			this.button14.Location = new System.Drawing.Point(288, 200);
			this.button14.Name = "button14";
			this.button14.TabIndex = 15;
			this.button14.Text = "提交";
			this.button14.Click += new System.EventHandler(this.button14_Click);
			// 
			// listBox5
			// 
			this.listBox5.ItemHeight = 12;
			this.listBox5.Location = new System.Drawing.Point(248, 80);
			this.listBox5.Name = "listBox5";
			this.listBox5.Size = new System.Drawing.Size(104, 88);
			this.listBox5.TabIndex = 14;
			// 
			// listBox2
			// 
			this.listBox2.ItemHeight = 12;
			this.listBox2.Location = new System.Drawing.Point(128, 80);
			this.listBox2.Name = "listBox2";
			this.listBox2.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple;
			this.listBox2.Size = new System.Drawing.Size(104, 88);
			this.listBox2.TabIndex = 13;
			// 
			// button13
			// 
			this.button13.Location = new System.Drawing.Point(128, 48);
			this.button13.Name = "button13";
			this.button13.Size = new System.Drawing.Size(75, 24);
			this.button13.TabIndex = 12;
			this.button13.Text = "选择新前提";
			this.button13.Click += new System.EventHandler(this.button13_Click);
			// 
			// textBox7
			// 
			this.textBox7.Location = new System.Drawing.Point(8, 200);
			this.textBox7.Name = "textBox7";
			this.textBox7.TabIndex = 11;
			this.textBox7.Text = "textBox7";
			// 
			// label18
			// 
			this.label18.Location = new System.Drawing.Point(8, 176);
			this.label18.Name = "label18";
			this.label18.Size = new System.Drawing.Size(144, 23);
			this.label18.TabIndex = 10;
			this.label18.Text = "当前结论号:(可修改)";
			// 
			// label17
			// 
			this.label17.Location = new System.Drawing.Point(8, 56);
			this.label17.Name = "label17";
			this.label17.TabIndex = 9;
			this.label17.Text = "当前前提号:";
			// 
			// listBox1
			// 
			this.listBox1.ItemHeight = 12;
			this.listBox1.Location = new System.Drawing.Point(8, 80);
			this.listBox1.Name = "listBox1";
			this.listBox1.Size = new System.Drawing.Size(104, 88);
			this.listBox1.TabIndex = 8;
			// 
			// comboBox2
			// 
			this.comboBox2.Location = new System.Drawing.Point(80, 24);
			this.comboBox2.Name = "comboBox2";
			this.comboBox2.Size = new System.Drawing.Size(121, 20);
			this.comboBox2.TabIndex = 7;
			this.comboBox2.Text = "comboBox2";
			// 
			// label16
			// 
			this.label16.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label16.Location = new System.Drawing.Point(8, 24);
			this.label16.Name = "label16";
			this.label16.Size = new System.Drawing.Size(72, 23);
			this.label16.TabIndex = 6;
			this.label16.Text = "现有规则:";
			// 
			// button12
			// 
			this.button12.Location = new System.Drawing.Point(296, 24);
			this.button12.Name = "button12";
			this.button12.TabIndex = 5;
			this.button12.Text = "选择规则号";
			this.button12.Click += new System.EventHandler(this.button12_Click);
			// 
			// dataGrid3
			// 
			this.dataGrid3.AllowDrop = true;
			this.dataGrid3.DataMember = "";
			this.dataGrid3.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dataGrid3.Location = new System.Drawing.Point(8, 256);
			this.dataGrid3.Name = "dataGrid3";
			this.dataGrid3.Size = new System.Drawing.Size(376, 232);
			this.dataGrid3.TabIndex = 4;
			// 
			// label15
			// 
			this.label15.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label15.Location = new System.Drawing.Point(8, 224);
			this.label15.Name = "label15";
			this.label15.Size = new System.Drawing.Size(96, 23);
			this.label15.TabIndex = 3;
			this.label15.Text = "规则表内容:";
			// 
			// dataGrid2
			// 
			this.dataGrid2.DataMember = "";
			this.dataGrid2.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dataGrid2.Location = new System.Drawing.Point(8, 88);
			this.dataGrid2.Name = "dataGrid2";
			this.dataGrid2.Size = new System.Drawing.Size(624, 136);
			this.dataGrid2.TabIndex = 2;
			// 
			// label14
			// 
			this.label14.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label14.Location = new System.Drawing.Point(8, 48);
			this.label14.Name = "label14";
			this.label14.Size = new System.Drawing.Size(120, 23);
			this.label14.TabIndex = 1;
			this.label14.Text = "事实表内容参考:";
			// 
			// label13
			// 
			this.label13.Font = new System.Drawing.Font("楷体_GB2312", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label13.Location = new System.Drawing.Point(8, 8);
			this.label13.Name = "label13";
			this.label13.Size = new System.Drawing.Size(184, 32);
			this.label13.TabIndex = 0;
			this.label13.Text = "规则编辑页面";
			// 
			// sysmain
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(776, 717);
			this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.tabControl1});
			this.Name = "sysmain";
			this.Text = "sysmain";
			this.tabControl1.ResumeLayout(false);
			this.tabPage1.ResumeLayout(false);
			this.tabPage2.ResumeLayout(false);
			this.tabPage3.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
			this.tabPage4.ResumeLayout(false);
			this.groupBox3.ResumeLayout(false);
			this.groupBox2.ResumeLayout(false);
			this.groupBox1.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.dataGrid3)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.dataGrid2)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		private void tabPage1_Click(object sender, System.EventArgs e)
		{
		
		}

		private void tabControl1_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			
		}

		private void tabPage2_Click(object sender, System.EventArgs e)
		{
		
		}

		private void button4_Click_1(object sender, System.EventArgs e)
		{
			listBox3.Items.Clear();
			int j;
			SqlConnection cn1=new SqlConnection(conn.con);
			if(listBox4.SelectedItems.Count!=0)
			{
				for(j=0;j<listBox4.SelectedItems.Count;j++)
				{
					
					string str="select * from fact where facttx='"+listBox4.SelectedItems[j].ToString()+"'";
					SqlCommand com=new SqlCommand(str,cn1);
					SqlDataAdapter adp=new SqlDataAdapter(com);
					DataTable dt=new DataTable("mytable");
					adp.Fill(dt);
					if(dt.Rows.Count!=0)
					{
						string str1="select ruleno from rules where PreNo='"+dt.Rows[0]["FactNo"]+"'";
						SqlCommand comx=new SqlCommand(str1,cn1);
						adp.SelectCommand=comx;
						DataTable dtx=new DataTable("mytalex");
						adp.Fill(dtx);
						SqlCommand comxx=new SqlCommand("",cn1);
						comxx.CommandText="insert into Cs_TempFact (infactno,infacttx,inruleno)values('"+dt.Rows[0]["FactNo"].ToString()+"','"+dt.Rows[0]["FactTx"]+"','"+dtx.Rows[0][0].ToString()+"')";
						try
						{
							cn1.Open();
							comxx.ExecuteNonQuery();
							cn1.Close();
						}
						catch(Exception ex)
						{ 
							if(MessageBox.Show("数据插入错误!","错误提示",MessageBoxButtons.RetryCancel)==DialogResult.Cancel)
								Application.Exit();
							cn1.Close();
						}
					}
				}
			}
			else
			{
				if(MessageBox.Show("选择为空!","错误提示",MessageBoxButtons.RetryCancel)==DialogResult.Cancel)
					Application.Exit();
			}
			textBox1.Text="";
			int i;
			int a=1;
			string com1,com2;
			//SqlConnection cn1=new SqlConnection(conn.con);
			SqlCommand cm1=new SqlCommand("",cn1);
			SqlCommand cm2=new SqlCommand("",cn1);
			SqlCommand cm3=new SqlCommand("",cn1);
			SqlDataAdapter adp1=new SqlDataAdapter();
			DataTable dt1=new DataTable("myt1");
			DataTable dt2=new DataTable("myt2");
			DataTable dt3=new DataTable("myt3");
			dt1.Clear();
			cm1.CommandText="select inruleno,count(infactno)as c from cs_tempfact group by inruleno";
			adp1.SelectCommand=cm1;
			adp1.Fill(dt1);
			for(i=0;i<dt1.Rows.Count;i++)
			{
				//if(dt1.Rows[i][0].ToString()==dt1.Rows[i+1][0].ToString())
				//a++;
				//else
				//{
				cm2.CommandText="select counts from rulecount where ruleno='"+dt1.Rows[i]["inruleno"]+"'";
				//cm2.Parameters.Add("inruleno",System.Data.SqlDbType.VarChar,10);
				//cm2.Parameters["inruleno"].Value=dt1.Rows[i]["inruleno"].ToString();
				adp1.SelectCommand=cm2;
				dt2.Clear();
				adp1.Fill(dt2);
				if(dt2.Rows[0][0].ToString()==dt1.Rows[i]["c"].ToString())
				{
					cm3.CommandText="update cs_tempfact set flag=1 where inruleno='"+dt1.Rows[i]["inruleno"].ToString()+"'";
					try
					{

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -