예제 #1
0
        protected void lbtnSave_Click(object sender, EventArgs e)
        {
            FormDesignBLL bll = new FormDesignBLL();

            string action = Request.QueryString["action"];

            if (!string.IsNullOrEmpty(action) && action == "add")
            {
                bool ret = bll.CreateControl(CreateObject());
                if (ret)
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "js", "$.messager.alert('提示', '添加成功!','',function(){window.location.href='ControlManage.aspx'});", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "js", "$.messager.alert('提示', '添加失败!');", true);
                }
            }
            else if (!string.IsNullOrEmpty(action) && action == "edit")
            {
                bool ret = bll.UpdateControl(CreateObject());
                if (ret)
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "js", "$.messager.alert('提示', '更新成功!','',function(){window.location.href='ControlManage.aspx'});", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "js", "$.messager.alert('提示', '更新失败!');", true);
                }
            }
        }
예제 #2
0
        private string GetFormTemplateControl()
        {
            string           formTemplateID = HttpContext.Current.Request.Form["formTemplateID"];
            FormDesignBLL    bll            = new FormDesignBLL();
            FormTemplateInfo info           = bll.GetFormTemplateById(formTemplateID);

            return(info.Html);
        }
예제 #3
0
        /// <summary>
        /// 编辑时,加载数据
        /// </summary>
        /// <param name="Id"></param>
        private void LoadData(string Id)
        {
            FormDesignBLL    bll  = new FormDesignBLL();
            FormTemplateInfo info = bll.GetFormTemplateById(Id);

            if (info != null)
            {
                txtName.Text        = info.Name;
                txtVersion.Text     = info.Version;
                txtDescription.Text = info.Description;
            }
        }
예제 #4
0
        /// <summary>
        /// 编辑时,加载数据
        /// </summary>
        /// <param name="Id"></param>
        private void LoadData(string Id)
        {
            FormDesignBLL bll  = new FormDesignBLL();
            ControlInfo   info = bll.GetControlById(Id);

            if (info != null)
            {
                txtControlType.Text = info.Class;
                txtDesc.Text        = info.Description;
                txtJson.Text        = info.Json;
                txtName.Text        = info.Name;
                txtType.Text        = info.Type;
            }
        }
예제 #5
0
        public string SaveTemplateControlHtml()
        {
            //string controlID = HttpContext.Current.Request.Form["controlID"];
            string           formTemplateID = HttpContext.Current.Request.Form["formTemplateID"];
            FormDesignBLL    bll            = new FormDesignBLL();
            FormTemplateInfo info           = new FormTemplateInfo();

            info.ID   = new Guid(formTemplateID);
            info.Html = HttpContext.Current.Request.Form["html"].Replace("\r\n", "");
            bool ret = bll.UpdateFormTemplateHtml(info);

            if (ret)
            {
                return("Success");
            }
            else
            {
                return("Fail");
            }
        }
예제 #6
0
        /// <summary>
        /// 删除表单模板库
        /// </summary>
        /// <returns></returns>
        private string DelFLByID()
        {
            string Id = HttpContext.Current.Request.Form["ID"];

            if (string.IsNullOrEmpty(Id))
            {
                return("Fail");
            }
            else
            {
                FormDesignBLL bll = new FormDesignBLL();
                bool          ret = bll.DelFormTemplateById(Id);
                if (ret)
                {
                    return("Success");
                }
                else
                {
                    return("Fail");
                }
            }
        }
예제 #7
0
        /// <summary>
        /// 取得某个控件
        /// </summary>
        /// <returns></returns>
        private string GetControlByID()
        {
            string Id = HttpContext.Current.Request.Form["ID"];

            if (string.IsNullOrEmpty(Id))
            {
                return("Fail");
            }
            else
            {
                FormDesignBLL bll  = new FormDesignBLL();
                ControlInfo   info = bll.GetControlById(Id);
                if (info != null)
                {
                    return(EasyUIJsonConvert.Serialize <ControlInfo>(info));
                }
                else
                {
                    return("Fail");
                }
            }
        }
예제 #8
0
        /// <summary>
        /// 取得表单控件库模板JSON字符串
        /// </summary>
        /// <returns></returns>
        private string GetFLDataSource()
        {
            FormDesignBLL bll = new FormDesignBLL();

            return(bll.GetALLFormTemplate());
        }
예제 #9
0
        /// <summary>
        /// 取得控件库所有控件JSON字符串
        /// </summary>
        /// <returns></returns>
        private string GetCLDataSource()
        {
            FormDesignBLL bll = new FormDesignBLL();

            return(bll.GetAllCountrol());
        }