예제 #1
0
 private void bind()
 {
     if (id > 0)
     {
         wx_diymenuInfo info = BLL.wx_diymenuBLL.GetModel(id);
         Name    = info.Name;
         RefID   = info.RefID;
         RefType = info.RefType;
         URL     = info.URL;
         Body    = info.Body;
     }
 }
예제 #2
0
        protected void save(int id, string name, int parentid)
        {
            try
            {
                if (name.Trim().Length == 0)
                {
                    Response.Write("<script>parent.fail('请填写名称!');</script>");
                    return;
                }
                wx_diymenuInfo model = new wx_diymenuInfo();
                if (id > 0)
                {
                    model = BLL.wx_diymenuBLL.GetModel(id);
                    if (model == null || model.MenuId != id)
                    {
                        Response.Write("<script>parent.fail('参数id错误!');</script>");
                        return;
                    }
                }


                model.Name     = name.Trim();
                model.ParentId = parentid;
                int    saveresult = 0;
                string resultmsg  = "";
                if (id > 0)
                {
                    saveresult = BLL.wx_diymenuBLL.Update(model);
                }
                else
                {
                    model.State      = 1;
                    model.RefType    = -1;
                    model.RefID      = 0;
                    model.companyid  = "";
                    model.CreateTime = DateTime.Now;
                    saveresult       = BLL.wx_diymenuBLL.add(model, ref resultmsg);
                }
                if (saveresult > 0)
                {
                    Response.Write("<script>parent.success('提交成功!');</script>");
                }
                else
                {
                    Response.Write("<script>parent.fail('提交失败!" + resultmsg.Replace("'", "").Replace("\r", "").Replace("\n", "") + "');</script>");
                }
            }
            catch (Exception exc)
            {
                Response.Write("<script>parent.fail('提交失败!" + exc.Message.Replace("'", "").Replace("\r", "").Replace("\n", "") + "');</script>");
            }
        }
예제 #3
0
        private void bind()
        {
            ddlparentidbind();
            if (id > 0)
            {
                wx_diymenuInfo info = BLL.wx_diymenuBLL.GetModel(id);
                txbName.Text = info.Name;
                txbSort.Text = info.Sort.ToString();

                try { ddlparentid.SelectedValue = info.ParentId.ToString(); }
                catch { }
            }
            else
            {
                txbSort.Text = "99";
            }
        }
예제 #4
0
        /// <summary>
        /// 更改成文本动作
        /// </summary>
        /// <param name="body"></param>
        protected void update_text(string body)
        {
            try
            {
                if (id <= 0)
                {
                    Response.Write("<script>parent.fail('id 错误');</script>");
                    return;
                }
                if (body.Trim().Length == 0)
                {
                    Response.Write("<script>parent.fail('文本内容不能为空');</script>");
                    return;
                }
                wx_diymenuInfo model = BLL.wx_diymenuBLL.GetModel(id);
                if (model == null || model.MenuId != id)
                {
                    Response.Write("<script>parent.fail('无对应的数据');</script>");
                    return;
                }

                //if (refid <= 0)
                //{
                //    Response.Write("<script>parent.fail('refid 错误');</script>");
                //    return;
                //}
                model.URL     = "";
                model.RefType = 1;
                model.RefID   = 0;
                model.Body    = body;
                int result = BLL.wx_diymenuBLL.Update(model);
                if (result > 0)
                {
                    Response.Write("<script>parent.success('提交成功!');</script>");
                }
                else
                {
                    Response.Write("<script>parent.fail('提交失败!');</script>");
                }
            }
            catch (Exception exc)
            { Response.Write("<script>parent.fail('" + exc.Message.Replace("'", "").Replace("\r", "").Replace("\n", "") + "');</script>"); }
        }
예제 #5
0
        /// <summary>
        /// 更改成图文动作
        /// </summary>
        /// <param name="refid"></param>
        /// <param name="reftype"></param>
        protected void update_imgtext(int refid)
        {
            try
            {
                if (id <= 0)
                {
                    Response.Write("<script>parent.fail('id 错误');</script>");
                    return;
                }

                wx_diymenuInfo model = BLL.wx_diymenuBLL.GetModel(id);
                if (model == null || model.MenuId != id)
                {
                    Response.Write("<script>parent.fail('无对应的数据');</script>");
                    return;
                }
                //if (reftype != 3)
                //{
                //    Response.Write("<script>parent.fail('reftype 错误');</script>");
                //    return;
                //}
                model.URL     = "";
                model.RefType = 3;
                model.RefID   = refid;
                model.Body    = "";
                int result = BLL.wx_diymenuBLL.Update(model);
                if (result > 0)
                {
                    Response.Write("<script>parent.success('提交成功!');</script>");
                }
                else
                {
                    Response.Write("<script>parent.fail('提交失败!');</script>");
                }
            }
            catch (Exception exc)
            { Response.Write("<script>parent.fail('" + exc.Message.Replace("'", "").Replace("\r", "").Replace("\n", "") + "');</script>"); }
        }
예제 #6
0
 /// <summary>
 /// 更改成链接
 /// </summary>
 /// <param name="url"></param>
 protected void updateurl(string url)
 {
     try
     {
         if (id <= 0)
         {
             Response.Write("<script>parent.fail('id 错误');</script>");
             return;
         }
         if (url.Trim().Length == 0)
         {
             Response.Write("<script>parent.fail('请填写链接地址');</script>");
             return;
         }
         wx_diymenuInfo model = BLL.wx_diymenuBLL.GetModel(id);
         if (model == null || model.MenuId != id)
         {
             Response.Write("<script>parent.fail('无对应的数据');</script>");
             return;
         }
         model.URL     = url;
         model.RefType = 0;
         model.RefID   = 0;
         model.Body    = "";
         int result = BLL.wx_diymenuBLL.Update(model);
         if (result > 0)
         {
             Response.Write("<script>parent.success('提交成功!');</script>");
         }
         else
         {
             Response.Write("<script>parent.fail('提交失败!');</script>");
         }
     }
     catch (Exception exc)
     { Response.Write("<script>parent.fail('" + exc.Message.Replace("'", "").Replace("\r", "").Replace("\n", "") + "');</script>"); }
 }