实训七产品小类管理5750.pdf
实训七 产品小类管理 实训目的:实训内容:实训过程:1.界面制作页面)该页面全部静态代码如下:!DOCTYPE html PUBLIC-oString()!=0)(this,GetType(),alert(对不起,您的权限不够!),true);return;else if if(!(select*from smallClass where smallID=+TextB and smallName=and bigid=)(insert into smallClass(smallName,smallID,bigID)values(,);binddata();else (this,GetType(),alert(小类编号或小类名称不能相同!),true);else (this,GetType(),alert(小类名称和小类编号不能为空),true);protected void GridView1_RowUpdating(object sender,GridViewUpdateEventArgs e)TextBox tbsmallName,tbsmallID;DropDownList drpBigClass;string sqlcheck=,sqlupdate=;tbsmallID=(TextBox).Cells2.Controls0;tbsmallName=(TextBox).Cells1.Controls0;drpBigClass=(DropDownList).Cells0.FindControl(DropDownList2);if sqlcheck=select*from(select*from smallclass where id+.Value+)as t1 where smallid=or smallname=;if(!(sqlcheck)(update smallClass set smallName=,smallID=,bigID=where id=+.Value);=-1;binddata();else (this,GetType(),alert(小类编号或小类名称不能相同),true);oString()!=0)(this,GetType(),alert(对不起,您的权限不够!),true);return;else =;binddata();protected void GridView1_RowDeleting1(object sender,GridViewDeleteEventArgs e)if(Sessionquanxian!=null&Sessionquanxian.ToString()!=0)(this,GetType(),alert(对不起,您的权限不够!),true);return;else (delete from smallClass where id=+.Value);binddata();protected void GridView1_RowCancelingEdit(object sender,GridViewCancelEditEventArgs e)=-1;binddata();protected void GridView1_RowDataBound(object sender,GridViewRowEventArgs e)DataRow dr;Label Lb;DropDownList ddl;HiddenField hf;onmouseover,);onmouseout,);Lb=(LabelLabel1);hf=(HiddenFieldHiddenField2);dr=(select*from bigClass where bigid=);=drbigname.ToString();|)ddl=(DropDownListDropDownList2);hf=(HiddenFieldHiddenField1);(ddl,select*from bigclass,bigname,bigID