Exemplo n.º 1
0
        protected override void CreateColumns(IList <LargeColumn <TModel, TPostModel> > columns)
        {
            var name       = new FloatTextBox <TModel, TPostModel>(Resource.Name, o => o.Name, o => o.Name);
            var group      = new FloatTextBox <TModel, TPostModel>(Resource.Group, o => o.Group, o => o.Group);
            var url        = new FloatTextBox <TModel, TPostModel>(Resource.Url, o => o.Url, o => o.Url);
            var startTime  = new DateTimeFloatTextBox <TModel, TPostModel>(Resource.StartTime, o => o.StartTime, o => o.StartTime);
            var endTime    = new DateTimeFloatTextBox <TModel, TPostModel>(Resource.EndTime, o => o.EndTime, o => o.EndTime);
            var httpMethod = new SingleSelect <TModel, TPostModel, HttpMethod>(Resource.HttpMethod, o => o.HttpMethod, o => o.HttpMethod, o => (byte)o < 4)
            {
                Width = ComulnWidth.Two,
                Init  = true,
            };
            var triggerType = new SingleSelect <TModel, TPostModel, TriggerTypeEnum>(Resource.TriggerType, o => o.TriggerType, o => o.TriggerType)
            {
                Width    = ComulnWidth.Four,
                Url      = ScheduleRoute.ReplaceColumn,
                Function = "index.changeTriggerType",
                Id       = Identifier.NewId,
                Init     = true,
            };
            var isEnable = new CheckBox <TModel, TPostModel>(Resource.IsEnableLable, o => o.IsPaused, o => o.IsPaused);

            columns.Add(new LargeColumn <TModel, TPostModel>(name, group));
            columns.Add(new LargeColumn <TModel, TPostModel>(url));
            columns.Add(new LargeColumn <TModel, TPostModel>(startTime, endTime));
            columns.Add(new LargeColumn <TModel, TPostModel>(httpMethod, triggerType));
            ReplaceLargeColumn <TModel, TPostModel> replaceColumn = new ReplaceLargeColumn <TModel, TPostModel>(this.Model);

            replaceColumn.AddToColumns(columns);
            columns.Add(new LargeColumn <TModel, TPostModel>(isEnable));
        }
