/// <summary> /// 取得某个表单模板库 /// </summary> /// <param name="Id"></param> /// <returns></returns> public FormTemplateInfo GetFormTemplateById(string Id) { Guid ID = Guid.Empty; try { ID = new Guid(Id); } catch { return(null); } DataTable dt = dal.GetFormTemplateById(ID); if (dt != null) { FormTemplateInfo info = new FormTemplateInfo(); info.ID = new Guid(dt.Rows[0]["ID"].ToString()); info.CreatedBy = dt.Rows[0]["CreatedBy"].ToString(); info.CreatedOn = Convert.ToDateTime(dt.Rows[0]["CreatedOn"]); info.Description = dt.Rows[0]["Description"].ToString(); info.Version = dt.Rows[0]["Version"].ToString(); info.Html = dt.Rows[0]["Html"].ToString(); info.Name = dt.Rows[0]["Name"].ToString(); return(info); } return(null); }
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> /// <returns></returns> private FormTemplateInfo CreateObject() { FormTemplateInfo ftli = new FormTemplateInfo(); if (!string.IsNullOrEmpty(Request.QueryString["ID"])) { ftli.ID = new Guid(Request.QueryString["ID"]); } ftli.Name = txtName.Text; ftli.Version = txtVersion.Text; ftli.Html = ""; ftli.Description = txtDescription.Text; return(ftli); }
public bool UpdateFormTemplateHtml(FormTemplateInfo info) { try { string sql = "P_K2_UpdateFormTemplateHtml"; SqlParameter[] parms = { new SqlParameter("@ID", info.ID), new SqlParameter("@Html", info.Html) }; SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringLocalTransaction, CommandType.StoredProcedure, sql, parms); return(true); } catch (Exception ex) { DBManager.RecoreErrorProfile(ex, "FormDesignDAL.UpdateFormTemplateHtml", DBManager.GetCurrentUserAD()); return(false); } }
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> /// <param name="info"></param> /// <returns></returns> public bool CreateFormTemplate(FormTemplateInfo info) { try { string sql = "P_K2_AddFormTemplate"; SqlParameter[] parms = { new SqlParameter("@Name", info.Name), new SqlParameter("@Version", info.Version), new SqlParameter("@Html", info.Html), new SqlParameter("@Description", info.Description), new SqlParameter("@CreatedBy", DBManager.GetCurrentUserAD()) }; SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringLocalTransaction, CommandType.StoredProcedure, sql, parms); return(true); } catch (Exception ex) { DBManager.RecoreErrorProfile(ex, "FormDesignDAL.CreateFormTemplate", DBManager.GetCurrentUserAD()); return(false); } }
/// <summary> /// 创建表单模板库 /// </summary> /// <param name="info"></param> /// <returns></returns> public bool CreateFormTemplate(FormTemplateInfo info) { return(dal.CreateFormTemplate(info)); }
public bool UpdateFormTemplateHtml(FormTemplateInfo info) { return(dal.UpdateFormTemplateHtml(info)); }