private void DoAddFirst(Control button) { Control _temp = button.NamingContainer; string main_key = (string)this.ViewState["main_key"]; string sub_key = (_temp.FindControl("textbox_sub_key") as TextBox).Text.Trim(); string content = (_temp.FindControl("textbox_content") as TextBox).Text.Trim(); string desc = (_temp.FindControl("textbox_description") as TextBox).Text.Trim(); if (string.IsNullOrEmpty(sub_key)) { ScriptHelper.AjaxAlertFocus(this.UpdatePanel1, "please input sub_key.", _temp.FindControl("textbox_sub_key")); return; } if (string.IsNullOrEmpty(content)) { ScriptHelper.AjaxAlertFocus(this.UpdatePanel1, "please input content", _temp.FindControl("textbox_content")); return; } SysCodeList entity = new SysCodeList(main_key, sub_key); entity.Content = content; entity.Description = desc; CodeBiz.InsertCodeList(entity); this.LoadData(); }
private void DoUpdate(Control button) { Control _temp = button.NamingContainer; string main_key = (string)this.ViewState["main_key"]; string sub_key = (_temp.FindControl("hidden_sub_key") as HtmlInputHidden).Value.Trim(); string content = (_temp.FindControl("textbox_content") as TextBox).Text.Trim(); string desc = (_temp.FindControl("textbox_description") as TextBox).Text.Trim(); if (string.IsNullOrEmpty(content)) { ScriptHelper.AjaxAlert(this.UpdatePanel1, "please input content"); return; } SysCodeList entity = new SysCodeList(main_key, sub_key); entity.Content = content; entity.Description = desc; CodeBiz.UpdateCodeList(entity); this.LoadData(); this.GridView1.EditIndex = -1; this.GridView1.DataBind(); }
private void DoDelete(Control button) { Control _temp = button.NamingContainer; string main_key = (string)this.ViewState["main_key"]; string sub_key = (_temp.FindControl("hidden_sub_key") as HtmlInputHidden).Value; SysCodeList entity = new SysCodeList(main_key, sub_key); CodeBiz.DeleteCodeList(entity); this.LoadData(); }
public static void DeleteCodeList(SysCodeList entity) { CodeDataAccess.DeleteCodeList(entity); }
public static void UpdateCodeList(SysCodeList entity) { CodeDataAccess.UpdateCodeList(entity); }
public static void InsertCodeList(SysCodeList entity) { CodeDataAccess.InsertCodeList(entity); }
public static void DeleteCodeList(SysCodeList entity) { SqlHelper.Delete(Config.ConnectionString, entity); }
public static void InsertCodeList(SysCodeList entity) { SqlHelper.Insert(Config.ConnectionString, entity); }