示例#1
0
 public PrFieldLabel(PrForm form, string fieldKey, string label, string defaultValue)
     : base(form, fieldKey)
 {
     Label = label;
     Hidden = false;
     DefaultValue = defaultValue;
 }
示例#2
0
 public PrFieldLabel(PrForm form, string fieldKey, string label)
     : base(form, fieldKey)
 {
     Label = new Escaper().EscapeJavaScript(label);
     Hidden = false;
     DefaultValue = string.Empty;
     MergeWithNext = false;
 }
示例#3
0
 public PrFieldUpload(PrForm form, string fieldKey, string label)
     : base(form, fieldKey)
 {
     Label = new Escaper().EscapeJavaScript(label);
     Required = false;
     Hidden = false;
     MergeWithNext = false;
 }
示例#4
0
 public PrFieldButton(PrForm form, string fieldKey, string buttonText)
     : base(form, fieldKey)
 {
     Label = " ";
     ButtonText = new Escaper().EscapeJavaScript(buttonText);
     Hidden = false;
     MergeWithNext = false;
 }
 public override AJAXActions GetAJAXActions(string actionKey, Dictionary<string, List<string>> values)
 {
     string html = string.Empty;
     switch (actionKey)
     {
         case "Things":
             return new AJAXActions().AddUpdateItemsAction("SubThings", GetXSubThings(GetSelectedID(values)));
         case "Reception":
             html = new PrForm("Reception")
                 .SetHeader("Recepção")
                 .SetFooter("&nbsp;")
                 .AddFieldGridView("GV", "GetActionLogs", this, true, "Action Logs").SetRequired().SetMultipleSelection()
                 .AddFieldText("Text", "Text").SetRequired()
                 .AddFieldRadios("Radios", "Radios", GetYesOrNo())
                     .AddConditionalVisibility(MyEnum.No, "X")
                 .AddFieldLabel("X", "X", "X").SetHidden()
                 .AddFieldComboBox("Things", "Things", Get10Things()).SetDefaultValue("5").AddGetAJAXActions("Things")
                 .AddFieldMultiSelectBox("SubThings", "SubThings", GetXSubThings(10)).AddGetAJAXActions("Submit")
                 .AddFieldButton("Submit", "Sub'mit")
                     .AddGetAJAXActionsAll("Submit")
                 .RenderForm();
             return new AJAXActions().AddShowFormAction(html);
         case "CheckIn":
             html = new PrForm("CheckIn")
                 .SetHeader("CheckIn")
                 .SetFooter("&nbsp;")
                 .AddFieldLabel("Label", "Label", GetSelectedValue(values))
                 .AddFieldButton("Cancel", "Cancel")
                     .AddCancel()
                 .RenderForm();
             return new AJAXActions().AddShowFormAction(html, ShowFormAction.EPreviousFormActionType.MERGE);
         case "God":
             html = new PrForm("God")
                 .SetModalDialog()
                 .SetHeader("<b>Form Header</b>")
                 .SetFooter("<b>Form Footer</b>")
                 .AddFieldCheckBoxes("CheckBoxes", "CheckBoxes", GetXSubThings(3))
                 .AddFieldComboBox("ComboBox", "ComboBox", GetXSubThings(20))
                 .AddFieldDate("Date", "Date")
                 .AddFieldFree("Free", "Free", "<i>Free</i>")
                 .AddFieldLabel("Label", "Label", "Label")
                 .AddFieldMultiSelectBox("MultiSelectBox", "MultiSelectBox", Get10Things())
                 .AddFieldRadios("Radios", "Radios", GetXSubThings(3))
                 .AddFieldText("Text", "Text")
                 .AddFieldTextArea("TextArea", "TextArea")
                 .AddFieldUpload("Upload", "Upload")
                 .AddFieldButton("Button", "Button")
                 .RenderForm();
             return new AJAXActions().AddShowFormAction(html, ShowFormAction.EPreviousFormActionType.APPEND);
         case "Submit":
             return GetAJAXActions("God", null).AddShowMessageAction("Informação", "Operação concluída com sucesso.");
             //return new AJAXActions().AddShowMessageAction("Informação", "Operação concluída com sucesso.");
         default: throw new NotImplementedException();
     }
 }
示例#6
0
 public PrFieldGridView(PrForm form, string fieldKey, DataTable dt, string tableLabel)
     : base(form, fieldKey)
 {
     ClientSide = true;
     Data = dt;
     MergeWithNext = false;
     FieldLabel = "";
     TableLabel = new Escaper().EscapeJavaScript(tableLabel);
     MultipleSelection = false;
     Required = false;
 }
示例#7
0
        public PrFieldFree(PrForm form, string fieldKey, string label, Control source)
            : base(form, fieldKey)
        {
            Label = label;
            Required = false;
            Hidden = false;
            DefaultValue = string.Empty;
            MergeWithNext = false;

            GetValueFunction = "return [''];";
            SetValueFunction = "return;";
            Source = RenderControl(source);
        }
示例#8
0
        public PrFieldFree(PrForm form, string fieldKey, string label, string source)
            : base(form, fieldKey)
        {
            Label = new Escaper().EscapeJavaScript(label);
            Required = false;
            Hidden = false;
            DefaultValue = string.Empty;
            MergeWithNext = false;

            GetValueFunction = "return [''];";
            SetValueFunction = "return;";
            Source = source;
        }
示例#9
0
 public PrFieldRadios(PrForm form, string fieldKey, string label, List<KeyValue> data)
     : base(form, fieldKey)
 {
     Label = new Escaper().EscapeJavaScript(label);
     Data = data;
     if (Data == null)
     {
         Data = new List<KeyValue>();
     }
     Required = false;
     Hidden = false;
     DefaultValue = string.Empty;
     MergeWithNext = false;
 }
示例#10
0
 public override AJAXActions GetAJAXActions(string actionKey, Dictionary<string, List<string>> values)
 {
     switch (actionKey)
     {
         case "Test":
             string form = new PrForm("Test")
                 .SetHeader("Test")
                 .SetFooter("&nbsp;")
                 .AddFieldText("Test", "Test")
                 .RenderForm();
             return new AJAXActions().AddShowFormAction(form);
         default: throw new NotImplementedException();
     }
 }
示例#11
0
        public PrFieldGridView(PrForm form, string fieldKey, string actionKey, FormService formService, bool clientSide, string tableLabel)
            : base(form, fieldKey)
        {
            ActionKey = actionKey;
            ClientSide = clientSide;

            if (ClientSide)
            {
                Data = formService.GetDataTableAll(actionKey, null);
            }
            else
            {
                Data = formService.GetDataTableZero(actionKey, null);
            }
            MergeWithNext = false;
            FieldLabel = "";
            TableLabel = new Escaper().EscapeJavaScript(tableLabel);
            MultipleSelection = false;
            Required = false;
        }
示例#12
0
 public PrField(PrForm form, string fieldKey)
 {
     Form = form;
     FieldKey = fieldKey;
     Validations = new List<Validation>();
 }