Beispiel #1
0
        private async Task <IActionResult> GetReportResult(EquipmentInspectionDto model)
        {
            //var dataSet = new DataSet();
            //dataSet.ReadXml(StiNetCoreHelper.MapPath(this, "Reports/Data/Demo.xml"));

            //var report = new StiReport();
            //report.Load(StiNetCoreHelper.MapPath(this, "Reports/TwoSimpleLists.mrt"));
            //report.RegData(dataSet);
            var report = await _builder.GetReport(model);

            return(await StiNetCoreViewer.GetReportResultAsync(this, report));
        }
Beispiel #2
0
        public async Task <IActionResult> Post(EquipmentInspectionDto model)
        {
            var requestParams = StiNetCoreViewer.GetRequestParams(this);

            switch (requestParams.Action)
            {
            case StiAction.GetReport:
                return(await GetReportResult(model));

            default:
                return(await StiNetCoreViewer.ProcessRequestResultAsync(this));
            }
        }
        public async Task <List <EquipmentInspectionViewModel> > GetReport(EquipmentInspectionDto dto)
        {
            var parameters = new List <SqlParameter>()
            {
                new SqlParameter {
                    ParameterName = "DepartmentList", Value = dto.DepartmentList, SqlDbType = SqlDbType.VarChar, Size = -1
                },
                new SqlParameter {
                    ParameterName = "CategoryList", Value = dto.CategoryList, SqlDbType = SqlDbType.VarChar, Size = -1
                },
                new SqlParameter {
                    ParameterName = "Equip1", Value = dto.Equip1, SqlDbType = SqlDbType.VarChar, Size = 10
                },
                new SqlParameter {
                    ParameterName = "Equip2", Value = dto.Equip2, SqlDbType = SqlDbType.VarChar, Size = 10
                },
                new SqlParameter {
                    ParameterName = "Barcode1", Value = dto.Barcode1, SqlDbType = SqlDbType.VarChar, Size = 17
                },
                new SqlParameter {
                    ParameterName = "Barcode2", Value = dto.Barcode2, SqlDbType = SqlDbType.VarChar, Size = 17
                },
                new SqlParameter {
                    ParameterName = "Date1", Value = dto.Date1, SqlDbType = SqlDbType.Date
                },
                new SqlParameter {
                    ParameterName = "Date2", Value = dto.Date2, SqlDbType = SqlDbType.Date
                },
                new SqlParameter {
                    ParameterName = "InspectionType", Value = dto.InspectionType, SqlDbType = SqlDbType.VarChar, Size = 10
                },
                new SqlParameter {
                    ParameterName = "Location", Value = dto.Location, SqlDbType = SqlDbType.VarChar, Size = -1
                },
                new SqlParameter {
                    ParameterName = "UserId", Value = dto.UserId, SqlDbType = SqlDbType.VarChar, Size = 10
                },
                new SqlParameter {
                    ParameterName = "EquipList", Value = dto.EquipList, SqlDbType = SqlDbType.VarChar, Size = -1
                },
                new SqlParameter {
                    ParameterName = "Language", Value = dto.Language, SqlDbType = SqlDbType.VarChar, Size = 10
                },
            };

            return(await _context.ExecuteStoreProcedureAsync <EquipmentInspectionViewModel>("rpEquipmentInspection", parameters));
        }