コード例 #1
0
        public async Task <List <ViewTableFiled> > GetViewTableInfoAsync(int iTableId = 0)
        {
            List <TableFiled>     lstTableFiled     = new List <TableFiled>();
            List <ViewTableFiled> lstViewTableFiled = new List <ViewTableFiled>();

            if (iTableId > 0)
            {
                lstTableFiled = await _tableFiledRepository.SelectALLAsync(new TableFiled()
                {
                    IdataTableId = iTableId
                }, null, 1);
            }
            else
            {
                lstTableFiled = await _tableFiledRepository.SelectALLAsync();
            }
            lstViewTableFiled = _mapper.Map <List <ViewTableFiled> >(lstTableFiled);
            foreach (ViewTableFiled entityTableFiled in lstViewTableFiled)
            {
                DataType entityDataType = await _dataTypeService.SelectAsync(entityTableFiled.IdataTypeId);

                DataTable entityDataTable = await _dataTableService.SelectAsync(entityTableFiled.IdataTableId);

                if (entityDataType != null)
                {
                    entityTableFiled.StypeName = entityDataType.StypeName;
                }
                if (entityDataTable != null)
                {
                    entityTableFiled.StableName = entityDataTable.StableName;
                }
            }
            return(lstViewTableFiled);
        }
コード例 #2
0
        public async Task <IActionResult> TableInfo(int iPageId, int iTableId)
        {
            DataTable entityDataTable = await _dataTableService.SelectAsync(iTableId);

            if (entityDataTable != null)
            {
                DataBase entityDataBase = await _dataBaseService.SelectAsync(entityDataTable.IdataBaseId);

                if (entityDataBase != null)
                {
                    ViewBag.entityDataBase = entityDataBase;
                }
                List <ViewTableFiled> lstViewTableFiled = await _tableFiledService.GetViewTableInfoAsync(entityDataTable.Id);

                //生成Mapping映射类
                ViewBag.lstTableFiled   = lstViewTableFiled;
                ViewBag.entityDataTable = entityDataTable;
            }
            return(Empty(iPageId));
        }