Exemplo n.º 2
0
 private void TypeSelector_Clicked(SingleSelect singleSelect)
 {
     if (this.SelectedActivityTypeIsSolution)
     {
         if (!this.activityDatabase.HasProblem)
         {
             // If the user hasn't entered a Problem yet, then it doesn't make sense to try to enter a solution yet
             this.typePicker.Advance();
         }
     }
     this.explainActivityType();
 }
        protected override void CreateSearchFilter(IList <LargeColumn <TModel, TPostModel> > filters)
        {
            var name           = new FloatTextBox <TModel, TPostModel>(Resource.Name, o => o.Name, o => o.Name);
            var group          = new FloatTextBox <TModel, TPostModel>(Resource.Group, o => o.Group, o => o.Group);
            var url            = new FloatTextBox <TModel, TPostModel>(Resource.Url, o => o.Url, o => o.Url);
            var cron           = new FloatTextBox <TModel, TPostModel>("Cron", o => o.Cron, o => o.CronExpression);
            var startTime      = new DateTimeFloatTextBox <TModel, TPostModel>("开始时间", o => o.StartTime, o => o.StartTime);
            var endTime        = new DateTimeFloatTextBox <TModel, TPostModel>("结束时间", o => o.EndTime, o => o.EndTime);
            var lastExcuteTime = new DateTimeFloatTextBox <TModel, TPostModel>("上次执行时间", o => o.LastExcuteTime, o => o.PrevFireTime);
            var nextExcuteTime = new DateTimeFloatTextBox <TModel, TPostModel>("下次执行时间", o => o.NextExcuteTime, o => o.NextFireTime);
            var httpMethod     = new SingleSelect <TModel, TPostModel, HttpMethod>(Resource.HttpMethod, o => o.HttpMethod, o => o.HttpMethod, o => (byte)o < 4 || (byte)o == 255)
            {
                Width = ComulnWidth.Two,
                Init  = true,
            };

            filters.Add(new LargeColumn <TModel, TPostModel>(name)
            {
                IsFilter = true
            });
            filters.Add(new LargeColumn <TModel, TPostModel>(group)
            {
                IsFilter = true
            });
            filters.Add(new LargeColumn <TModel, TPostModel>(url)
            {
                IsFilter = true
            });
            filters.Add(new LargeColumn <TModel, TPostModel>(cron)
            {
                IsFilter = true
            });
            filters.Add(new LargeColumn <TModel, TPostModel>(startTime)
            {
                IsFilter = true
            });
            filters.Add(new LargeColumn <TModel, TPostModel>(endTime)
            {
                IsFilter = true
            });
            filters.Add(new LargeColumn <TModel, TPostModel>(lastExcuteTime)
            {
                IsFilter = true
            });
            filters.Add(new LargeColumn <TModel, TPostModel>(nextExcuteTime)
            {
                IsFilter = true
            });
            filters.Add(new LargeColumn <TModel, TPostModel>(httpMethod)
            {
                IsFilter = true
            });
        }
        private void updateCompletionStatusVisibility()
        {
            Metric metric = this.Metric;

            if (metric != null)
            {
                SingleSelect singleSelect;
                if (!(metric is ProblemMetric))
                {
                    SingleSelect_Choice complete   = new SingleSelect_Choice(this.TaskCompleted_Text, Color.Green);
                    SingleSelect_Choice incomplete = new SingleSelect_Choice(this.TaskIncomplete_Text, Color.Yellow);
                    SingleSelect_Choice obsolete   = new SingleSelect_Choice(this.TaskObsolete_Text, Color.White);
                    if (this.EnteringToDo)
                    {
                        singleSelect = new SingleSelect(null, new List <SingleSelect_Choice>()
                        {
                            complete, incomplete, obsolete
                        });
                    }
                    else
                    {
                        singleSelect = new SingleSelect(null, new List <SingleSelect_Choice>()
                        {
                            complete, incomplete
                        });
                    }
                }
                else
                {
                    SingleSelect_Choice complete   = new SingleSelect_Choice(this.ProblemComplete_Text, Color.LightBlue);
                    SingleSelect_Choice incomplete = new SingleSelect_Choice(this.ProblemIncomplete_Text, Color.Orange);
                    singleSelect = new SingleSelect(null, new List <SingleSelect_Choice>()
                    {
                        complete, incomplete
                    });
                }
                this.todoCompletionStatusPicker = singleSelect;
                singleSelect.Updated           += SingleSelect_Updated;

                this.helpStatusHolder.SubLayout           = this.helpStatusPicker;
                this.todoCompletionStatusHolder.SubLayout = this.todoCompletionStatusPicker;
            }
            else
            {
                this.helpStatusHolder.SubLayout           = null;
                this.todoCompletionStatusPicker           = null;
                this.todoCompletionStatusHolder.SubLayout = null;
            }
            this.updateOkButtonText();
        }
        public override bool UpdateItem(ContentItem item, Control editor)
        {
            ContentItem questionItem = Utility.GetProperty(item, Name) as ContentItem;

            CheckBox cb = editor.FindControl(GetCheckBoxName()) as CheckBox;
            if (cb.Checked || questionItem == null)
            {
                questionItem = new SingleSelect();
                questionItem.AddTo(item);
                Utility.UpdateSortOrder(item.Children);
            }

            TextBox tb = editor.FindControl(GetTextBoxName()) as TextBox;
            questionItem.Title = tb.Text;
        
            return base.UpdateItem(questionItem, editor);
        }
Exemplo n.º 6
0
		public override bool UpdateItem(ContentItem item, Control editor)
		{
			ContentItem questionItem = Utility.GetProperty(item, Name) as ContentItem;

			CheckBox cb = editor.FindControl(GetCheckBoxName()) as CheckBox;
			if (cb.Checked || questionItem == null)
			{
				questionItem = new SingleSelect();
				questionItem.AddTo(item);
				Utility.UpdateSortOrder(item.Children);
			}

			TextBox tb = editor.FindControl(GetTextBoxName()) as TextBox;
			questionItem.Title = tb.Text;
		
			return base.UpdateItem(questionItem, editor);
		}
Exemplo n.º 7
0
        public void AddToColumns(IList <LargeColumn <TModel, TPostModel> > columns)
        {
            var cronExpression = new FloatTextBox <TModel, TPostModel>(Resource.CronExpression, o => o.CronExpression, o => o.CronExpression);
            var intervalTime   = new IntegerFloatTextBox <TModel, TPostModel>(Resource.IntervalTime, o => o.IntervalTime, o => o.IntervalTime)
            {
                Width = ComulnWidth.Three
            };
            var intervalType = new SingleSelect <TModel, TPostModel, TimeSpanParseRule>(Resource.IntervalType, o => o.IntervalType, o => o.IntervalType)
            {
                Width = ComulnWidth.Three, Init = true,
            };

            if (this.model?.TriggerType == TriggerTypeEnum.Simple)
            {
                columns.Add(new LargeReplaceColumn <TModel, TPostModel>(intervalTime, intervalType));
            }
            else
            {
                columns.Add(new LargeReplaceColumn <TModel, TPostModel>(cronExpression, this.emptyColumn));
            }
        }
 private void SingleSelect_Updated(SingleSelect singleSelect)
 {
     this.updateOkButtonText();
 }
