Пример #1
0
    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();
    }
Пример #2
0
    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();
    }
Пример #3
0
    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();
    }
Пример #4
0
 public static void DeleteCodeList(SysCodeList entity)
 {
     CodeDataAccess.DeleteCodeList(entity);
 }
Пример #5
0
 public static void UpdateCodeList(SysCodeList entity)
 {
     CodeDataAccess.UpdateCodeList(entity);
 }
Пример #6
0
 public static void InsertCodeList(SysCodeList entity)
 {
     CodeDataAccess.InsertCodeList(entity);
 }
Пример #7
0
 public static void DeleteCodeList(SysCodeList entity)
 {
     SqlHelper.Delete(Config.ConnectionString, entity);
 }
Пример #8
0
 public static void InsertCodeList(SysCodeList entity)
 {
     SqlHelper.Insert(Config.ConnectionString, entity);
 }