Exemplo n.º 1
0
        public virtual async Task RenderFormAsync(IModel r)
        {
            if (r == null)
            {
                throw new BaseEngineException("پارامتر نال است");
            }


            var parameters = Request?.Params;

            IDropDownParameter    dropdownparam          = GetDropDownParams(parameters);
            ITreeParameter        _ITreeParameter        = GetTreeParams(parameters);
            IMultiSelectParameter _IMultiSelectParameter = GetMultiSelectParams(parameters);
            IDataTableParameter   _IDataTableParameter   = GetDataTableParams(parameters);

            Dictionary <string, DropDownAttribute>      dropdowns    = _engineService.GetModelDropdownAttributes <T>();
            Dictionary <string, DataTableAttribute>     datatables   = _engineService.GetModelTableAttributes <T>();
            Dictionary <string, TreeAttribute>          trees        = _engineService.GetModelTreeAttributes <T>();
            Dictionary <string, MultiSelectAttribute>   multiselects = _engineService.GetModelMultiSelectAttributes <T>();
            Dictionary <string, List <SelectListItem> > enums        = _engineService.GetEnumsAttributes <T>(r);

            Dictionary <string, List <IDropDownOption> > dropdownData =
                await _engineService.GetDropdownDataAsync(dropdowns, dropdownparam);

            Dictionary <string, IQueryable <IDataTable> > dataTableData =
                await _engineService.GetDataTableDataAsync(datatables, _IDataTableParameter);

            Dictionary <string, ITreeNode> treeData = await _engineService.GetTreeDataAsync(trees, _ITreeParameter);

            Dictionary <string, List <IDropDownOption> > multiSelectData =
                await _engineService.GetMultiSelectDataAsync(multiselects, _IMultiSelectParameter);

            _engineService.SetData(dropdownData.Keys.ToArray(), dropdownData.Values.ToArray(), ViewData);
            _engineService.SetData(dataTableData.Keys.ToArray(), datatables.Values.ToArray(), ViewData);
            _engineService.SetData(treeData.Keys.ToArray(), treeData.Values.ToArray(), ViewData);
            _engineService.SetData(multiSelectData.Keys.ToArray(), multiSelectData.Values.ToArray(), ViewData);
            _engineService.SetData(enums.Keys.ToArray(), enums.Values.ToArray(), ViewData);
        }
Exemplo n.º 2
0
 public virtual async Task <List <IDropDownOption> > GetMultiSelectAsync(IMultiSelectParameter p)
 {
     return(await Task.FromResult <List <IDropDownOption> >(null));
 }
Exemplo n.º 3
0
 /// <summary>
 /// دیتای های مربوط به MultiSelectData را بر میگرداند
 /// </summary>
 /// <typeparam name="B"></typeparam>
 /// <returns></returns>
 public virtual async Task <Dictionary <string, List <IDropDownOption> > > GetMultiSelectDataAsync
     (Dictionary <string, MultiSelectAttribute> multiselect, IMultiSelectParameter @params)
 {
     return(await GetDataAsync <List <IDropDownOption>, MultiSelectAttribute>(multiselect, @params));
 }