public IEnumerable <ReportOverview> Get(string workArea, string productionLineFilter, string workCellFilter,
                                                string ruleTypeFilter,
                                                string materialFilter,
                                                int pageNumber, int pageSize)
        {
            var list = new List <ReportOverview>();

            IQueryOperations storageManager = StorageManagerFactory.CreateDatabaseManager(this.ConnectionString);
            var set = storageManager.ExecuteCommand("sp_VCC_local_reportOverview",
                                                    new[]
            {
                this.CreateDataParameter("@workArea", workArea),
                this.CreateDataParameter("@productionLineFilter", productionLineFilter),
                this.CreateDataParameter("@workCellFilter", workCellFilter),
                this.CreateDataParameter("@ruleTypeFilter", ruleTypeFilter),
                this.CreateDataParameter("@materialFilter", materialFilter),
                this.CreateDataParameter("@pageNumber", pageNumber),
                this.CreateDataParameter("@pageSize", pageSize),
            });

            if (set.IsEmpty())
            {
                return(list);
            }

            var rows = set.Tables[0].Rows.Cast <DataRow>();

            return(rows.MapTo <IEnumerable <ReportOverview> >());
        }
Пример #2
0
        // GET api/<controller>
        public IEnumerable <ReportOverviewViewModel> Get(string area)
        {
            var list = new List <ReportOverviewViewModel>();

            IQueryOperations storageManager = StorageManagerFactory.CreateDatabaseManager(_connectionString);
            var set = storageManager.ExecuteCommand("sp_VCC_local_reportOverview", new[] { new SqlParameter("@workArea", area) });

            if (set.IsEmpty())
            {
                return(list);
            }

            var rows = set.Tables[0].Rows.Cast <DataRow>();

            return(rows.MapTo <IEnumerable <ReportOverviewViewModel> >());
        }