DD.WellWorkover.Cloud/ConsoleApp1/Program.cs

73 lines
1.9 KiB
C#
Raw Normal View History

using AsbCloudApp.Data;
using AsbCloudApp.Data.DailyReport;
using AsbCloudInfrastructure.Services.DailyReport;
using ClosedXML.Excel;
2022-05-05 10:06:15 +05:00
using System;
using System.IO;
namespace ConsoleApp1
{
2022-06-15 14:57:37 +05:00
class Program
2021-10-03 20:08:17 +05:00
{
2022-06-01 12:18:10 +05:00
// use ServiceFactory to make services
2021-07-28 09:47:13 +05:00
static void Main(/*string[] args*/)
{
var block = new DailyReportHeadDto()
2022-05-06 16:35:16 +05:00
{
AzimuthAngle = 12,
WellName = "WellName",
ClusterName = "clusterName",
Customer = "customer",
Contractor = "Contractor",
ReportDate = DateTime.Now,
WellDepthIntervalFinishDate = 27.5,
WellDepthIntervalStartDate = 26.5,
BottomholeDepth = 66.6
};
var block2 = new DailyReportBhaDto()
{
BHADescription = "sadasdasdasdasdasdjlaskjdaksjdlasdlalskdklj"
};
var block3 = new DailyReportSaubDto();
var bloks = new DailyReportDto()
{
HeadDto = block,
SaubDto = block3
};
var service = new DailyReportMakerExcel();
var stream = service.MakeReportFromBlocks(bloks);
var filename = "____.xlsx";
if (File.Exists(filename))
File.Delete(filename);
using var fileStream = File.OpenWrite(filename);
stream.CopyTo(fileStream);
return;
2022-06-22 23:26:04 +05:00
//var ms = MakeReportFromBlocks(block,block3);
////File.Create("", MakeReportFromBlocks(block));
//using var file = new FileStream("file.xlsx", FileMode.Create, System.IO.FileAccess.Write);
//byte[] bytes = new byte[ms.Length];
//ms.Read(bytes, 0, (int)ms.Length);
//file.Write(bytes, 0, bytes.Length);
//ms.Close();
}
2022-06-22 23:26:04 +05:00
}
}