Example #1
0
        public static ModelReport CreateReportFrom(Schema2.ModelRoot model)
        {
            var rrrr = new ModelReport();

            foreach (var vb in model.LogicalBufferViews.Where(item => item.IsVertexBuffer))
            {
                rrrr._VertexBuffers.Add(vb.Content.Count);
            }
            foreach (var ib in model.LogicalBufferViews.Where(item => item.IsIndexBuffer))
            {
                rrrr._IndexBuffers.Add(ib.Content.Count);
            }
            foreach (var db in model.LogicalBufferViews.Where(item => item.IsDataBuffer))
            {
                rrrr._DataBuffers.Add(db.Content.Count);
            }

            foreach (var mesh in model.LogicalMeshes)
            {
                rrrr._Meshes.Add(new MeshReport(mesh));
            }

            foreach (var scene in model.LogicalScenes)
            {
                var r = new VisualReport();
                r.SetFrom(scene);
                rrrr._Scenes.Add(r);
            }

            rrrr.SetFrom(rrrr._Scenes);

            return(rrrr);
        }
Example #2
0
 public async void ModelReportGenTestOk()
 {
     //SummitReportSettings.Instance.ConnectionString = "data source=summittest.database.windows.net;initial catalog=MARS;user=simsa;password=D3n^3r#$";
     SummitReportSettings.Instance.ConnectionString = "data source=NSWIN10VM;initial catalog=MARS;user=simsa;password=D3n^3r#$";
     var rpt = new ModelReport();
     var generatedFIleName = await rpt.GenerateAsync(2);
 }
Example #3
0
        public static ModelReport CreateReportFrom(Schema2.ModelRoot model)
        {
            var rrrr = new ModelReport();

            foreach (var bv in model.LogicalBufferViews.Where(item => item.DeviceBufferTarget == BufferMode.ARRAY_BUFFER))
            {
                rrrr._VertexBuffers.Add(bv.Content.Count);
            }
            foreach (var iv in model.LogicalBufferViews.Where(item => item.DeviceBufferTarget == BufferMode.ELEMENT_ARRAY_BUFFER))
            {
                rrrr._IndexBuffers.Add(iv.Content.Count);
            }
            foreach (var dv in model.LogicalBufferViews.Where(item => item.DeviceBufferTarget == null))
            {
                rrrr._DataBuffers.Add(dv.Content.Count);
            }


            foreach (var mesh in model.LogicalMeshes)
            {
                rrrr._Meshes.Add(new MeshReport(mesh));
            }

            foreach (var scene in model.LogicalScenes)
            {
                var r = new VisualReport();
                r.SetFrom(scene);
                rrrr._Scenes.Add(r);
            }

            rrrr.SetFrom(rrrr._Scenes);

            return(rrrr);
        }
Example #4
0
        public IHttpActionResult GetReportData(HttpRequestMessage request, ModelReport model)
        {
            string validateCode = GetHeader(request, "x-session-token");
            string userId       = GetHeader(request, "x-session-userid");
            var    result       = Report.GetReportData(userId, validateCode, model.ProgId, model.queryFieldList);

            return(Ok(result));
        }
Example #5
0
        // ReSharper disable once ParameterOnlyUsedForPreconditionCheck.Local
        internal static void ExpectMembersInReport(ModelReport modelReport, IReadOnlyCollection <string> expectedMembers)
        {
            Assert.NotNull(modelReport);

            Assert.Equal(expectedMembers.Count(), modelReport.Count);

            for (var i = 0; i < expectedMembers.Count(); ++i)
            {
                Assert.Equal(expectedMembers.ElementAt(i), modelReport.Keys.ElementAt(i));
            }
        }
