📄 frmfeemax.cs
字号:
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(112, 104);
this.textBox3.Name = "textBox3";
this.textBox3.ReadOnly = true;
this.textBox3.Size = new System.Drawing.Size(192, 23);
this.textBox3.TabIndex = 8;
this.textBox3.Text = "";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(112, 64);
this.textBox2.Name = "textBox2";
this.textBox2.ReadOnly = true;
this.textBox2.Size = new System.Drawing.Size(192, 23);
this.textBox2.TabIndex = 7;
this.textBox2.Text = "";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(112, 24);
this.textBox1.Name = "textBox1";
this.textBox1.ReadOnly = true;
this.textBox1.Size = new System.Drawing.Size(192, 23);
this.textBox1.TabIndex = 6;
this.textBox1.Text = "";
//
// label6
//
this.label6.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label6.ForeColor = System.Drawing.SystemColors.ActiveCaption;
this.label6.Location = new System.Drawing.Point(24, 144);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(88, 24);
this.label6.TabIndex = 5;
this.label6.Text = "煤气费";
//
// label5
//
this.label5.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label5.ForeColor = System.Drawing.SystemColors.ActiveCaption;
this.label5.Location = new System.Drawing.Point(24, 224);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(88, 24);
this.label5.TabIndex = 4;
this.label5.Text = "管理费";
//
// label4
//
this.label4.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label4.ForeColor = System.Drawing.SystemColors.ActiveCaption;
this.label4.Location = new System.Drawing.Point(24, 184);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(88, 24);
this.label4.TabIndex = 3;
this.label4.Text = "排污费";
//
// label3
//
this.label3.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label3.ForeColor = System.Drawing.SystemColors.ActiveCaption;
this.label3.Location = new System.Drawing.Point(24, 104);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(88, 24);
this.label3.TabIndex = 2;
this.label3.Text = "停车费";
//
// label2
//
this.label2.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label2.ForeColor = System.Drawing.SystemColors.ActiveCaption;
this.label2.Location = new System.Drawing.Point(24, 64);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(88, 24);
this.label2.TabIndex = 1;
this.label2.Text = "电费";
//
// label1
//
this.label1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label1.ForeColor = System.Drawing.SystemColors.ActiveCaption;
this.label1.Location = new System.Drawing.Point(24, 24);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(88, 24);
this.label1.TabIndex = 0;
this.label1.Text = "水费";
//
// button1
//
this.button1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.button1.ForeColor = System.Drawing.SystemColors.ActiveCaption;
this.button1.Location = new System.Drawing.Point(448, 320);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(88, 24);
this.button1.TabIndex = 4;
this.button1.Text = "关闭";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// frmfeemax
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(544, 350);
this.Controls.Add(this.button1);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.treeView1);
this.Controls.Add(this.groupBox1);
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(552, 384);
this.MinimumSize = new System.Drawing.Size(552, 384);
this.Name = "frmfeemax";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "收费状况";
this.Load += new System.EventHandler(this.frmfeemax_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void frmfeemax_Load(object sender, System.EventArgs e)
{
objSqlConn=new SqlConnection("database=atorregulate;user id=sa;password=;SERVER=(local)");
objDataSet1=new DataSet();
objDataSet2=new DataSet();
objSqlConn.Open();
objSqlDataAdapter=new SqlDataAdapter("select*from trigfee",objSqlConn);
objSqlDataAdapter.Fill(objDataSet1,"carpark");
objSqlDataAdapter=new SqlDataAdapter("select Mitem from trigfee",objSqlConn);
objSqlDataAdapter.Fill(objDataSet2,"trigfee");
ewq1();
}
private void treeView1_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
{
ewq2();
string var=e.Node.Text;
if( radioButton2.Checked==true){
foreach(DataRow objDataRow in objDataSet1.Tables[0].Rows)
{
if(var==objDataRow["Mitem"].ToString())
{
textBox1.Text=objDataRow["Mwater"].ToString();
textBox2.Text=objDataRow["Melecticity"].ToString();
textBox3.Text=objDataRow["Mcar"].ToString();
textBox4.Text=objDataRow["Mregulate"].ToString();
textBox5.Text=objDataRow["Mrange"].ToString();
textBox6.Text=objDataRow["Mgas"].ToString();
textBox7.Text=objDataRow["Mmax"].ToString();
}
}
}
else{
foreach(DataRow objDataRow in objDataSet1.Tables[0].Rows)
{
if(var==objDataRow["Musername"].ToString())
{
textBox1.Text=objDataRow["Mwater"].ToString();
textBox2.Text=objDataRow["Melecticity"].ToString();
textBox3.Text=objDataRow["Mcar"].ToString();
textBox4.Text=objDataRow["Mregulate"].ToString();
textBox5.Text=objDataRow["Mrange"].ToString();
textBox6.Text=objDataRow["Mgas"].ToString();
textBox7.Text=objDataRow["Mmax"].ToString();
}
}
}
}
private void radioButton1_CheckedChanged(object sender, System.EventArgs e)
{
this.treeView1.Nodes.Clear();
i=0;
for (int b=0;b<objDataSet1.Tables[0].Rows.Count;b++)
{
i++;
}
string[] a=new string[i];
for (int b=0;b<objDataSet1.Tables[0].Rows.Count;b++)
{
a[b]=objDataSet1.Tables[0].Rows[b]["Mitem"].ToString() ;
}
int z=i;int q=1;
for(int b=0;b<z;b++)
{
for(int c=b+1;c<z;c++ )
{
if(a[b]==a[c])
{a[c]=a[z-1];z--;c--;}
}
}
TreeNode objNodeParent;
for(int d=0;d<z;d++)
{
objNodeParent=treeView1.Nodes.Add(a[d].ToString());
objNodeParent.Tag=a[d];
TreeNode objewq;
TreeNode objdsa;
for (int b=0;b<objDataSet1.Tables[0].Rows.Count;b++)
{
if(a[d]==objDataSet1.Tables[0].Rows[b]["Mitem"].ToString())
{
objewq=objNodeParent.Nodes.Add(objDataSet1.Tables[0].Rows[b]["Mhomenumber"].ToString());
objdsa= objewq.Nodes.Add(objDataSet1.Tables[0].Rows[b]["Musername"].ToString());
}
//}
//ewq3();
}
}
/*this.treeView1.Nodes.Clear();
ewq1();*/
}
private void radioButton2_CheckedChanged(object sender, System.EventArgs e)
{
this.treeView1.Nodes.Clear();
i=0;
for (int b=0;b<objDataSet1.Tables[0].Rows.Count;b++)
{
i++;
}
string[] a=new string[i];
for (int b=0;b<objDataSet1.Tables[0].Rows.Count;b++)
{
a[b]=objDataSet1.Tables[0].Rows[b]["Mitem"].ToString() ;
}
int z=i;int q=1;
for(int b=0;b<z;b++)
{
for(int c=b+1;c<z;c++ )
{
if(a[b]==a[c])
{a[c]=a[z-1];z--;c--;}
}
}
TreeNode objNodeParent;
for(int d=0;d<z;d++)
{
objNodeParent=treeView1.Nodes.Add(a[d].ToString());
objNodeParent.Tag=a[d];
for (int b=0;b<objDataSet1.Tables[0].Rows.Count;b++)
{
if(a[d]==objDataSet1.Tables[0].Rows[b]["Mitem"].ToString())
{
/*objewq=objNodeParent.Nodes.Add(objDataSet1.Tables[0].Rows[b]["Mitem"].ToString());
objdsa= objewq.Nodes.Add(objDataSet1.Tables[0].Rows[b]["Mmax"].ToString());*/
}
//}
//ewq3();
}
}
}
private void button1_Click(object sender, System.EventArgs e)
{
this.Close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -