Beispiel #1
0
        public AbstractFormsController(AbstractFormContext context)
        {
            _context = context;

            if (_context.AbstractForms.Count() == 0)
            {
                AbstractForm form = new AbstractForm();
                form.Name = "Display Type 1";
                AbstractSection section = new AbstractSection();
                section.Label = "Demographics";

                AbstractDataItem item = new AbstractDataItem();
                item.Label = "First Name";
                section.DataItems.Add(item);

                item       = new AbstractDataItem();
                item.Label = "Last Name";
                section.DataItems.Add(item);

                item       = new AbstractDataItem();
                item.Label = "Birth Date";
                section.DataItems.Add(item);

                item       = new AbstractDataItem();
                item.Label = "Street Address";
                section.DataItems.Add(item);

                item       = new AbstractDataItem();
                item.Label = "City";
                section.DataItems.Add(item);

                item       = new AbstractDataItem();
                item.Label = "State";
                section.DataItems.Add(item);

                form.Sections.Add(section);

                _context.AbstractForms.Add(form);

                _context.SaveChanges();
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="AttributeIndex"/> class.
 /// </summary>
 /// <param name="parent">The parent.</param>
 public AttributeIndex(AbstractSection parent)
 {
     _parent = parent;
 }