public virtual List <IDropDownOption> GetDropDown(IDropDownParameter p) { using (var EngineContext = new EngineContext()) { var _entities = EngineContext.Set <T>(); return(_entities.Select(d => new IDropDownOption { Id = d.Id.ToString(), Value = d.Name }).ToList()); } }
public override List <IDropDownOption> GetDropDown(IDropDownParameter param) { using (var db = new EngineContext()) { return(db.Personnels.Select(p => new IDropDownOption { Id = p.Id.ToString(), Value = p.Name + " " + p.LastName }).ToList()); } }
public override async Task <List <IDropDownOption> > GetDropDownAsync(IDropDownParameter p) { using (var EngineContext = new EngineContext()) { var dt = EngineContext.Set <DefineControllerMethod>(); return(await dt.Select(f => new IDropDownOption { Id = f.Id.ToString(), Value = f.DefineController.Name + "(" + f.Name + ")" }).ToListAsync()); } }
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); }
public virtual ActionResult GetDropDown(IDropDownParameter p) { return(Json(_engineService.GetDropDown(p), JsonRequestBehavior.AllowGet)); }
public virtual async Task <List <IDropDownOption> > GetDropDownAsync(IDropDownParameter p) { return(await Task.FromResult <List <IDropDownOption> >(new List <IDropDownOption>())); }
public virtual List <IDropDownOption> GetMultiSelect(IDropDownParameter p) { return(this.GetDropDown(p)); }
/// <summary> /// دیتای های مربوط به Dropdown را بر میگرداند /// </summary> /// <typeparam name="B"></typeparam> /// <returns></returns> public virtual async Task <Dictionary <string, List <IDropDownOption> > > GetDropdownDataAsync( Dictionary <string, DropDownAttribute> dropdowns, IDropDownParameter @params) { return(await GetDataAsync <List <IDropDownOption>, DropDownAttribute>(dropdowns, @params)); }
public virtual List <IDropDownOption> GetDropDown(IDropDownParameter p) { return(_engineService.GetDropDown(p)); }