📄 frmfeemax.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
namespace WindowsApplication1
{
/// <summary>
/// frmfeemax 的摘要说明。
/// </summary>
public class frmfeemax : System.Windows.Forms.Form
{
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.TreeView treeView1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.TextBox textBox5;
private System.Windows.Forms.TextBox textBox6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox textBox7;
private System.Windows.Forms.Button button1;
private SqlConnection objSqlConn;
private DataSet objDataSet1;
private DataSet objDataSet2;
private SqlDataAdapter objSqlDataAdapter;
private int i=0;
private string a;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
private void ewq1()
{
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 ewq2()
{
textBox1.Text="";
textBox2.Text="";
textBox3.Text="";
textBox4.Text="";
textBox5.Text="";
textBox6.Text="";
textBox7.Text="";
}
public frmfeemax()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.treeView1 = new System.Windows.Forms.TreeView();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.textBox7 = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.textBox6 = new System.Windows.Forms.TextBox();
this.textBox5 = new System.Windows.Forms.TextBox();
this.textBox4 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.radioButton2);
this.groupBox1.Controls.Add(this.radioButton1);
this.groupBox1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.groupBox1.ForeColor = System.Drawing.SystemColors.ActiveCaption;
this.groupBox1.Location = new System.Drawing.Point(16, 16);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(160, 56);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "查看类型";
//
// radioButton2
//
this.radioButton2.Checked = true;
this.radioButton2.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.radioButton2.ForeColor = System.Drawing.SystemColors.ActiveCaption;
this.radioButton2.Location = new System.Drawing.Point(80, 24);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(64, 24);
this.radioButton2.TabIndex = 1;
this.radioButton2.TabStop = true;
this.radioButton2.Text = "按栋";
this.radioButton2.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged);
//
// radioButton1
//
this.radioButton1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.radioButton1.ForeColor = System.Drawing.SystemColors.ActiveCaption;
this.radioButton1.Location = new System.Drawing.Point(8, 24);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(64, 24);
this.radioButton1.TabIndex = 0;
this.radioButton1.Text = "全部";
this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
//
// treeView1
//
this.treeView1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.treeView1.ForeColor = System.Drawing.SystemColors.ActiveCaption;
this.treeView1.ImageIndex = -1;
this.treeView1.Location = new System.Drawing.Point(16, 80);
this.treeView1.Name = "treeView1";
this.treeView1.SelectedImageIndex = -1;
this.treeView1.Size = new System.Drawing.Size(160, 248);
this.treeView1.TabIndex = 1;
this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect);
//
// groupBox2
//
this.groupBox2.Controls.Add(this.textBox7);
this.groupBox2.Controls.Add(this.label7);
this.groupBox2.Controls.Add(this.textBox6);
this.groupBox2.Controls.Add(this.textBox5);
this.groupBox2.Controls.Add(this.textBox4);
this.groupBox2.Controls.Add(this.textBox3);
this.groupBox2.Controls.Add(this.textBox2);
this.groupBox2.Controls.Add(this.textBox1);
this.groupBox2.Controls.Add(this.label6);
this.groupBox2.Controls.Add(this.label5);
this.groupBox2.Controls.Add(this.label4);
this.groupBox2.Controls.Add(this.label3);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Controls.Add(this.label1);
this.groupBox2.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.groupBox2.ForeColor = System.Drawing.SystemColors.ActiveCaption;
this.groupBox2.Location = new System.Drawing.Point(184, 16);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(352, 296);
this.groupBox2.TabIndex = 2;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "费用细目";
//
// textBox7
//
this.textBox7.Location = new System.Drawing.Point(112, 264);
this.textBox7.Name = "textBox7";
this.textBox7.ReadOnly = true;
this.textBox7.Size = new System.Drawing.Size(192, 23);
this.textBox7.TabIndex = 13;
this.textBox7.Text = "";
//
// label7
//
this.label7.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label7.ForeColor = System.Drawing.SystemColors.ActiveCaption;
this.label7.Location = new System.Drawing.Point(24, 264);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(88, 24);
this.label7.TabIndex = 12;
this.label7.Text = "总计";
//
// textBox6
//
this.textBox6.Location = new System.Drawing.Point(112, 224);
this.textBox6.Name = "textBox6";
this.textBox6.ReadOnly = true;
this.textBox6.Size = new System.Drawing.Size(192, 23);
this.textBox6.TabIndex = 11;
this.textBox6.Text = "";
//
// textBox5
//
this.textBox5.Location = new System.Drawing.Point(112, 184);
this.textBox5.Name = "textBox5";
this.textBox5.ReadOnly = true;
this.textBox5.Size = new System.Drawing.Size(192, 23);
this.textBox5.TabIndex = 10;
this.textBox5.Text = "";
//
// textBox4
//
this.textBox4.Location = new System.Drawing.Point(112, 144);
this.textBox4.Name = "textBox4";
this.textBox4.ReadOnly = true;
this.textBox4.Size = new System.Drawing.Size(192, 23);
this.textBox4.TabIndex = 9;
this.textBox4.Text = "";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -