2022-07-04 05:29:16 +05:00
|
|
|
|
using AsbCloudApp.Data;
|
|
|
|
|
using AsbCloudApp.Data.DailyReport;
|
|
|
|
|
using AsbCloudInfrastructure.Services.DailyReport;
|
2022-06-17 13:20:48 +05:00
|
|
|
|
using ClosedXML.Excel;
|
2022-05-05 10:06:15 +05:00
|
|
|
|
using System;
|
2022-06-17 13:20:48 +05:00
|
|
|
|
using System.IO;
|
2022-06-30 16:01:46 +05:00
|
|
|
|
|
2021-10-26 17:22:32 +05:00
|
|
|
|
|
|
|
|
|
namespace ConsoleApp1
|
2021-04-02 17:28:07 +05:00
|
|
|
|
{
|
2022-06-15 14:57:37 +05:00
|
|
|
|
|
2021-04-02 17:28:07 +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*/)
|
2021-11-17 10:52:03 +05:00
|
|
|
|
{
|
2022-07-04 05:29:16 +05:00
|
|
|
|
|
|
|
|
|
|
2022-06-17 13:20:48 +05:00
|
|
|
|
var block = new DailyReportHeadDto()
|
2022-05-06 16:35:16 +05:00
|
|
|
|
{
|
2022-06-30 16:01:46 +05:00
|
|
|
|
AzimuthAngle = 12,
|
|
|
|
|
WellName = "WellName",
|
|
|
|
|
ClusterName = "clusterName",
|
|
|
|
|
Customer = "customer",
|
|
|
|
|
Contractor = "Contractor",
|
2022-06-17 13:20:48 +05:00
|
|
|
|
ReportDate = DateTime.Now,
|
2022-06-30 16:01:46 +05:00
|
|
|
|
WellDepthIntervalFinishDate = 27.5,
|
|
|
|
|
WellDepthIntervalStartDate = 26.5,
|
|
|
|
|
BottomholeDepth = 66.6
|
2022-06-17 13:20:48 +05:00
|
|
|
|
};
|
2022-06-29 13:04:30 +05:00
|
|
|
|
var block2 = new DailyReportBhaDto()
|
|
|
|
|
{
|
|
|
|
|
BHADescription = "sadasdasdasdasdasdjlaskjdaksjdlasdlalskdklj"
|
|
|
|
|
};
|
2022-07-04 05:29:16 +05:00
|
|
|
|
var block3 = new DailyReportSaubDto();
|
|
|
|
|
var bloks = new DailyReportDto()
|
|
|
|
|
{
|
|
|
|
|
HeadDto = block,
|
|
|
|
|
SaubDto = block3
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2022-06-24 11:41:46 +05:00
|
|
|
|
|
|
|
|
|
var service = new DailyReportMakerExcel();
|
2022-07-04 05:29:16 +05:00
|
|
|
|
var stream = service.MakeReportFromBlocks(bloks);
|
2022-06-24 11:41:46 +05:00
|
|
|
|
var filename = "____.xlsx";
|
|
|
|
|
if (File.Exists(filename))
|
|
|
|
|
File.Delete(filename);
|
|
|
|
|
using var fileStream = File.OpenWrite(filename);
|
|
|
|
|
stream.CopyTo(fileStream);
|
|
|
|
|
|
|
|
|
|
return;
|
2022-07-04 05:29:16 +05:00
|
|
|
|
|
2022-06-30 16:01:46 +05:00
|
|
|
|
|
|
|
|
|
|
2022-06-24 11:41:46 +05:00
|
|
|
|
|
2022-06-17 13:20:48 +05:00
|
|
|
|
|
2022-06-22 23:26:04 +05:00
|
|
|
|
|
2022-06-29 13:04:30 +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-17 13:20:48 +05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2022-06-22 23:26:04 +05:00
|
|
|
|
|
2022-06-17 13:20:48 +05:00
|
|
|
|
|
|
|
|
|
}
|
2021-04-02 17:28:07 +05:00
|
|
|
|
}
|