Exemplo n.º 1
0
        public static string GetPropertyValue(IAutoviewDto autoviewDto, PropertyInfo propertyInfo)
        {
            var propertyValue = propertyInfo.GetValue(obj: autoviewDto);

            if (propertyValue is null)
            {
                return(default);
Exemplo n.º 2
0
        public static void Dropdown
            (this IAutoviewDto autoviewDto, string propertyName, List <SelectListItem> selectListItems, string displayName = default, string cssId = default, string cssClass = default)
        {
            string propertyValue = Extensions.GetPropertyValue(autoviewDto, propertyName);

            var dropdownInstance = new Elements.Dropdown.Dropdown(propertyName, propertyValue, selectListItems, displayName, cssId, cssClass);

            autoviewDto.InitalElement(element: dropdownInstance);
        }
Exemplo n.º 3
0
        public static void Textbox
            (this IAutoviewDto autoviewDto, string propertyName, string displayName = default, string cssId = default, string cssClass = default)
        {
            string propertyValue = Extensions.GetPropertyValue(autoviewDto, propertyName);

            var textboxInstance = new Elements.Inputs.Textbox(propertyName, propertyValue, displayName, cssId, cssClass);

            autoviewDto.InitalElement(element: textboxInstance);
        }
Exemplo n.º 4
0
        public Mainboard InitialElements(IAutoviewDto dto)
        {
            dto.InitialDto();

            dto.Textbox(nameof(FullName));

            dto.Dropdown(propertyName: nameof(Dropdown), selectListItems: DropdownItems());

            return(Initializer.Return());
        }
Exemplo n.º 5
0
        public static PropertyInfo GetPropertyInfoOfDtoByName(IAutoviewDto autoviewDto, string propertyName)
        {
            var getPropertyInfoFromDto = Extensions.GetPropertyInfoByName(autoviewDto, propertyName);

            if (getPropertyInfoFromDto is null)
            {
                throw new Exception("property info not found");
            }

            return(getPropertyInfoFromDto);
        }
Exemplo n.º 6
0
        public static Property InitProperty(IAutoviewDto autoviewDto, AElement element, ModelStateDictionary modelstate)
        {
            PropertyInfo getPropertyInfo = GetPropertyInfoOfDtoByName(autoviewDto, propertyName: element.Name);

            string getPropertyValue = Extensions.GetPropertyValue(autoviewDto, propertyInfo: getPropertyInfo);

            var newProperty = new Property(propertyValue: getPropertyValue, element, propertyInfo: getPropertyInfo);

            InitPropertyErrors(property: ref newProperty, modelstate);

            newProperty.Element = newProperty.Element.InitialElement(property: newProperty);

            return(newProperty);
        }
Exemplo n.º 7
0
 public static void InitalElement(this IAutoviewDto autoviewDto, AElement element)
 {
     Mainboard.Elements.Add(item: element);
 }
Exemplo n.º 8
0
 public static void InitialDto(this IAutoviewDto autoviewDto)
 {
     Mainboard = new Mainboard(autoviewDto: autoviewDto);
 }
Exemplo n.º 9
0
 public static void CheckPropertyAndAddToTempList(ref List <Property> listOfProperties, IAutoviewDto autoviewDto, AElement element, ModelStateDictionary modelstate)
 {
     try
     {
         listOfProperties.Add(item: InitProperty(autoviewDto, element, modelstate));
     }
     catch { }
 }
Exemplo n.º 10
0
 public static PropertyInfo GetPropertyInfoByName(IAutoviewDto autoviewDto, string propertyName)
 {
     return(autoviewDto.GetType().GetProperty(name: propertyName));
 }
Exemplo n.º 11
0
 public static PropertyInfo[] ArrayOfPropertyInfos(IAutoviewDto autoviewDto)
 {
     return(autoviewDto.GetType().GetProperties());
 }
Exemplo n.º 12
0
        public Mainboard(IAutoviewDto autoviewDto)
        {
            AutoviewDto = autoviewDto;

            Elements = new List <AElement>();
        }