cpinex.aspx.cs
来自「主要功能: 1、 包括顾客信息、货品信息、定单信息的管理。 2、」· CS 代码 · 共 1,483 行 · 第 1/4 页
CS
1,483 行
this.H13.Enabled=true;
this.H14.Enabled=true;
this.H15.Enabled=true;
this.H16.Enabled=true;
this.H17.Enabled=true;
this.H18.Enabled=true;
this.Panel4.Visible=true;//产品标题
this.Label2.Visible=true;//横线
this.Image24.Visible=false;//竖图
this.Image25.Visible=false;//横图
this.Panel5.Visible=false;//保养
this.Panel6.Visible=false;//维修
string connstr=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath(@".\databast.mdb");
OleDbConnection conn=new OleDbConnection(connstr);
string sql="select * from 欧式烟机";
OleDbDataAdapter mydata=new OleDbDataAdapter(sql,conn);
DataSet sa=new DataSet();
mydata.Fill(sa,"欧式烟机");
if(sa.Tables["欧式烟机"].Rows.Count>0)
{
this.DataGrid10.DataSource=sa.Tables["欧式烟机"].DefaultView;//获取里面的数据并存入DataGrid数据源中
this.DataGrid10.DataBind();
}
else
{
this.Label6.Visible=true;//数据不存在激活label6
this.Label7.Visible=true;//横线
}
}
private void BindData9()//第九排数据重绑数据调用函数
{
string connstr=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath(@".\databast.mdb");
OleDbConnection conn=new OleDbConnection(connstr);
conn.Open();
string sqlstr= "select * from 欧式烟机";
OleDbDataAdapter dataAdapter = new OleDbDataAdapter(sqlstr,connstr);
DataSet ds =new DataSet();
dataAdapter.Fill(ds,"欧式烟机");
conn.Close();
this.DataGrid10.DataSource=ds;
this.DataGrid10.DataBind();
}
private void DataGrid10_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
this.DataGrid10.CurrentPageIndex=e.NewPageIndex;//设置当前页的索引值为用户选择的页的索引
BindData9();
this.Panel4.Visible=true;//产品标题
this.Label2.Visible=true;//横线
this.Image24.Visible=false;//竖图
this.Image25.Visible=false;//横图
this.Panel5.Visible=false;//保养
this.Panel6.Visible=false;//维修
}
private void H10_Click(object sender, System.EventArgs e)
{
this.Label6.Visible=false;
this.Label7.Visible=false;//暂无货物控件
this.Pdata1.Visible=false;//数据表格控件
this.Pdata2.Visible=false;
this.Pdata3.Visible=false;
this.Pdata4.Visible=false;
this.Pdata5.Visible=false;
this.Pdata6.Visible=false;
this.Pdata7.Visible=false;
this.Pdata8.Visible=false;
this.Pdata9.Visible=false;
this.Pdata10.Visible=true;
this.Pdata11.Visible=false;
this.Pselet.Visible=false;//搜索
this.H1.Enabled=true;//一
this.H2.Enabled=true;//二
this.H3.Enabled=true;//三
this.H4.Enabled=true;//四
this.H5.Enabled=true;//五
this.H6.Enabled=true;//六
this.H7.Enabled=true;
this.H8.Enabled=true;
this.H9.Enabled=true;
this.H10.Enabled=false;
this.H11.Enabled=true;
this.H12.Enabled=true;
this.H13.Enabled=true;
this.H14.Enabled=true;
this.H15.Enabled=true;
this.H16.Enabled=true;
this.H17.Enabled=true;
this.H18.Enabled=true;
this.Panel4.Visible=true;//产品标题
this.Label2.Visible=true;//横线
this.Image24.Visible=false;//竖图
this.Image25.Visible=false;//横图
this.Panel5.Visible=false;//保养
this.Panel6.Visible=false;//维修
string connstr=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath(@".\databast.mdb");
OleDbConnection conn=new OleDbConnection(connstr);
string sql="select * from 电磁炉";
OleDbDataAdapter mydata=new OleDbDataAdapter(sql,conn);
DataSet sa=new DataSet();
mydata.Fill(sa,"电磁炉");
if(sa.Tables["电磁炉"].Rows.Count>0)
{
this.DataGrid11.DataSource=sa.Tables["电磁炉"].DefaultView;//获取里面的数据并存入DataGrid数据源中
this.DataGrid11.DataBind();
}
else
{
this.Label6.Visible=true;//数据不存在激活label6
this.Label7.Visible=true;//横线
}
}
private void BindData10()//第十排数据重绑数据调用函数
{
string connstr=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath(@".\databast.mdb");
OleDbConnection conn=new OleDbConnection(connstr);
conn.Open();
string sqlstr= "select * from 电磁炉";
OleDbDataAdapter dataAdapter = new OleDbDataAdapter(sqlstr,connstr);
DataSet ds =new DataSet();
dataAdapter.Fill(ds,"电磁炉");
conn.Close();
this.DataGrid11.DataSource=ds;
this.DataGrid11.DataBind();
}
private void DataGrid11_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
this.DataGrid11.CurrentPageIndex=e.NewPageIndex;//设置当前页的索引值为用户选择的页的索引
BindData10();
this.Panel4.Visible=true;//产品标题
this.Label2.Visible=true;//横线
this.Image24.Visible=false;//竖图
this.Image25.Visible=false;//横图
this.Panel5.Visible=false;//保养
this.Panel6.Visible=false;//维修
}
private void H11_Click(object sender, System.EventArgs e)
{
this.Label6.Visible=false;
this.Label7.Visible=false;//暂无货物控件
this.Pdata1.Visible=false;//数据表格控件
this.Pdata2.Visible=false;
this.Pdata3.Visible=false;
this.Pdata4.Visible=false;
this.Pdata5.Visible=false;
this.Pdata6.Visible=false;
this.Pdata7.Visible=false;
this.Pdata8.Visible=false;
this.Pdata9.Visible=false;
this.Pdata10.Visible=false;
this.Pdata11.Visible=true;
this.Pselet.Visible=false;//搜索
this.H1.Enabled=true;//一
this.H2.Enabled=true;//二
this.H3.Enabled=true;//三
this.H4.Enabled=true;//四
this.H5.Enabled=true;//五
this.H6.Enabled=true;//六
this.H7.Enabled=true;
this.H8.Enabled=true;
this.H9.Enabled=true;
this.H10.Enabled=true;
this.H11.Enabled=false;
this.H12.Enabled=true;
this.H13.Enabled=true;
this.H14.Enabled=true;
this.H15.Enabled=true;
this.H16.Enabled=true;
this.H17.Enabled=true;
this.H18.Enabled=true;
this.Panel4.Visible=true;//产品标题
this.Label2.Visible=true;//横线
this.Image24.Visible=false;//竖图
this.Image25.Visible=false;//横图
this.Panel5.Visible=false;//保养
this.Panel6.Visible=false;//维修
string connstr=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath(@".\databast.mdb");
OleDbConnection conn=new OleDbConnection(connstr);
string sql="select * from 微波炉";
OleDbDataAdapter mydata=new OleDbDataAdapter(sql,conn);
DataSet sa=new DataSet();
mydata.Fill(sa,"微波炉");
if(sa.Tables["微波炉"].Rows.Count>0)
{
this.DataGrid12.DataSource=sa.Tables["微波炉"].DefaultView;//获取里面的数据并存入DataGrid数据源中
this.DataGrid12.DataBind();
}
else
{
this.Label6.Visible=true;//数据不存在激活label6
this.Label7.Visible=true;//横线
}
}
private void BindData11()//第十一排数据重绑数据调用函数
{
string connstr=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath(@".\databast.mdb");
OleDbConnection conn=new OleDbConnection(connstr);
conn.Open();
string sqlstr= "select * from 微波炉";
OleDbDataAdapter dataAdapter = new OleDbDataAdapter(sqlstr,connstr);
DataSet ds =new DataSet();
dataAdapter.Fill(ds,"微波炉");
conn.Close();
this.DataGrid12.DataSource=ds;
this.DataGrid12.DataBind();
}
private void DataGrid12_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
this.DataGrid12.CurrentPageIndex=e.NewPageIndex;//设置当前页的索引值为用户选择的页的索引
BindData11();
this.Panel4.Visible=true;//产品标题
this.Label2.Visible=true;//横线
this.Image24.Visible=false;//竖图
this.Image25.Visible=false;//横图
this.Panel5.Visible=false;//保养
this.Panel6.Visible=false;//维修
}
private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)//响应选项
{
this.DropDownList2.Items.Clear();//清除之前记录
string connstr=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath(@".\databast.mdb");
OleDbConnection conn=new OleDbConnection(connstr);
string sqlstr2="select 产品售价 from "+this.DropDownList1.SelectedItem+" where 产品售价";
OleDbDataAdapter adapter2=new OleDbDataAdapter(sqlstr2,conn);
DataSet da2=new DataSet();
adapter2.Fill(da2,""+this.DropDownList1.SelectedIndex+"");
for(int j=0;j<da2.Tables[""+this.DropDownList1.SelectedIndex+""].Rows.Count;j++)
{
this.DropDownList2.Items.Add(da2.Tables[""+this.DropDownList1.SelectedIndex+""].Rows[j][0].ToString().Trim());
}
this.Label6.Visible=false;
this.Label7.Visible=false;//暂无货物控件
this.Pdata1.Visible=false;//数据表格控件
this.Pdata2.Visible=false;
this.Pdata3.Visible=false;
this.Pdata4.Visible=false;
this.Pdata5.Visible=false;
this.Pdata6.Visible=false;
this.Pdata7.Visible=false;
this.Pdata8.Visible=false;
this.Pdata9.Visible=false;
this.Pdata10.Visible=false;
this.Pdata11.Visible=false;
this.Pselet.Visible=false;//搜索
this.H1.Enabled=true;//一
this.H2.Enabled=true;//二
this.H3.Enabled=true;//三
this.H4.Enabled=true;//四
this.H5.Enabled=true;//五
this.H6.Enabled=true;//六
this.H7.Enabled=true;
this.H8.Enabled=true;
this.H9.Enabled=true;
this.H10.Enabled=true;
this.H11.Enabled=true;
this.H12.Enabled=true;
this.H13.Enabled=true;
this.H14.Enabled=true;
this.H15.Enabled=true;
this.H16.Enabled=true;
this.H17.Enabled=true;
this.H18.Enabled=true;
this.Image24.Visible=true;//竖图
this.Image25.Visible=true;//横图
this.Panel5.Visible=true;//保养
this.Panel6.Visible=true;//维修
}
private void DropDownList1_PreRender(object sender, System.EventArgs e)//加载时调用数据库
{
if(!IsPostBack)
{
string connstr=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath(@".\databast.mdb");
OleDbConnection conn=new OleDbConnection(connstr);
string sqlstr="select 搜索标题 from 搜索";
OleDbDataAdapter adapter=new OleDbDataAdapter(sqlstr,conn);
DataSet da=new DataSet();
adapter.Fill(da,"搜索");
for(int i=0;i<da.Tables["搜索"].Rows.Count;i++)
{
this.DropDownList1.Items.Add(da.Tables["搜索"].Rows[i][0].ToString().Trim());
}
string sqlstr2="select 产品售价 from "+this.DropDownList1.SelectedItem+" where 产品售价";
OleDbDataAdapter adapter2=new OleDbDataAdapter(sqlstr2,conn);
DataSet da2=new DataSet();
adapter2.Fill(da2,""+this.DropDownList1.SelectedIndex+"");
for(int j=0;j<da2.Tables[""+this.DropDownList1.SelectedIndex+""].Rows.Count;j++)
{
this.DropDownList2.Items.Add(da2.Tables[""+this.DropDownList1.SelectedIndex+""].Rows[j][0].ToString().Trim());
}
}
}
private void Button1_Click(object sender, System.EventArgs e)//搜索按钮
{
try
{
string connstr=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath(@".\databast.mdb");
OleDbConnection conn=new OleDbConnection(connstr);
conn.Open();
string sqlstr3="select * from "+this.DropDownList1.SelectedItem+" where 产品售价 like '"+this.DropDownList2.SelectedItem+"'";
OleDbDataAdapter adapter3=new OleDbDataAdapter(sqlstr3,conn);
DataSet da3=new DataSet();
adapter3.Fill(da3,""+this.DropDownList1.SelectedItem+"");
conn.Close();
this.DataGrid13.DataSource=da3;
this.DataGrid13.DataBind();
this.Label6.Visible=false;
this.Label7.Visible=false;//暂无货物控件
this.Pdata1.Visible=false;//数据表格控件
this.Pdata2.Visible=false;
this.Pdata3.Visible=false;
this.Pdata4.Visible=false;
this.Pdata5.Visible=false;
this.Pdata6.Visible=false;
this.Pdata7.Visible=false;
this.Pdata8.Visible=false;
this.Pdata9.Visible=false;
this.Pdata10.Visible=false;
this.Pdata11.Visible=false;
this.Pselet.Visible=true;//搜索
this.H1.Enabled=true;//一
this.H2.Enabled=true;//二
this.H3.Enabled=true;//三
this.H4.Enabled=true;//四
this.H5.Enabled=true;//五
this.H6.Enabled=true;//六
this.H7.Enabled=true;
this.H8.Enabled=true;
this.H9.Enabled=true;
this.H10.Enabled=true;
this.H11.Enabled=true;
this.H12.Enabled=true;
this.H13.Enabled=true;
this.H14.Enabled=true;
this.H15.Enabled=true;
this.H16.Enabled=true;
this.H17.Enabled=true;
this.H18.Enabled=true;
this.Panel4.Visible=true;//产品标题
this.Label2.Visible=true;//横线
this.Image24.Visible=false;//竖图
this.Image25.Visible=false;//横图
this.Panel5.Visible=false;//保养
this.Panel6.Visible=false;//维修
}
catch
{
this.Panel4.Visible=true;//产品标题
this.Label2.Visible=true;//横线
this.Label6.Visible=true;
this.Label7.Visible=true;//暂无货物控件
}
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?