public Listinfo() { gnum(ref typeId, "typeid"); ArticleClass dal = new ArticleClass(); typetitle = dal.get_typename(typeId).ClassName; flg_nav = "listinfo"; pagetitle = "ÔÚÏß×ÊÁÏ"; }
public void DataGrid_Del(object sender, DataGridCommandEventArgs e) { int id = (int)detail.DataKeys[e.Item.ItemIndex]; ArticleClass at = new ArticleClass(); if (at.delType(id)) { setBind(); showMessage("删除成功"); } else showMessage("删除失败"); }
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 Page_Load(object sender, EventArgs e) { string toid = Request.QueryString["id"]; classid = 0; gnum(ref classid, "classid"); if (toid != null) id = Int32.Parse(toid); app = Request.QueryString["app"]; if (!IsPostBack) { ArticleClass dal = new ArticleClass(); classId.DataSource = dal.view_list(); classId.DataBind(); if (app == "edit") editArticle(id); } }
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"); }