Exemplo n.º 9
0
 private void TypeBox_Clicked(SingleSelect singleSelect)
 {
     this.updateSublayout();
 }
        [Test] // Core_Template_TemplateFromXml_ReturnsTemplate()
        public void Core_eForm_QuickSyncEnabledeFormFromXML_ReturnseMainElement()
        {
            //Arrance
            string xmlstring = @"
                <?xml version='1.0' encoding='utf-8'?>
                <Main xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
                  <Id>35</Id>
                  <Label>Lorem ipsum</Label>
                  <DisplayOrder>0</DisplayOrder>
                  <CheckListFolderName>Modtagerkontrol</CheckListFolderName>
                  <Repeated>1</Repeated>
                  <StartDate>2018-08-23 10:40:52</StartDate>
                  <EndDate>2058-08-29 10:40:52</EndDate>
                  <Language>da</Language>
                  <MultiApproval>false</MultiApproval>
                  <FastNavigation>false</FastNavigation>
                  <DownloadEntities>false</DownloadEntities>
                  <ManualSync>false</ManualSync>
                  <EnableQuickSync>true</EnableQuickSync>
                  <ElementList>
                    <Element xsi:type='DataElement'>
                      <Id>36</Id>
                      <Label>Lorem ipsum</Label>
                      <DisplayOrder>0</DisplayOrder>
                      <Description><![CDATA[Lorem ipsum description]]></Description>
                      <ApprovalEnabled>false</ApprovalEnabled>
                      <ReviewEnabled>false</ReviewEnabled>
                      <DoneButtonEnabled>true</DoneButtonEnabled>
                      <ExtraFieldsEnabled>false</ExtraFieldsEnabled>
                      <PinkBarText />
                      <DataItemGroupList />
                      <DataItemList>
                        <DataItem xsi:type='SingleSelect'>
                          <Id>22</Id>
                          <Mandatory>false</Mandatory>
                          <ReadOnly>false</ReadOnly>
                          <Label>Is everything OK:</Label>
                          <Description><![CDATA[]]></Description>
                          <DisplayOrder>1</DisplayOrder>
                          <KeyValuePairList>
                            <KeyValuePair>
                              <Key>1</Key>
                              <Value>OK</Value>
                              <Selected>false</Selected>
                              <DisplayOrder>1</DisplayOrder>
                            </KeyValuePair>
                            <KeyValuePair>
                              <Key>2</Key>
                              <Value>Not OK</Value>
                              <Selected>false</Selected>
                              <DisplayOrder>2</DisplayOrder>
                            </KeyValuePair>
                          </KeyValuePairList>
                        </DataItem>
                      </DataItemList>
                    </Element>
                  </ElementList>
                  <PushMessageTitle />
                  <PushMessageBody />
                </Main>";
            //Act
            MainElement match = sut.TemplateFromXml(xmlstring);

            //Assert
            Assert.NotNull(match);
            Assert.AreEqual("", match.CaseType);
            Assert.AreEqual(1, match.Repeated);
            Assert.AreEqual(1, match.Id);
            Assert.AreEqual("Lorem ipsum", match.Label);
            Assert.AreEqual("da", match.Language);
            Assert.AreEqual(false, match.MultiApproval);
            Assert.AreEqual(false, match.FastNavigation);
            Assert.AreEqual(0, match.DisplayOrder);
            Assert.AreEqual(1, match.ElementList.Count());
            Assert.AreEqual(true, match.EnableQuickSync);

            DataElement dE = (DataElement)match.ElementList[0];

            Assert.AreEqual(dE.DataItemList.Count(), 1);
            Assert.AreEqual("Lorem ipsum", dE.Label);

            CDataValue cd = new CDataValue();

            //Assert.AreEqual(dE.Description, cd); TODO
            Assert.AreEqual(0, dE.DisplayOrder);
            Assert.AreEqual(false, dE.ReviewEnabled);
            //Assert.AreEqual(dE.ManualSync) //TODO No Method for ManualSync
            Assert.AreEqual(false, dE.ExtraFieldsEnabled);
            //Assert.AreEqual(dE.DoneButtonDisabled, false); //TODO DoneButtonDisabled no method found
            Assert.AreEqual(false, dE.ApprovalEnabled);

            SingleSelect commentField = (SingleSelect)dE.DataItemList[0];

            Assert.AreEqual("Is everything OK:", commentField.Label);
            //Assert.AreEqual(commentField.Description, cd);
            Assert.AreEqual(1, commentField.DisplayOrder);
            //Assert.AreEqual(commentField.Multi, 0) //TODO No method MULTI
            //Assert.AreEqual(commentField.geolocation, false) //TODO no method geolocation
            //Assert.AreEqual(commentField.Split, false) //TODO no method Split
            //Assert.AreEqual("", commentField.Value);
            Assert.AreEqual(false, commentField.ReadOnly);
            Assert.AreEqual(false, commentField.Mandatory);
            //Assert.AreEqual(Constants.FieldColors.Grey, commentField.Color);
        }
