protected void RepCustomFormField_ItemCommand(object sender, RepeaterCommandEventArgs e) { if (e.CommandName == "Delete") { int FieldId = int.Parse(e.CommandArgument.ToString()); MCustomFormField = BCustomFormField.GetModel(FieldId); MCustomForm = BCustomForm.GetModel(CustomFormId); BCustomFormField.Del(FieldId); BModelField.DelField(MCustomForm.TableName, MCustomFormField.Name); DataList(); } if (e.CommandName == "UpMove") { int FieldId = int.Parse(e.CommandArgument.ToString()); BCustomFormField.MoveField(CustomFormId, FieldId, "UpMove"); DataList(); } if (e.CommandName == "DownMove") { int FieldId = int.Parse(e.CommandArgument.ToString()); BCustomFormField.MoveField(CustomFormId, FieldId, "DownMove"); DataList(); } }
public void Add(M_CustomFormField model) { SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@CustomFormId", SqlDbType.Int, 4), new SqlParameter("@Name", SqlDbType.NVarChar), new SqlParameter("@Alias", SqlDbType.NVarChar), new SqlParameter("@Description", SqlDbType.NVarChar), new SqlParameter("@IsNotNull", SqlDbType.Bit), new SqlParameter("@IsSearchForm", SqlDbType.Bit), new SqlParameter("@Type", SqlDbType.NVarChar), new SqlParameter("@Content", SqlDbType.NText), new SqlParameter("@IsList", SqlDbType.Bit), new SqlParameter("@IsUserInsert", SqlDbType.Bit), new SqlParameter("@AddDate", SqlDbType.DateTime) }; commandParameters[0].Value = model.CustomFormId; commandParameters[1].Value = model.Name; commandParameters[2].Value = model.Alias; commandParameters[3].Value = model.Description; commandParameters[4].Value = model.IsNotNull; commandParameters[5].Value = model.IsSearchForm; commandParameters[6].Value = model.Type; commandParameters[7].Value = model.Content; commandParameters[8].Value = model.IsList; commandParameters[9].Value = model.IsUserInsert; commandParameters[10].Value = model.AddDate; SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_CustomFormField_Add", commandParameters); }
private void GetShow() { MCustomFormField = BCustomFormField.GetModel(FieldId); Name.Text = MCustomFormField.Name; Alias.Text = MCustomFormField.Alias; Description.Text = MCustomFormField.Description; IsNotNull.SelectedValue = MCustomFormField.IsNotNull.ToString(); IsList.SelectedValue = MCustomFormField.IsList.ToString(); IsUserInsert.SelectedValue = MCustomFormField.IsUserInsert.ToString(); IsSearchForm.SelectedValue = MCustomFormField.IsSearchForm.ToString(); string MyType = MCustomFormField.Type; string MyContent = MCustomFormField.Content; Type.SelectedValue = MyType; if (MyType == "TextType") { TitleSize.Text = BModelField.GetFieldContent(MyContent, 0, 1); IsPassword.SelectedValue = BModelField.GetFieldContent(MyContent, 1, 1); TextType_DefaultValue.Text = BModelField.GetFieldContent(MyContent, 2, 1); } if (MyType == "MultipleTextType") { MultipleTextType_Width.Text = BModelField.GetFieldContent(MyContent, 0, 1); MultipleTextType_Height.Text = BModelField.GetFieldContent(MyContent, 1, 1); } if (MyType == "MultipleHtmlType") { MultipleHtmlType_Width.Text = BModelField.GetFieldContent(MyContent, 0, 1); MultipleHtmlType_Height.Text = BModelField.GetFieldContent(MyContent, 1, 1); IsEditor.SelectedValue = BModelField.GetFieldContent(MyContent, 2, 1); } if (MyType == "RadioType") { RadioType_Content.Text = Function.Decode(BModelField.GetFieldContent(MyContent, 0, 1).Replace("|", "<br>")); RadioType_Type.SelectedValue = BModelField.GetFieldContent(MyContent, 0, 0); RadioType_Property.SelectedValue = BModelField.GetFieldContent(MyContent, 1, 1).ToString(); RadioType_Default.Text = BModelField.GetFieldContent(MyContent, 2, 1).ToString(); } if (MyType == "ListBoxType") { ListBoxType_Content.Text = Function.Decode(BModelField.GetFieldContent(MyContent, 0, 1).Replace("|", "<br>")); ListBoxType_Type.SelectedValue = BModelField.GetFieldContent(MyContent, 0, 0); } if (MyType == "NumberType") { NumberType_TitleSize.Text = BModelField.GetFieldContent(MyContent, 0, 1); NumberType_DefaultValue.Text = BModelField.GetFieldContent(MyContent, 1, 1); } }
protected void Page_Load(object sender, EventArgs e) { AdminGroupBll.Power_Judge(33); if (!string.IsNullOrEmpty(Request.QueryString["CustomFormId"])) { try { CustomFormId = int.Parse(Request.QueryString["CustomFormId"]); } catch { } } if (!string.IsNullOrEmpty(Request.QueryString["FieldId"])) { try { FieldId = int.Parse(Request.QueryString["FieldId"]); } catch { } } MCustomForm = BCustomForm.GetModel(CustomFormId); if (!Page.IsPostBack) { if (CustomFormId != 0) { if (MCustomForm == null) { Function.ShowSysMsg(0, "<li>表单不存在或已经被删除</li><li><a href='infomodel/CustomFormList.aspx'>返回表单管理列表</a> <a href='infomodel/CustomFormFieldList.aspx?CustomFormId=" + CustomFormId + "'>返回字段管理列表</a></li>"); } } if (FieldId != 0) { MCustomFormField = BCustomFormField.GetModel(FieldId); if (MCustomFormField == null) { Function.ShowSysMsg(0, "<li>该字段不存在或已经被删除</li><li><a href='infomodel/CustomFormList.aspx'>返回表单管理列表</a> <a href='infomodel/CustomFormFieldList.aspx?CustomFormId=" + CustomFormId + "'>返回字段管理列表</a></li>"); } GetShow(); Name.Enabled = false; Type.Enabled = false; Button1.Text = " 确认修改 "; } FormName.Text = MCustomForm.FormName; } }
protected void Page_Load(object sender, EventArgs e) { AdminGroupBll.Power_Judge(33); Response.Cache.SetNoStore(); if (!string.IsNullOrEmpty(Request.QueryString["CustomFormId"])) { try { CustomFormId = int.Parse(Request.QueryString["CustomFormId"]); } catch { } } if (!string.IsNullOrEmpty(Request.QueryString["Id"])) { try { Id = int.Parse(Request.QueryString["Id"]); } catch { } } MCustomForm = BCustomForm.GetModel(CustomFormId); drinfo = BInfoOper.GetInfo(MCustomForm.TableName, Id); FieldName = Request.QueryString["FieldName"]; if (!Page.IsPostBack) { MCustomFormField = BCustomFormField.GetModel(CustomFormId, FieldName); FormName.Text = MCustomForm.FormName; Alias.Text = "" + MCustomFormField.Alias + ":"; ShowStyle.Text = GetShowStyle(MCustomFormField.Name, MCustomFormField.IsNotNull.ToString(), MCustomFormField.Type, MCustomFormField.Content, MCustomFormField.Description); } }
public void Add(M_CustomFormField model) { this.dal.Add(model); }
public void Update(M_CustomFormField model) { this.dal.Update(model); }
public M_CustomFormField GetModel(int FieldId) { SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@FieldId", SqlDbType.Int, 4), new SqlParameter("@TypeId", SqlDbType.Int, 4) }; commandParameters[0].Value = FieldId; commandParameters[1].Value = 1; M_CustomFormField field = new M_CustomFormField(); DataSet set = SqlHelper.ExecuteDataSet(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "UP_CustomFormField_GetModel", commandParameters); field.FieldId = FieldId; if (set.Tables[0].Rows.Count > 0) { if (set.Tables[0].Rows[0]["CustomFormId"].ToString() != "") { field.CustomFormId = int.Parse(set.Tables[0].Rows[0]["CustomFormId"].ToString()); } field.Name = set.Tables[0].Rows[0]["Name"].ToString(); field.Alias = set.Tables[0].Rows[0]["Alias"].ToString(); field.Description = set.Tables[0].Rows[0]["Description"].ToString(); if (set.Tables[0].Rows[0]["IsNotNull"].ToString() != "") { if ((set.Tables[0].Rows[0]["IsNotNull"].ToString() == "1") || (set.Tables[0].Rows[0]["IsNotNull"].ToString().ToLower() == "true")) { field.IsNotNull = true; } else { field.IsNotNull = false; } } if (set.Tables[0].Rows[0]["IsSearchForm"].ToString() != "") { if ((set.Tables[0].Rows[0]["IsSearchForm"].ToString() == "1") || (set.Tables[0].Rows[0]["IsSearchForm"].ToString().ToLower() == "true")) { field.IsSearchForm = true; } else { field.IsSearchForm = false; } } field.Type = set.Tables[0].Rows[0]["Type"].ToString(); field.Content = set.Tables[0].Rows[0]["Content"].ToString(); if (set.Tables[0].Rows[0]["OrderId"].ToString() != "") { field.OrderId = int.Parse(set.Tables[0].Rows[0]["OrderId"].ToString()); } if (set.Tables[0].Rows[0]["IsList"].ToString() != "") { if ((set.Tables[0].Rows[0]["IsList"].ToString() == "1") || (set.Tables[0].Rows[0]["IsList"].ToString().ToLower() == "true")) { field.IsList = true; } else { field.IsList = false; } } if (set.Tables[0].Rows[0]["IsUserInsert"].ToString() != "") { if ((set.Tables[0].Rows[0]["IsUserInsert"].ToString() == "1") || (set.Tables[0].Rows[0]["IsUserInsert"].ToString().ToLower() == "true")) { field.IsUserInsert = true; } else { field.IsUserInsert = false; } } if (set.Tables[0].Rows[0]["AddDate"].ToString() != "") { field.AddDate = DateTime.Parse(set.Tables[0].Rows[0]["AddDate"].ToString()); } return field; } return null; }