📄 select.aspx.cs
字号:
if(mydata1.GetName(i)=="一")
this.H1.Text=mydata1.GetValue(i).ToString();
if(mydata1.GetName(i)=="二")
this.H2.Text=mydata1.GetValue(i).ToString();
if(mydata1.GetName(i)=="三")
this.H3.Text=mydata1.GetValue(i).ToString();
if(mydata1.GetName(i)=="四")
this.H4.Text=mydata1.GetValue(i).ToString();
if(mydata1.GetName(i)=="五")
this.H5.Text=mydata1.GetValue(i).ToString();
if(mydata1.GetName(i)=="六")
this.H6.Text=mydata1.GetValue(i).ToString();
}
}
mydata1.Close();
OleDbDataReader mydata2=comm2.ExecuteReader();
while(mydata2.Read())//厨房电器
{
for(int i=0;i<mydata2.FieldCount;i++)
{
if(mydata2.GetName(i)=="一")
this.H7.Text=mydata2.GetValue(i).ToString();
if(mydata2.GetName(i)=="二")
this.H8.Text=mydata2.GetValue(i).ToString();
if(mydata2.GetName(i)=="三")
this.H9.Text=mydata2.GetValue(i).ToString();
if(mydata2.GetName(i)=="四")
this.H10.Text=mydata2.GetValue(i).ToString();
if(mydata2.GetName(i)=="五")
this.H11.Text=mydata2.GetValue(i).ToString();
if(mydata2.GetName(i)=="六")
this.H12.Text=mydata2.GetValue(i).ToString();
}
}
mydata2.Close();
OleDbDataReader mydata3=comm3.ExecuteReader();
while(mydata3.Read())//其它电器
{
for(int i=0;i<mydata3.FieldCount;i++)
{
if(mydata3.GetName(i)=="一")
this.H13.Text=mydata3.GetValue(i).ToString();
if(mydata3.GetName(i)=="二")
this.H14.Text=mydata3.GetValue(i).ToString();
if(mydata3.GetName(i)=="三")
this.H15.Text=mydata3.GetValue(i).ToString();
if(mydata3.GetName(i)=="四")
this.H16.Text=mydata3.GetValue(i).ToString();
if(mydata3.GetName(i)=="五")
this.H17.Text=mydata3.GetValue(i).ToString();
if(mydata3.GetName(i)=="六")
this.H18.Text=mydata3.GetValue(i).ToString();
}
}
mydata3.Close();
conn.Close();
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.G1.Click += new System.EventHandler(this.G1_Click);
this.G2.Click += new System.EventHandler(this.G2_Click);
this.G3.Click += new System.EventHandler(this.G3_Click);
this.G4.Click += new System.EventHandler(this.G4_Click);
this.G5.Click += new System.EventHandler(this.G5_Click);
this.DropDownList2.SelectedIndexChanged += new System.EventHandler(this.DropDownList2_SelectedIndexChanged);
this.DropDownList2.PreRender += new System.EventHandler(this.DropDownList2_PreRender);
this.Bt1.Click += new System.EventHandler(this.Bt1_Click);
this.Bt2.Click += new System.EventHandler(this.Bt2_Click);
this.Bt3.Click += new System.EventHandler(this.Bt3_Click);
this.Bt4.Click += new System.EventHandler(this.Bt4_Click);
this.Bt5.Click += new System.EventHandler(this.Bt5_Click);
this.Bt6.Click += new System.EventHandler(this.Bt6_Click);
this.DropDownList1.SelectedIndexChanged += new System.EventHandler(this.DropDownList1_SelectedIndexChanged_1);
this.DropDownList1.PreRender += new System.EventHandler(this.DropDownList1_PreRender);
this.Btt1.Click += new System.EventHandler(this.Button15_Click);
this.Btt2.Click += new System.EventHandler(this.Button14_Click);
this.Btt3.Click += new System.EventHandler(this.Button13_Click);
this.Btt4.Click += new System.EventHandler(this.Button12_Click);
this.Btt5.Click += new System.EventHandler(this.Button11_Click);
this.Btt6.Click += new System.EventHandler(this.Btt6_Click);
this.QQ.SelectedIndexChanged += new System.EventHandler(this.QQ_SelectedIndexChanged);
this.QQ.PreRender += new System.EventHandler(this.QQ_PreRender);
this.QQ1.SelectedIndexChanged += new System.EventHandler(this.QQ1_SelectedIndexChanged);
this.seve3.Click += new System.EventHandler(this.seve3_Click);
this.clear3.Click += new System.EventHandler(this.Button10_Click);
this.butt9.Click += new System.EventHandler(this.butt9_Click);
this.butt10.Click += new System.EventHandler(this.butt10_Click);
this.butt11.Click += new System.EventHandler(this.butt11_Click);
this.butt12.Click += new System.EventHandler(this.butt12_Click);
this.DD.SelectedIndexChanged += new System.EventHandler(this.DD_SelectedIndexChanged);
this.DD.PreRender += new System.EventHandler(this.DD_PreRender);
this.DD1.SelectedIndexChanged += new System.EventHandler(this.DropDownList1_SelectedIndexChanged);
this.seve1.Click += new System.EventHandler(this.seve1_Click);
this.clear1.Click += new System.EventHandler(this.clear1_Click);
this.butt1.Click += new System.EventHandler(this.butt1_Click);
this.butt2.Click += new System.EventHandler(this.butt2_Click);
this.butt3.Click += new System.EventHandler(this.butt3_Click);
this.butt4.Click += new System.EventHandler(this.butt4_Click);
this.PP.SelectedIndexChanged += new System.EventHandler(this.PP_SelectedIndexChanged);
this.PP.PreRender += new System.EventHandler(this.PP_PreRender);
this.PP1.SelectedIndexChanged += new System.EventHandler(this.PP1_SelectedIndexChanged);
this.seve2.Click += new System.EventHandler(this.seve2_Click);
this.clear2.Click += new System.EventHandler(this.clear2_Click);
this.butt5.Click += new System.EventHandler(this.butt5_Click);
this.butt6.Click += new System.EventHandler(this.butt6_Click);
this.butt7.Click += new System.EventHandler(this.butt7_Click);
this.butt8.Click += new System.EventHandler(this.butt8_Click);
this.Button9.Click += new System.EventHandler(this.Button9_Click);
this.Button8.Click += new System.EventHandler(this.Button8_Click);
this.Button7.Click += new System.EventHandler(this.Button7_Click);
this.Button6.Click += new System.EventHandler(this.Button6_Click);
this.Button5.Click += new System.EventHandler(this.Button5_Click);
this.Button4.Click += new System.EventHandler(this.Button4_Click);
this.LinkButton1.Click += new System.EventHandler(this.LinkButton1_Click);
this.LinkButton2.Click += new System.EventHandler(this.LinkButton2_Click);
this.LinkButton3.Click += new System.EventHandler(this.LinkButton3_Click);
this.LinkButton4.Click += new System.EventHandler(this.LinkButton4_Click);
this.LinkButton5.Click += new System.EventHandler(this.LinkButton5_Click);
this.LinkButton6.Click += new System.EventHandler(this.LinkButton6_Click);
this.LinkButton7.Click += new System.EventHandler(this.LinkButton7_Click);
this.LinkButton8.Click += new System.EventHandler(this.LinkButton8_Click);
this.LinkButton13.Click += new System.EventHandler(this.LinkButton13_Click);
this.LinkButton14.Click += new System.EventHandler(this.LinkButton14_Click);
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Button2.Click += new System.EventHandler(this.Button2_Click);
this.Button3.Click += new System.EventHandler(this.Button3_Click);
this.buttonn3.Click += new System.EventHandler(this.buttonn3_Click);
this.buttonn1.Click += new System.EventHandler(this.buttonn1_Click);
this.butto2.Click += new System.EventHandler(this.butto2_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void LinkButton1_Click(object sender, System.EventArgs e)//生活类按钮
{
if(this.L2.Text=="管理员")
{
this.P1.Visible=true;
this.P2.Visible=false;
this.P3.Visible=false;
this.Table1.Visible=false;
this.Panel9.Visible=false;//登陆对话框
this.Panel10.Visible=true;
}
else
{
Response.Write("<script>window.alert('您的权限不够 请重新登陆!');</script>");
this.Panel9.Visible=true;//登陆对话框
this.Panel10.Visible=false;
}
}
private void LinkButton2_Click(object sender, System.EventArgs e)//厨房类按钮
{
if(this.L2.Text=="管理员")
{
this.P1.Visible=false;
this.P2.Visible=true;
this.P3.Visible=false;
this.Table1.Visible=false;
this.Panel9.Visible=false;//登陆对话框
this.Panel10.Visible=true;
}
else
{
Response.Write("<script>window.alert('您的权限不够 请重新登陆!');</script>");
this.Panel9.Visible=true;//登陆对话框
this.Panel10.Visible=false;
}
}
private void LinkButton3_Click(object sender, System.EventArgs e)//其它类按钮
{
if(this.L2.Text=="管理员")
{
this.P1.Visible=false;
this.P2.Visible=false;
this.P3.Visible=true;
this.Table1.Visible=false;
this.Panel9.Visible=false;//登陆对话框
this.Panel10.Visible=true;
}
else
{
Response.Write("<script>window.alert('您的权限不够 请重新登陆!');</script>");
this.Panel9.Visible=true;//登陆对话框
this.Panel10.Visible=false;
}
}
private void Button3_Click(object sender, System.EventArgs e)//返回
{
Response.Redirect("cpinex.aspx");
}
private void Button4_Click(object sender, System.EventArgs e)//返回
{
Response.Redirect("cpinex.aspx");
}
private void Button7_Click(object sender, System.EventArgs e)//返回
{
Response.Redirect("cpinex.aspx");
}
private void Button2_Click(object sender, System.EventArgs e)
{
this.T1.Text="";
this.T2.Text="";
this.T3.Text="";
this.T4.Text="";
this.T5.Text="";
this.T6.Text="";
this.Panel10.Visible=true;//登陆窗口
this.Panel9.Visible=false;
}
private void Button5_Click(object sender, System.EventArgs e)
{
this.T7.Text="";
this.T8.Text="";
this.T9.Text="";
this.T10.Text="";
this.T11.Text="";
this.T12.Text="";
this.Panel10.Visible=true;//登陆窗口
this.Panel9.Visible=false;
}
private void Button8_Click(object sender, System.EventArgs e)
{
this.T13.Text="";
this.T14.Text="";
this.T15.Text="";
this.T16.Text="";
this.T17.Text="";
this.T18.Text="";
this.Panel10.Visible=true;//登陆窗口
this.Panel9.Visible=false;
}
private void Button1_Click(object sender, System.EventArgs e)
{
if(this.T1.Text=="")
{
this.T1.Text=this.H1.Text;
}
if(this.T2.Text=="")
{
this.T2.Text=this.H2.Text;
}
if(this.T3.Text=="")
{
this.T3.Text=this.H3.Text;
}
if(this.T4.Text=="")
{
this.T4.Text=this.H4.Text;
}
if(this.T5.Text=="")
{
this.T5.Text=this.H5.Text;
}
if(this.T6.Text=="")
{
this.T6.Text=this.H6.Text;
}
string connstr=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath(@".\databast.mdb");
OleDbConnection conn=new OleDbConnection(connstr);
conn.Open();
string sql="update 家用电器 set 一='"+this.T1.Text+"',二='"+this.T2.Text+"',三='"+this.T3.Text+"',四='"+this.T5.Text+"',五='"+this.T4.Text+"',六='"+this.T6.Text+"'";
OleDbCommand comm=new OleDbCommand(sql,conn);
comm.ExecuteNonQuery();
Response.Write("<script>window.alert('修改成功,管理员请到数据库更改相关表格!');</script>");
this.Panel10.Visible=true;//登陆窗口
this.Panel9.Visible=false;
}
private void Button6_Click(object sender, System.EventArgs e)
{
if(this.T7.Text=="")
{
this.T7.Text=this.H7.Text;
}
if(this.T8.Text=="")
{
this.T8.Text=this.H8.Text;
}
if(this.T9.Text=="")
{
this.T9.Text=this.H9.Text;
}
if(this.T10.Text=="")
{
this.T10.Text=this.H10.Text;
}
if(this.T11.Text=="")
{
this.T11.Text=this.H11.Text;
}
if(this.T12.Text=="")
{
this.T12.Text=this.H12.Text;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -