protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DictTypeOperator.Bind(this.cbTypeName); if (Request.Params["id"] != null) { Dict entity = SimpleOrmOperator.Query <Dict>(Convert.ToInt32(Request.Params["id"])); WebFormHelper.SetDataToForm(this, entity); } } }
protected void DataGrid1_ItemCommand1(object source, DataGridCommandEventArgs e) { if (e.CommandName == "Delete") { int id = Convert.ToInt32(e.CommandArgument); DictTypeOperator.Delete(id); WebTools.Alert(this, "删除成功!"); this.SimplePager1.Changed = true; } else if (e.CommandName == "Detail") { int id = Convert.ToInt32(e.CommandArgument); this.Pop(id); } }