Beispiel #1
0
        public MainWindowViewModel(IUsersService usersService,
                                   ITableInfoService tableInfoService,
                                   IColumnInfoService columnInfoService)
        {
            _usersService      = usersService;
            _tableInfoService  = tableInfoService;
            _columnInfoService = columnInfoService;

            _isLoggedIn          = false;
            _accountPopupBoxIcon = new PackIcon
            {
                Kind       = PackIconKind.AccountRemove,
                Width      = 24,
                Height     = 24,
                Margin     = new Thickness(4, 0, 4, 0),
                Foreground = new SolidColorBrush(Color.FromRgb(244, 67, 54))
            };

            _allItems = GenerateNavItems();
            FilterItems(null);

            _selectedItem = _navItems[0];

            MovePrevCommand = new AnotherCommandImplementation(
                _ => SelectedIndex--,
                _ => SelectedIndex > 0);

            MoveNextCommand = new AnotherCommandImplementation(
                _ => SelectedIndex++,
                _ => SelectedIndex < _allItems.Count - 1);
        }
Beispiel #2
0
        public ExportEntityViewModel(ITableInfoService tableInfoService, IColumnInfoService columnInfoService)
        {
            _tableInfoService  = tableInfoService;
            _columnInfoService = columnInfoService;

            _dbServerHistoryItems = DbServerInfoFile.GetDbServerInfoHistoryItems();

            _currentDbServerInfoItem = new DbServerInfo();
        }
Beispiel #3
0
        public MainWindow(IUsersService usersService,
                          ITableInfoService tableInfoService,
                          IColumnInfoService columnInfoService)
        {
            InitializeComponent();

            DataContext = new MainWindowViewModel(usersService, tableInfoService, columnInfoService);

            _i = 0;

            SnackBar = MainSnackBar;
        }
Beispiel #4
0
        public static TableModel GetPagerData(ITableInfoService tableInfoService, ITableDataService tableDataService, string tabName, string orderBy, string sort, int pageSize, int pageIndex = 1)
        {
            var tabInfo = TableInfoHelper.GetTableInfo(tableInfoService, tabName);

            pageSize = pageSize <= 0 ? 20 : pageSize;
            string orderInfo = "";

            if (string.IsNullOrEmpty(orderBy) || string.IsNullOrEmpty(sort))
            {
                orderInfo = "[ID] DESC";
            }
            else
            {
                orderInfo = string.Format("[{0}] {1}", orderBy, sort);
            }

            var tableDataRs = tableDataService.GetPagerData(new GetPagerDataRequest()
            {
                TableName = tabInfo.Name,
                OrderBy   = orderInfo,
                PageSize  = pageSize,
                PageIndex = pageIndex
            });

            tableDataRs.CheckErrorAndThrowIt();

            var           pagerInfo = tableDataRs.Data;
            TableDataInfo info      = new TableDataInfo
            {
                TableData = pagerInfo.PagerData,
                TableInfo = tabInfo
            };

            Webdiyer.WebControls.Mvc.PagedList <DataRow> arts
                = new Webdiyer.WebControls.Mvc.PagedList <DataRow>(pagerInfo.PagerData.Select(), pageIndex, pageSize, pagerInfo.RecordCount);
            TableModel model = new TableModel();

            var requestInfo = new Models.RequestInfo
            {
                OrderBy   = orderBy,
                Sort      = sort,
                PageIndex = pageIndex
            };

            model.PagedList   = arts;
            model.TableInfo   = info;
            model.RequestInfo = requestInfo;

            return(model);
        }
Beispiel #5
0
        public static TableInfoDto GetTableInfo(ITableInfoService tableInfoService, string tabName)
        {
            var tableRs = tableInfoService.GetTable(
                new GetTableRequest()
            {
                TableName = tabName
            }
                );

            tableRs.CheckErrorAndThrowIt();
            var tabInfo = tableRs.Data;

            if (tabInfo == null)
            {
                throw new MyFX.Core.Exceptions.AppServiceException(string.Format("未查询到表[{0}]的信息", tabName));
            }

            return(tabInfo);
        }
Beispiel #6
0
        public ExportEntity(ITableInfoService tableInfoService, IColumnInfoService columnInfoService)
        {
            InitializeComponent();

            DataContext = new ExportEntityViewModel(tableInfoService, columnInfoService);
        }
Beispiel #7
0
 public ValuesController(ITableInfoService tableInfoService)
 {
     _tableInfoService = tableInfoService;
 }
Beispiel #8
0
 public TableController(ITableInfoService tableInfoService, ITableDataService tableDataService)
 {
     _tableInfoService = tableInfoService;
     _tableDataService = tableDataService;
 }