<asp:gridview id= "Gvsecondtype" runat= "Server" autogeneratecolumns= "False" style= "position:relative" Width= "100% "Cellpadding=" 4 "backcolor=" White "bordercolor=" #3366CC "borderstyle=" None "borderwidth=" 1px "allowpaging=" True " onpageindexchanging= "gvsecondtype_pageindexchanging" onrowcommand= "Gvsecondtype_rowcommand" >
<Columns>
<asp:templatefield headertext= "Subordinate Classification" >
<EditItemTemplate>
<asp:textbox id= "TextBox3" runat= "Server" ></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:label id= "Lblname" runat= "Server" style= "position:relative" text= ' <% #Eval ("parent_typename1")%> ' > </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:boundfield datafield= "id" headertext= "Category ID"/>
<asp:boundfield datafield= "type_name" headertext= "classification name"/>
<asp:boundfield datafield= "parent_id" headertext= "parent class"/>
<asp:boundfield datafield= "Type_addtime" headertext= "Add Time"/>
<asp:templatefield headertext= "Edit" >
<EditItemTemplate>
<asp:textbox id= "TextBox1" runat= "Server" ></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<div style= "width:70px;line-height:20px; Cursor:pointer;background-color: #CCCCCC; Border:solid 1px #000000; "><a style=" text-decoration:none; Cursor:pointer "href= ' modifysecondtype.aspx?" typeid=<% #Eval ("Id")%> ' > Modify </a></div>
</ItemTemplate>
</asp:TemplateField>
<asp:templatefield headertext= "Delete" >
<EditItemTemplate>
<asp:textbox id= "TextBox2" runat= "Server" ></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<div onmouseover= "javascript:this.style.cursor= ' Hand '" style= "width:70px; Line-height:20px;background-color: #CCCCCC; border:solid 1px #000000; " > <asp:linkbutton id= "LinkButton1" Commandname= "del" commandargument= ' <%# Eval ("parent_id") + "," +eval ("ID") %> ' runat= "Server" > Delete </asp:LinkButton></div>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<footerstyle backcolor= "#99CCCC" forecolor= "#003399"/>
<rowstyle backcolor= "White" forecolor= "#003399"/>
<selectedrowstyle backcolor= "#009999" font-bold= "True" forecolor= "#CCFF99"/>
<pagerstyle backcolor= "#99CCCC" forecolor= "#003399" horizontalalign= "left"/>
</asp:GridView>
protected void Gvsecondtype_rowcommand (object sender, Gridviewcommandeventargs e)
{
string cmdName = E.commandname;
if (cmdName = "del")
{
string[] Estr = e.commandargument.tostring (). Split (', ');
int parent_id = Convert.ToInt32 (estr[0]);
int typeid = Convert.ToInt32 (estr[1]);
BOOL flag = YHTBLL. Second_typemanage.deltypebyid (parent_id, typeid);
if (flag)
{
this. Literal1.text = "Delete succeeded";
bind ();
}
Else
{
This. Literal1.text = "Delete Failed";
Bind ();
}
}
}