Exemplo n.º 11
0
        public ActivityCreationLayout(ActivityDatabase activityDatabase, LayoutStack layoutStack)
        {
            this.activityDatabase = activityDatabase;
            this.layoutStack      = layoutStack;

            this.SetTitle("New Activity");
            SingleSelect typeSelector = new SingleSelect("Type:", this.typeChoices);

            GridLayout mainGrid = GridLayout.New(new BoundProperty_List(3), new BoundProperty_List(1), LayoutScore.Zero);

            mainGrid.AddLayout(typeSelector);
            this.feedbackLayout = new TextblockLayout("", 18).AlignVertically(TextAlignment.Center);
            mainGrid.AddLayout(this.feedbackLayout);

            GridLayout bottomGrid = GridLayout.New(new BoundProperty_List(2), BoundProperty_List.Uniform(2), LayoutScore.Zero);

            mainGrid.AddLayout(bottomGrid);

            this.typePicker       = typeSelector;
            typeSelector.Updated += TypeSelector_Clicked;

            this.childNameBox = new ActivityNameEntryBox("Activity Name", activityDatabase, layoutStack, true);
            this.childNameBox.AutoAcceptAutocomplete = false;
            bottomGrid.AddLayout(this.childNameBox);

            this.parentNameBox = new ActivityNameEntryBox("Parent Name", activityDatabase, layoutStack);
            this.parentNameBox.AutoAcceptAutocomplete = false;
            // for first-time users, make it extra obvious that the root activity exists
            this.parentNameBox.autoselectRootActivity_if_noCustomActivities();
            bottomGrid.AddLayout(this.parentNameBox);

            this.okButton          = new Button();
            this.okButton.Clicked += OkButton_Clicked;
            bottomGrid.AddLayout(new ButtonLayout(this.okButton, "OK"));

            LayoutChoice_Set helpWindow = (new HelpWindowBuilder()).AddMessage("This screen is for you to enter activities to do, to use as future suggestions.")
                                          .AddMessage("In the left text box, choose a name for the activity.")
                                          .AddMessage("In the right text box, specify another activity to assign as its parent.")
                                          .AddMessage("For example, you might specify that Gaming is a child activity of the Fun activity. Grouping activities like this is helpful for two reasons. It gives " +
                                                      "ActivityRecommender more understanding about the relationships between activities and can help it to notice trends. It also means that you can later request a suggestion " +
                                                      "from within Activity \"Fun\" and ActivityRecommender will know what you mean, and might suggest \"Gaming\".")
                                          .AddMessage("If you haven't created the parent activity yet, you'll have to create it first. The only activity that exists at the beginning is the built-in activity " +
                                                      "named \"Activity\".")
                                          .AddMessage("While typing you can press Enter to fill in the autocomplete suggestion.")
                                          .AddMessage("If the thing you're creating is something you plan to do many times (or even if you want it to be able to be the parent of another Activity), then select the type " +
                                                      "Category. For example, Sleeping would be a Category.")
                                          .AddMessage("If the thing you're creating is something you plan to complete once and don't plan to do again, then select the type ToDo. For example, \"Reading " +
                                                      "ActivityRecommender's Built-In Features Overview\" would be a ToDo.")
                                          .AddMessage("If the thing you're creating is something measureable that you might try to solve repeatedly but in different ways, then select the type Problem. For example, " +
                                                      "\"Headache\" (or \"Fixing my Headache\") would be a Problem because it may be addressed in several ways: resting, drinking water, or adjusting your posture")
                                          .AddMessage("If the thing you're creating is something that solves a Problem, then select the type Category and choose the appropriate Problem as a parent. Note " +
                                                      "that there is also a choice named \"Solution\", which is another name for Category, to emphasize this.")
                                          .AddLayout(new CreditsButtonBuilder(layoutStack)
                                                     .AddContribution(ActRecContributor.AARON_SMITH, new DateTime(2019, 8, 17), "Suggested that if Activity is the only valid choice then it should autopopulate")
                                                     .AddContribution(ActRecContributor.DAGOBERT_RENOUF, new DateTime(2021, 06, 14), "Mentioned that it was difficult to determine how to create a new activity without " +
                                                                      "visual hierarchy among the elements on the screen")
                                                     .Build()
                                                     )
                                          .Build();

            HelpButtonLayout helpLayout = new HelpButtonLayout(helpWindow, layoutStack);

            bottomGrid.AddLayout(helpLayout);

            this.explainActivityType();

            this.SetContent(mainGrid);
        }