Example #6
0
        private static List <ModelReport> GetReports()
        {
            ModelReport        region;
            string             connectionString = GetConnectionStringDB();
            string             getRegions       = "GetReports";
            List <ModelReport> regionList       = new List <ModelReport>();

            try
            {
                using (SqlConnection connection = new SqlConnection(connectionString))
                {
                    connection.Open();
                    SqlCommand command = new SqlCommand(getRegions, connection);
                    command.CommandType = System.Data.CommandType.StoredProcedure;
                    var reader = command.ExecuteReader();

                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            region           = new ModelReport();
                            region.RegionID  = (int)reader[0];
                            region.CompanyID = (int)reader[1];
                            region.OilID     = (int)reader[2];
                            region.Value     = (decimal)reader["Balance"];
                            region.CDate     = (DateTime)reader["CDate"];
                            regionList.Add(region);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                string error = e.Message;
            }
            return(regionList);
        }
Example #7
0
        public static List <ModelReport> InsertExcelDateToList(DataSet ds)
        {
            List <ModelReport> ReportList = new List <ModelReport>();

            List <Region>  RegionList  = GetRegions();
            List <Company> CompanyList = GetCompanies();
            List <Product> OilList     = GetProducts();


            Region  Region  = new Region();
            Company Company = new Company();
            //get date from excel file
            string   dateString = ds.Tables[0].Rows[4][0].ToString();
            DateTime date       = DateTime.Parse(dateString.Split(' ').Last());

            for (int i = 6; i < ds.Tables[0].Rows.Count; i++)
            {
                string value = ds.Tables[0].Rows[i][0].ToString();

                for (int j = 1; j < 8; j++)
                {
                    if (RegionList.Exists(x => x.RegionName.Trim() == value) == true)
                    {
                        // Get Region
                        Region = RegionList.First(x => x.RegionName.Trim() == value);
                        break;
                    }
                    else if (CompanyList.Where(x => x.CompanyName.Trim() == value).Count() > 0)
                    {
                        // Get Company
                        Company = CompanyList.First(x => x.CompanyName.Trim() == value);

                        string OilName = ds.Tables[0].Rows[5][j].ToString();

                        if (OilList.Exists(x => x.ProductName.Trim() == OilName))
                        {
                            // Get Oil
                            var Oil = OilList.First(x => x.ProductName.Trim() == OilName);

                            //Get Balance
                            decimal Balance = Decimal.Parse(ds.Tables[0].Rows[i][j].ToString());

                            // Collect Report
                            ModelReport report = new ModelReport()
                            {
                                RegionID  = Region.RegionId,
                                CompanyID = Company.CompanyId,
                                OilID     = Oil.ProductId,
                                Value     = Balance,
                                CDate     = date
                            };
                            ReportList.Add(report);
                        }
                    }
                    else
                    {
                    }
                }
            }

            return(ReportList);
        }
Example #8
0
        public void exportReport(ModelReport modelReport, int cycleIndex)
        {
            if (modelReport != null)
            {
                FileStream   fileStream = new FileStream(excelFilePath, FileMode.Open, FileAccess.Read);
                XSSFWorkbook workbook   = new XSSFWorkbook(fileStream);
                fileStream.Close();
                XSSFSheet sheet = (XSSFSheet)workbook.GetSheet("Sheet1");
                initStyle(workbook);

                int     colStartIndex;
                XSSFRow row;
                if (cycleIndex % 2 == 0)
                {
                    //左边
                    colStartIndex = 0;
                    row           = (XSSFRow)sheet.CreateRow(leftRowIndex);
                }
                else
                {
                    //右边
                    colStartIndex = 18;
                    row           = (XSSFRow)sheet.GetRow(rightRowIndex);
                }

                XSSFCell cell = (XSSFCell)row.CreateCell(colStartIndex + 0);
                if (modelReport.warning)
                {
                    cell.CellStyle = warningStyle;
                }
                else
                {
                    cell.CellStyle = commonStyle;
                }
                cell.SetCellValue(modelReport.modelName);

                //期望模型名称和实际模型名称不一致,则不导出数据
                bool isErrorData = false;
                if (!modelReport.modelName.Equals(modelReport.realisticModelName) && !modelReport.modelName.Equals(modelReport.realisticModelName + " RUMI"))
                {
                    isErrorData = true;
                }

                cell           = (XSSFCell)row.CreateCell(colStartIndex + 1);
                cell.CellStyle = commonStyle;
                if (isErrorData)
                {
                    cell.SetCellValue("");
                }
                else
                {
                    cell.SetCellValue(modelReport.signalNumber);
                }

                cell           = (XSSFCell)row.CreateCell(colStartIndex + 2);
                cell.CellStyle = commonStyle;
                if (isErrorData)
                {
                    cell.SetCellValue("");
                }
                else
                {
                    cell.SetCellValue(modelReport.lastInterest);
                }

                cell           = (XSSFCell)row.CreateCell(colStartIndex + 3);
                cell.CellStyle = commonStyle;
                if (isErrorData)
                {
                    cell.SetCellValue("");
                }
                else
                {
                    cell.SetCellValue(modelReport.sharpeRatio);
                }

                cell           = (XSSFCell)row.CreateCell(colStartIndex + 4);
                cell.CellStyle = commonStyle;
                if (isErrorData)
                {
                    cell.SetCellValue("");
                }
                else
                {
                    cell.SetCellValue(modelReport.interestMaxRetracement);
                }

                cell           = (XSSFCell)row.CreateCell(colStartIndex + 5);
                cell.CellStyle = commonStyle;
                if (isErrorData)
                {
                    cell.SetCellValue("");
                }
                else
                {
                    cell.SetCellValue(modelReport.interestMaxRetracementRatio);
                }

                cell           = (XSSFCell)row.CreateCell(colStartIndex + 6);
                cell.CellStyle = commonStyle;
                if (isErrorData)
                {
                    cell.SetCellValue("");
                }
                else
                {
                    cell.SetCellValue(modelReport.hazardRatio);
                }

                cell           = (XSSFCell)row.CreateCell(colStartIndex + 7);
                cell.CellStyle = commonStyle;
                if (isErrorData)
                {
                    cell.SetCellValue("");
                }
                else
                {
                    cell.SetCellValue(modelReport.maxLossPerHand);
                }

                cell           = (XSSFCell)row.CreateCell(colStartIndex + 8);
                cell.CellStyle = commonStyle;
                if (isErrorData)
                {
                    cell.SetCellValue("");
                }
                else
                {
                    cell.SetCellValue(modelReport.avgProfitLossPerHand);
                }

                cell           = (XSSFCell)row.CreateCell(colStartIndex + 9);
                cell.CellStyle = commonStyle;
                if (isErrorData)
                {
                    cell.SetCellValue("");
                }
                else
                {
                    cell.SetCellValue(modelReport.winRatio);
                }

                cell           = (XSSFCell)row.CreateCell(colStartIndex + 10);
                cell.CellStyle = commonStyle;
                if (isErrorData)
                {
                    cell.SetCellValue("");
                }
                else
                {
                    cell.SetCellValue(modelReport.score);
                }

                cell           = (XSSFCell)row.CreateCell(colStartIndex + 11);
                cell.CellStyle = commonStyle;
                if (isErrorData)
                {
                    cell.SetCellValue("");
                }
                else
                {
                    cell.SetCellValue(modelReport.maxProfit);
                }

                cell           = (XSSFCell)row.CreateCell(colStartIndex + 12);
                cell.CellStyle = commonStyle;
                if (isErrorData)
                {
                    cell.SetCellValue("");
                }
                else
                {
                    cell.SetCellValue(modelReport.maxLoss);
                }

                cell           = (XSSFCell)row.CreateCell(colStartIndex + 13);
                cell.CellStyle = commonStyle;
                if (isErrorData)
                {
                    cell.SetCellValue("");
                }
                else
                {
                    cell.SetCellValue(modelReport.maxContinuousProfitabilityTimes);
                }

                cell           = (XSSFCell)row.CreateCell(colStartIndex + 14);
                cell.CellStyle = commonStyle;
                if (isErrorData)
                {
                    cell.SetCellValue("");
                }
                else
                {
                    cell.SetCellValue(modelReport.maxContinuousLossesTimes);
                }

                cell           = (XSSFCell)row.CreateCell(colStartIndex + 15);
                cell.CellStyle = commonStyle;
                if (isErrorData)
                {
                    cell.SetCellValue("");
                }
                else
                {
                    cell.SetCellValue(modelReport.startingDate);
                }

                cell           = (XSSFCell)row.CreateCell(colStartIndex + 16);
                cell.CellStyle = commonStyle;
                if (isErrorData)
                {
                    cell.SetCellValue("");
                }
                else
                {
                    cell.SetCellValue(modelReport.endingDate);
                }

                if (cycleIndex % 2 == 0)
                {
                    //左边
                    leftRowIndex++;
                }
                else
                {
                    //右边
                    rightRowIndex++;
                }
                FileStream fileStreamWrite = new FileStream(excelFilePath, FileMode.Open, FileAccess.Write);
                workbook.Write(fileStreamWrite);
                fileStreamWrite.Close();
            }
        }
        public MainForm()
        {
            InitializeComponent();

            m_modelReport = new ModelReport();
        }
Example #10
0
 public ManChartForm()
 {
     InitializeComponent();
     m_model        = new ModelEmployee();
     m_report_model = new ModelReport();
 }
Example #11
0
 public ItemChartForm()
 {
     InitializeComponent();
     m_model        = new ModelProduct();
     m_report_model = new ModelReport();
 }
Example #12
0
        public SalesAmountForm()
        {
            InitializeComponent();

            w_model = new ModelReport();
        }