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); } } }
private string GetFormTemplateControl() { string formTemplateID = HttpContext.Current.Request.Form["formTemplateID"]; FormDesignBLL bll = new FormDesignBLL(); FormTemplateInfo info = bll.GetFormTemplateById(formTemplateID); return(info.Html); }
/// <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; } }
/// <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; } }
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"); } }
/// <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"); } } }
/// <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"); } } }
/// <summary> /// 取得表单控件库模板JSON字符串 /// </summary> /// <returns></returns> private string GetFLDataSource() { FormDesignBLL bll = new FormDesignBLL(); return(bll.GetALLFormTemplate()); }
/// <summary> /// 取得控件库所有控件JSON字符串 /// </summary> /// <returns></returns> private string GetCLDataSource() { FormDesignBLL bll = new FormDesignBLL(); return(bll.GetAllCountrol()); }