protected void DataGrid_Update(object sender, DataGridCommandEventArgs e) { ArticleClass tp = new ArticleClass(); ArticleClassInfo info = new ArticleClassInfo(); info.ClassName = ((TextBox)e.Item.FindControl("className")).Text; string id = detail.DataKeys[(int)e.Item.ItemIndex].ToString(); int idn = Int32.Parse(id); info.id = idn; tp.editType(info); detail.EditItemIndex = -1; setBind(); }
protected void save_ServerClick(object sender, EventArgs e) { ArticleClass tp = new ArticleClass(); ArticleClassInfo info = new ArticleClassInfo(); info.ClassName = className.Value.ToString(); string txt; if (!isAt("id")) { tp.addType(info); txt = "添加成功"; } else { info.ClassName = className.Value.ToString(); info.id = getId("id"); tp.editType(info); txt = "修改成功"; } showMessage(txt, "gl_type.aspx"); }