예제 #1
0
 public TagBuilder AppendRequiredMessage(FormProperty formProperty)
 {
     var tagBuilder = new TagBuilder("span");
     tagBuilder.AddCssClass("field-validation-valid");
     tagBuilder.Attributes["data-valmsg-for"] = formProperty.Name;//.GetHtmlId();
     tagBuilder.Attributes["data-valmsg-replace"] = "true";
     //data-valmsg-for="LastName" data-valmsg-replace="true"
     return tagBuilder;
 }
예제 #2
0
        public void AddFormProperty(FormProperty property)
        {
            _session.Transact(session =>
            {
                if (property.Webpage.FormProperties != null)
                    property.DisplayOrder = property.Webpage.FormProperties.Count;

                session.Save(property);
            });
        }
예제 #3
0
 public JsonResult DeleteProperty_POST(FormProperty property)
 {
     _formAdminService.DeleteFormProperty(property);
     return Json(new FormActionResult { success = true });
 }
예제 #4
0
 public ViewResult DeleteProperty(FormProperty property)
 {
     return View(property);
 }
예제 #5
0
 public ViewResult EditProperty(FormProperty property)
 {
     return View(property);
 }
예제 #6
0
 private string SanitizeValue(FormProperty formProperty, string value)
 {
     if (formProperty is CheckboxList)
     {
         if (value != null)
         {
             var list = value.Split(',').ToList();
             list.Remove(CheckBoxListRenderer.CbHiddenValue);
             return !list.Any() ? null : string.Join(",", list);
         }
         return value;
     }
     return value;
 }
예제 #7
0
 public void DeleteFormProperty(FormProperty property)
 {
     property.Webpage.FormProperties.Remove(property);
     _session.Transact(session => session.Delete(property));
 }
예제 #8
0
 public void SaveFormProperty(FormProperty property)
 {
     _session.Transact(session => session.Update(property));
 }