Ejemplo n.º 1
0
        public static FormViewModel CreateBasicFromObject(DB.Form form1)
        {
            var formView = new FormViewModel
            {
                Title            = form1.Title,
                FormID           = form1.FormID,
                Slug             = form1.Slug,
                IsPublic         = form1.IsPublic,
                PublicFormType   = form1.PublicFormType,
                InternalFormType = form1.InternalFormType,
                DateAdded        = form1.DateAdded.Value,
                CreatedBy        = form1.CreatedBy,
                UpdatedBy        = form1.UpdatedBy,
            };

            if (form1.CreatedDateTime.HasValue)
            {
                formView.CreatedDateTime = form1.CreatedDateTime.Value;
            }

            if (form1.UpdatedDateTime.HasValue)
            {
                formView.UpdatedDateTime = form1.UpdatedDateTime.Value;
            }

            return(formView);
        }
Ejemplo n.º 2
0
 public static FormViewModel CreateFromObject(DB.Form form1, Constants.TemplateMode mode)
 {
     if (form1 != null)
     {
         var formView = CreateBasicFromObject(form1);
         return(formView);
     }
     return(FormViewModel.Initialize());
 }
Ejemplo n.º 3
0
        public static FormViewModel CreateMock()
        {
            var formView = new FormViewModel
            {
                Title     = "Test Form",
                FormID    = 1,
                DateAdded = DateTime.Now,
            };

            return(formView);
        }
Ejemplo n.º 4
0
        public static FormViewModel Initialize()
        {
            var formView = new FormViewModel();

            return(formView);
        }