Service update, import changes from web_portal

This commit is contained in:
Claudio Boggian
2023-06-21 10:38:57 +02:00
parent 39fa4dedf3
commit bb99cef33c
101 changed files with 4266 additions and 3044 deletions
@@ -1,11 +1,12 @@
using console_spo_utils.Constants;
using console_spo_utils.Interfaces.Repositories;
using console_spo_utils.Interfaces.Services;
using library_spo_utils.Constants;
using library_spo_utils.Enums;
using library_spo_utils.Interfaces.Repositories;
using library_spo_utils.Interfaces.Services;
using Microsoft.Extensions.Logging;
using Microsoft.SharePoint.Client;
using Microsoft.SharePoint.Client.DocumentSet;
namespace console_spo_utils.Services;
namespace library_spo_utils.Services;
internal class QuotationDocSetService : IQuotationDocSetService
{
@@ -13,16 +14,19 @@ internal class QuotationDocSetService : IQuotationDocSetService
private readonly ILogger<QuotationDocSetService> logger;
private readonly IOneNoteService oneNoteService;
private readonly IQuotationRepository quotationRepository;
private readonly IFieldEntryDataUpdate _fieldEntryDataUpdate;
public QuotationDocSetService(ISharePointCustomOperation cpt,
ILogger<QuotationDocSetService> logger,
IOneNoteService oneNoteService,
IQuotationRepository quotationRepository)
IQuotationRepository quotationRepository,
IFieldEntryDataUpdate fieldEntryDataUpdate)
{
this.cpt = cpt;
this.logger = logger;
this.oneNoteService = oneNoteService;
this.quotationRepository = quotationRepository;
_fieldEntryDataUpdate = fieldEntryDataUpdate;
}
public void Create(string quotationName, string docLibraryName, string tenantName, ClientContext ctx)
@@ -73,15 +77,18 @@ internal class QuotationDocSetService : IQuotationDocSetService
Console.WriteLine($"> DocumentSet {quotationName} creata.");
var dsItem = list.RootFolder.Folders.GetByUrl(quotationName).ListItemAllFields;
//var dsItem = list.RootFolder.Folders.GetByUrl(quotationName).ListItemAllFields;
dsItem["PAL_ID_Quotation"] = quotationRepository.DefaultIdQuotation(quotationName);
dsItem["PAL_Quotation_Name"] = quotationRepository.DefaultQuotationName(quotationName);
dsItem["PAL_Quotation_Reason"] = quotationRepository.DefaultQuotationReason(quotationName);
dsItem["PAL_Authors"] = quotationRepository.DefaultAuthors(quotationName);
//dsItem["PAL_ID_Quotation"] = quotationRepository.DefaultIdQuotation(quotationName);
//dsItem["PAL_Quotation_Name"] = quotationRepository.DefaultQuotationName(quotationName);
//dsItem["PAL_Quotation_Reason"] = quotationRepository.DefaultQuotationReason(quotationName);
//dsItem["PAL_Authors"] = quotationRepository.DefaultAuthors(quotationName);
//dsItem["PAL_Status"] = quotationRepository.DefaultQuotationState(quotationName);
dsItem.Update();
ctx.ExecuteQuery();
//dsItem.Update();
//ctx.ExecuteQuery();
_fieldEntryDataUpdate.FieldUpdate(ctx, docLibraryName, quotationName, FieldUpdateType.Quotation);
Console.WriteLine($"> Field value update.");
@@ -89,7 +96,9 @@ internal class QuotationDocSetService : IQuotationDocSetService
#region Quotation Folder
foreach (var name in Folders.OfferDocSet)
var revision = "Rev.00";
foreach (var name in Folders.OfferDocSet(revision))
{
Console.WriteLine($"La sotto cartella {name} verrà creata in {quotationName}");
var rPath = ResourcePath.FromDecodedUrl($"{quotationName}/{name}");