protected void btnSave_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(this.txtCategoryName.Text.Trim()))
            {
                int DicCateID = DataConverter.CLng(this.HdnDicCateID.Value);

                if (DicCateID > 0)
                {
                    M_DicCategory info = B_DataDicCategory.GetDicCate(DicCateID);
                    info.CategoryName = this.txtCategoryName.Text.Trim();
                    B_DataDicCategory.Update(info);
                }
                else
                {
                    M_DicCategory info = new M_DicCategory();
                    info.DicCateID    = 0;
                    info.CategoryName = this.txtCategoryName.Text.Trim();
                    info.IsUsed       = true;
                    B_DataDicCategory.AddCate(info);
                }
                this.txtCategoryName.Text = "";
                this.HdnDicCateID.Value   = "0";
                this.btnSave.Text         = "添加";
                dBind();
            }
        }
 protected void btnSetUsed_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(Request.Form["idchk"]))
     {
         B_DataDicCategory.SetUsedByArr(Request.Form["idchk"], true);
         dBind();
     }
 }
 protected void btndelete_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(Request.Form["idchk"]))
     {
         B_DataDicCategory.DelCate(Request.Form["idchk"]);
         dBind();
     }
 }
Exemplo n.º 4
0
        public ContentResult DictCate_API()
        {
            string action = GetParam("action");
            string ids    = GetParam("ids");

            switch (action)
            {
            case "del":
                B_DataDicCategory.DelCate(ids);
                break;

            case "use":
                B_DataDicCategory.SetUsedByArr(ids, true);
                break;

            case "unuse":
                B_DataDicCategory.SetUsedByArr(ids, false);
                break;

            case "save":    //新增或修改
            {
                string name = GetParam("name");
                if (string.IsNullOrEmpty(name))
                {
                    return(Content(Failed.ToString()));
                }
                if (Mid > 0)
                {
                    M_DicCategory info = B_DataDicCategory.GetDicCate(Mid);
                    info.CategoryName = name;
                    B_DataDicCategory.Update(info);
                }
                else
                {
                    M_DicCategory info = new M_DicCategory();
                    info.DicCateID    = 0;
                    info.CategoryName = name;
                    info.IsUsed       = true;
                    B_DataDicCategory.AddCate(info);
                }
            }
            break;
            }
            return(Content(Success.ToString()));
        }
 protected void Lnk_Click(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Del")
     {
         string Id = e.CommandArgument.ToString();
         B_DataDicCategory.DelCate(DataConverter.CLng(Id));
         dBind();
     }
     if (e.CommandName == "Edit")
     {
         string        Id   = e.CommandArgument.ToString();
         M_DicCategory info = B_DataDicCategory.GetDicCate(DataConverter.CLng(Id));
         this.txtCategoryName.Text = info.CategoryName;
         this.HdnDicCateID.Value   = Id;
         this.btnSave.Text         = "修改";
     }
     if (e.CommandName == "DicList")
     {
         Response.Redirect("Dictionary.aspx?CateID=" + e.CommandArgument.ToString());
     }
 }
Exemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         int DicCateID = string.IsNullOrEmpty(Request.QueryString["CateID"]) ? 0 : DataConverter.CLng(Request.QueryString["CateID"]);
         if (DicCateID <= 0)
         {
             function.WriteErrMsg("缺少字典分类ID参数!", "../AddOn/DictionaryManage.aspx");
         }
         this.HdnDicCateID.Value = DicCateID.ToString();
         DataBind();
     }
     Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>工作台</a></li><li><a href='" + CustomerPageAction.customPath2 + "plus/ADManage.aspx'>扩展功能</a></li><li><a href='DictionaryManage.aspx'>数据字典</a></li><li class='active'>" + B_DataDicCategory.GetDicCate(DataConverter.CLng(string.IsNullOrEmpty(Request.QueryString["CateID"]) ? 0 : DataConverter.CLng(Request.QueryString["CateID"]))).CategoryName + "</li>");
 }
 private void dBind()
 {
     this.EGV.DataSource   = B_DataDicCategory.GetDicCateList();
     this.EGV.DataKeyNames = new string[] { "DicCateID" };
     this.EGV.DataBind();
 }
 protected void btnSetAllUsed_Click(object sender, EventArgs e)
 {
     B_DataDicCategory.SetUsedAll();
     dBind();
 }
Exemplo n.º 9
0
 private void myBind()
 {
     this.EGV.DataSource   = B_DataDicCategory.SearchDicCateList(this.HdnNameKey.Value);
     this.EGV.DataKeyNames = new string[] { "DicCateID" };
     this.EGV.DataBind();
 }