《实训八供应商信息管理.docx》由会员分享,可在线阅读,更多相关《实训八供应商信息管理.docx(7页珍藏版)》请在优知文库上搜索。
1、实训八供应商信息管理实训目的:实训内容:实训过程:1.制作供应商信息管理界面(gongyingshang.aspx)供应商添加版旗询名称I地址I电话:|Email:|联系人:|备注:|没加 ScrptNActrl供应商信息ScriptIaBacer供应有名称供应商地址供应荏电话效据绑定数宪绑定数据绑定故据绑定数据绑定数据绑定ffi效据绑定数据绑定数据绑定数据绑定数据绑定数据绑定ffiB效据绑定效据被数据绑定全部静态代码如下:title)无标题页/title) 供应商信息 供应商添加/修改/查询 /td &n
2、bsp; 名称: : :Email:联系人:备注:,CommandName=xiugai”修改2.编写动态代码(gongyingshang.aspx.es)usingSystem;usingSystem.Collections;usingSystem.Configuration;usingSystem.Data;usingSystem.Linq;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.ULHtmlControls;usingSystem.Web.ULWebC
3、ontrols;usingSystem.Web.ULWebControls.WebParts;usingSystem.Xml.Linq;publicpartialclassgongyingshang:System.Web.ULPage(DBfunctiondb=newDBfunctionO:protectedvoidPage_Load(objectsender,EventArgse)(db.isLogin();if(!IsPostBack)(binddata();)voidbinddata()GridViewl.DataSource=db.getDataView(*select*fromgys
4、);GridViewl.DataBindO;)protectedvoidButtonlClick(objectsender,EventArgse)(stringsqlcheck=”;stringsql=”;if(Sessiontquanxian*I=null&Session*quanxian*.ToStringO!=0)(ScriptManager.RegisterStartupScript(this,GetTypeO,alert(对不起,您的权限不够!),true);return;)else(if(TextBoxl.Text.TrimO.Length0&TextBox2.Text.Trim(
5、).Length0&TextBox3.Text.Trim().Length0&TextBox5.Text.TrimO.LengthO)(SqICheCk=select*fromgyswherecompany=*+TextBoxl.Text.TrimO+“andtel=+TextBox3.Text.TrimO+“andname=+TextBox5.Text.TrimO+if(!db.isExist(sqlcheck)(if(Buttonl.Text=添加)(sql=insertintogys(company,email,name,address,tel,beizhu)values(,+TextB
6、oxl.Text.TrimO+sql+=TextBox4.Text.TrimO+,+TextBox5.Text.TrimO+,+TextBox2.Text.TrimO+sql+=TextBox3.Text.TrimO+,+TextBox6.Text.TrimO+else(sql=updategyssetcompany=*+TeXtBoXLTeXt.Trim。+”,email=+TeXtBoX4.Text.Trim。+“,name=;sql+=TextBox5.Text.TrimO+,address=+TextBox2.Text.TrimO+,tel=+TextBox3.Text.TrimO+sql+=beizhu=+TextBox6.Text.TrimO+whereid=+ViewState*id*.ToStringO;db.SqlExecute(sql);Buttonl.Text=添加”;binddata();TextBoxl.Text=TextBox2.Text=TextBox3.Text=”;TextBox4.Text=TextBox5.Text=TextBox6.Text=TextBoxl.FocusO;)else(