Exemplo n.º 12
0
        private DataItem UnpackDataItem(JObject dataItemObj)
        {
            DataItem dataItem = dataItemObj.ToObject <DataItem>();

            if (dataItemObj["Type"].ToString() == "Picture")
            {
                Picture picture = new Picture(dataItem.Id, dataItem.Mandatory, dataItem.ReadOnly, dataItem.Label,
                                              dataItem.Description.ToString(), dataItem.Color, dataItem.DisplayOrder, (bool)dataItem.Dummy,
                                              int.Parse(dataItemObj["Multi"].ToString()), bool.Parse(dataItemObj["GeolocationEnabled"].ToString()));
                return(picture);
            }
            else if (dataItemObj["Type"].ToString() == "SaveButton")
            {
                SaveButton saveButton = new SaveButton(dataItem.Id, dataItem.Mandatory, dataItem.ReadOnly, dataItem.Label,
                                                       dataItem.Description.ToString(), dataItem.Color, dataItem.DisplayOrder, (bool)dataItem.Dummy,
                                                       dataItemObj["Value"].ToString());
                return(saveButton);
            }
            else if (dataItemObj["Type"].ToString() == "Timer")
            {
                Timer timer = new Timer(dataItem.Id, dataItem.Mandatory, dataItem.ReadOnly, dataItem.Label,
                                        dataItem.Description.ToString(), dataItem.Color, dataItem.DisplayOrder, (bool)dataItem.Dummy,
                                        bool.Parse(dataItemObj["StopOnSave"].ToString()));
                return(timer);
            }
            else if (dataItemObj["Type"].ToString() == "None")
            {
                None none = new None(dataItem.Id, dataItem.Mandatory, dataItem.ReadOnly, dataItem.Label,
                                     dataItem.Description.ToString(), dataItem.Color, dataItem.DisplayOrder, (bool)dataItem.Dummy);
                return(none);
            }
            else if (dataItemObj["Type"].ToString() == "Signature")
            {
                Signature signature = new Signature(dataItem.Id, dataItem.Mandatory, dataItem.ReadOnly, dataItem.Label,
                                                    dataItem.Description.ToString(), dataItem.Color, dataItem.DisplayOrder, (bool)dataItem.Dummy);
                return(signature);
            }
            else if (dataItemObj["Type"].ToString() == "Date")
            {
                Date date = new Date(dataItem.Id, dataItem.Mandatory, dataItem.ReadOnly, dataItem.Label,
                                     dataItem.Description.ToString(), dataItem.Color, dataItem.DisplayOrder, (bool)dataItem.Dummy,
                                     DateTime.ParseExact(dataItemObj["MinValue"].ToString(), "yyyy-MM-dd hh:mm:ss", null),
                                     DateTime.ParseExact(dataItemObj["MaxValue"].ToString(), "yyyy-MM-dd hh:mm:ss", null),
                                     dataItemObj["DefaultValue"].ToString());
                return(date);
            }
            else if (dataItemObj["Type"].ToString() == "ShowPdf")
            {
                ShowPdf showPdf = new ShowPdf(dataItem.Id, dataItem.Mandatory, dataItem.ReadOnly, dataItem.Label,
                                              dataItem.Description.ToString(), dataItem.Color, dataItem.DisplayOrder, dataItem.Dummy,
                                              dataItemObj["Value"].ToString());
                return(showPdf);
            }
            else if (dataItemObj["Type"].ToString() == "CheckBox")
            {
                CheckBox checkBox = new CheckBox(dataItem.Id, dataItem.Mandatory, dataItem.ReadOnly, dataItem.Label,
                                                 dataItem.Description.ToString(), dataItem.Color, dataItem.DisplayOrder, dataItem.Dummy,
                                                 bool.Parse(dataItemObj["DefaultValue"].ToString()), bool.Parse(dataItemObj["Selected"].ToString()));
                return(checkBox);
            }
            else if (dataItemObj["Type"].ToString() == "MultiSelect")
            {
                List <KeyValuePair> keyValuePairList = new List <KeyValuePair>();
                foreach (JObject keyValuePairObj in dataItemObj["KeyValuePairList"])
                {
                    KeyValuePair keyValuePair = keyValuePairObj.ToObject <KeyValuePair>();
                    keyValuePairList.Add(keyValuePair);
                }
                MultiSelect multiSelect = new MultiSelect(dataItem.Id, dataItem.Mandatory, dataItem.ReadOnly, dataItem.Label,
                                                          dataItem.Description.ToString(), dataItem.Color, dataItem.DisplayOrder, dataItem.Dummy, keyValuePairList);
                return(multiSelect);
            }
            else if (dataItemObj["Type"].ToString() == "SingleSelect")
            {
                List <KeyValuePair> keyValuePairList = new List <KeyValuePair>();
                foreach (JObject keyValuePairObj in dataItemObj["KeyValuePairList"])
                {
                    KeyValuePair keyValuePair = keyValuePairObj.ToObject <KeyValuePair>();
                    keyValuePairList.Add(keyValuePair);
                }
                SingleSelect singleSelect = new SingleSelect(dataItem.Id, dataItem.Mandatory, dataItem.ReadOnly, dataItem.Label,
                                                             dataItem.Description.ToString(), dataItem.Color, dataItem.DisplayOrder, dataItem.Dummy, keyValuePairList);
                return(singleSelect);
            }
            else if (dataItemObj["Type"].ToString() == "Number")
            {
                Number number = new Number(dataItem.Id, dataItem.Mandatory, dataItem.ReadOnly, dataItem.Label,
                                           dataItem.Description.ToString(), dataItem.Color, dataItem.DisplayOrder, dataItem.Dummy,
                                           dataItemObj["MinValue"].ToString(), dataItemObj["MaxValue"].ToString(),
                                           int.Parse(dataItemObj["DefaultValue"].ToString()), int.Parse(dataItemObj["DecimalCount"].ToString()),
                                           dataItemObj["UnitName"].ToString());
                return(number);
            }
            else if (dataItemObj["Type"].ToString() == "Text")
            {
                Text text = new Text(dataItem.Id, dataItem.Mandatory, dataItem.ReadOnly, dataItem.Label,
                                     dataItem.Description.ToString(), dataItem.Color, dataItem.DisplayOrder, dataItem.Dummy,
                                     dataItemObj["Value"].ToString(), int.Parse(dataItemObj["MaxLength"].ToString()),
                                     bool.Parse(dataItemObj["GeolocationEnabled"].ToString()), bool.Parse(dataItemObj["GeolocationForced"].ToString()),
                                     bool.Parse(dataItemObj["GeolocationHidden"].ToString()), bool.Parse(dataItemObj["BarcodeEnabled"].ToString()),
                                     dataItemObj["BarcodeType"].ToString());
                return(text);
            }
            else if (dataItemObj["Type"].ToString() == "Comment")
            {
                Comment comment = new Comment(dataItem.Id, dataItem.Mandatory, dataItem.ReadOnly, dataItem.Label,
                                              dataItem.Description.ToString(), dataItem.Color, dataItem.DisplayOrder, dataItem.Dummy,
                                              dataItemObj["Value"].ToString(), int.Parse(dataItemObj["MaxLength"].ToString()),
                                              bool.Parse(dataItemObj["SplitScreen"].ToString()));
                return(comment);
            }
            else if (dataItemObj["Type"].ToString() == "FieldContainer")
            {
                List <DataItem> dataItemList = new List <DataItem>();
                foreach (JObject diObj in dataItemObj["DataItemList"])
                {
                    DataItem di = UnpackDataItem(diObj);
                    dataItemList.Add(di);
                }
                FieldContainer fieldContainer = new FieldContainer(dataItem.Id, dataItem.Label, dataItem.Description,
                                                                   dataItem.Color, dataItem.DisplayOrder, dataItemObj["Value"].ToString(), dataItemList);
                return(fieldContainer);
            }
            return(dataItem);
        }
Exemplo n.º 13
0
 public void SelectPicker()
 {
     var modal = new SingleSelect();
     var a     = modal.ToHtml();
 }