还剩5页未读,继续阅读
文本内容:
实训八供应商信息管理实训目的:实训内容:实训过程
1.制作供应商信息管理界面gongyingshang.aspxScriptl**cer-ScriptMfg”l全部静态代码如卜.%@PageLanguagc=C#AutoEvcntWiroup=/,truc,zCodcFilc=/,gongyingshang.aspx.cs/zTnherits-z,gongyingshang7%headrunat=server”1111€无标题页/1“12》/headbodyformid=formlrunat=server”divasp:ScriptManager1D=zScriptManager1wrunat=server”/asp:ScriptManagerasp:UpdatePanelID=/,UpdatePanel1/zrunat=server”ContcntTcinplatotablecelIpadding=0cel1spacing=0style=/zborder:Ipxsolid#3333FF;font-size:14px;width=800”align=center”trtdbgcolor=#6699FFheight=*30*nbsp;nbsp;nbsp;供应商信息nbsp;/td/trasp:TcxtBoxID=TcxtBox5”runat=z,serverw/asp:TextBoxrunat=*scrver/*/asp:TcxtBoxBorderStyle=S1idBorderWidlh=z,1px”onrowdeleting=GridViewlRowDeleting”Cmmand\ame=xiugai”修改/asp:LinkButtonHorizontalAlign=Lcft/Se1ectedRowStyleBackColor=”#009999”Font-Bold=TrueForeColor=#CCFF99/HeaderStyleBackColor=#6699FFFont-Bold=TrueForeColor=Black”//asp:GridView/td/tr〈/table〉/ContentTemplate/asp:UpdatePanel/div/form/body/html
2.编写动态代码gongyingshang.aspx.esusingSystem;usingSystem.Collections;usingSystem.Configuration;usingSystem.Data;usingSystem.Linq;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.HtmlControls;usingSystem.Web.UI.WcbControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Xml.Linq;publicpartialclassgongyingshang:System.Web.UI.PageDBfunctiondb=newDBfunctionO;protectedvoidPageLoadobjectsenderl vcntArgsodb.isLoginO;if!IsPostBackbinddataO;voidbinddataOGridViewl.DataSource=db.getDataViewselect*fromgys;GridViewl.DataBindO;protectedvoidButtonl_ClickobjectsenderliventArgsestringsqlcheck=stringsql=ifSession[quanxian]!=nul1Session[wquanxian/,].ToStringO!=0ScriptManager.RegisterStartupScriptthisGetTypealert对不起您的权限不够!’,true return;elseifTextBoxl.Text.TrimO.Length0TcxtBox
2.Text.TrimO.Length0TextBox
3.Text.Trim.Length0TextBox
5.Text.TrimO.Length0{sqlchcck=scleci*fromgyswherecompany=,+TextBoxl.Text.TrimO+andtel=+TextBox
3.Text.TrimO+andname=+TextBox
5.Text.TrimO+if!db.isExistsqlcheck{ifButtonl.Text==添加sql=insertintogyscompanyemai1nameaddresstelbeizhuvalues+TextBoxl.Text.TrimO+sql+=TextBox
4.Text.TrimO++TextBox
5.Text.TrimO++TextBox
2.Text.TrimO+sql+=TextBox
3.Text.TrimO++TextBox
6.Text.TrimO+}elsesql=updategyssetcompany』+TextBoxl.Text.TrimOemail=+TextBox
4.Text.Trim+W,name=,*;sql+=TextBox
5.Text.TrimO+address=+TextBox
2.Text.TrimO++TextBox
3.Text.TrimO+sql+=beizhu=+TextBox
6.Text.Trim+whereid=+ViewState[id].ToStringO;db.sqlExecutesql;Buttonl.Text=添加;binddataO;TextBoxl.Text=TextBox
2.Text=TextBox
3.Text=TextBox
4.Text=TextBox
5.Text=TexlBox
6.Text=TextBoxl.Focus0;else{ScriptManager.RegisterStartupScriptthisGetTypealert该记录已经存在!true;}elseScriptManager.RegisterStartupScriptthisGetTypealert供应商名称、供应商电话与联系人姓名不能为空,true;}IprotectedvoidGridViewlRowDelotingobjectsenderGridVicwDe1ctcEventArgscifSession[quanxian]!=nullSession[^quanxian^].ToStringO!=0{ScriptManager.RegisterStartupScriptthisGetType0alert对不起您的权限不够!’,true;return;}elsedb.sqlExecutedeletefromgyswhereid=+GridViewl.DataKeys[e.Rowindex].Value;binddataO;protectedvoidGridViewl_RowCommanclobjectsenderGridViewCommandEvent/Vrgseintid;DeitciRowdr;ifSession[^quanxian*]!=nullSession[quanxian].ToStringO!=0{ScriptManager.RegisterStartupScriptthisGetTypealert对不起您的权限不够!true;return;elseViewState[id]=id;dr=db.getDataRowCselcct*fromgyswhereid=+id;=dr[company].ToStringO;=dr[address].ToStringO;=dr[tel].ToStringO;=drE^emaiK].ToStringO;=dr[name].ToStringO;=dr[beizhu].ToStringO;储存;style=/,border:Ipxsolid#6699FF;margin-bottom:10px/width=100旷》trtdbgcolor=#6699FFc()lspan=4height=30”nbsp;供应商添加/修改/查询nbsp;/tdtdbgcolor=/,t6699IT,/hcighl=30”nbsp;/tdtdbgcolor=#6699FFheight=30”nbsp;/tdtdbgcolor=#6699FFheight=30”nbsp;/td/trtrtdnbsp;名称/tdtdasp:TextBoxID=TextBoxl“runat=server”Widlh=/z129px*X/asp:TextBox/tdtdhoight=,,30,/tdasp:TextBoxID=TextBox2runat=server”Widlh=*200px*/asp:TextBox/tdtdtdasp:TextBoxID=TcxlBox3”iunat=,server*/asp:TextBox/tdtdnbsp;/td/trtrtdnbsp;Email:/tdtdasp:TextBoxID=TextBox4”runat=^serverwX/asp:TextBox/tdtdheight=30”联系人:/ldtd/tdtd备注:/tdtdasp:TextBoxID=TextBox6”/tdtdasp:ButtonID=Buttonl“runat=server”Text=添加Width=103px”onclick=*Butlonl_Click,///td/tr/tableasp:GridViowlD=GridVicwl“runat=server”AutoGenerateCo1umns=Fa]se”BackColor=,/White/zBorderColor=#6699FF”CellPadding=w4,zWidth=100*DataKeyNames=id”onrowconunand=z,GridViewlRowConunand/zFooterStyleBackCo1or=^99CCCCForeCo1or=^003399/RowStyleBackCo1or=*White/zForeColor=#003399”/Columnsasp:BoundFieldDataFie1d=/,companywHeaderText=,z供应商名称〃/asp:BoundFieldDataField=address“HeaderText=z,供应商地址〃/asp:BoundFieldDataField=telHeaderText=供应商电话〃/asp:TemplateFieldItemTemplateasp:LinkButtonlD=LinkButtonl”runat=server”CommandArgument=,Evalid%/ItemTemplate/asp:TemplateFieldasp:CommandFieldSho\vDeleteButton=,,Truew//ColumnsPagerStyleBackCo]or=z,#99CCCCwForeColor=”#003399。
个人认证
优秀文档
获得点赞 0