R1/R2 refactor
This commit is contained in:
@@ -193,19 +193,28 @@ public class T4R2Processor(
|
||||
controller.SaveRecords(processedLayer.Id, newRecords, Guid.Parse("F392209E-123E-4651-A5A4-0B1D6CF9FF9D"));
|
||||
db.SaveChanges();
|
||||
|
||||
UpdateReport();
|
||||
var reportSheetName = processWorker.Records?.SingleOrDefault(x => x.Code == "GoogleSheetName")?.Desc1;
|
||||
if (reportSheetName == null)
|
||||
{
|
||||
throw new Exception("GoogleSheetName record not found");
|
||||
}
|
||||
|
||||
var invoicesSheetName = processWorker.Records?.SingleOrDefault(x => x.Code == "GoogleSheetName-Invoices")?.Desc1;
|
||||
if (invoicesSheetName == null)
|
||||
{
|
||||
throw new Exception("GoogleSheetName-Invoices record not found");
|
||||
}
|
||||
UpdateReport(processedLayer.Id, reportSheetName, invoicesSheetName);
|
||||
}
|
||||
|
||||
private void UpdateReport()
|
||||
private void UpdateReport(Guid sourceId, string reportSheetName, string invoicesSheetName)
|
||||
{
|
||||
const string sheetId = "1FsUmk_YRIeeGzFCX9tuUJCaLyRtjutX2ZGAEU1DMfJQ";
|
||||
const string reportSheetName = "Raport_R2_Sprzedaz";
|
||||
const string invoicesSheetName = "Raport_R2_Faktury";
|
||||
var request = googleSheetValues.Get(sheetId, "C4:Z4");
|
||||
var response = request.Execute();
|
||||
|
||||
var r2 = db.Layers
|
||||
.Where(x => x.Number == 1501)
|
||||
.Where(x => x.Id == sourceId)
|
||||
.Include(x => x.Records)
|
||||
.FirstOrDefault();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user