本文整理汇总了C#中Lot.Commit方法的典型用法代码示例。如果您正苦于以下问题:C# Lot.Commit方法的具体用法?C# Lot.Commit怎么用?C# Lot.Commit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lot
的用法示例。
在下文中一共展示了Lot.Commit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateLicenceEdition
public void UpdateLicenceEdition(Guid licenceEditionDocBlobKey, int editionPartIndex, Lot lot)
{
PartVersion<PersonLicenceEditionDO> licenceEditionPartVersion = lot.Index.GetPart<PersonLicenceEditionDO>(string.Format("licenceEditions/{0}", editionPartIndex));
using (var transaction = this.unitOfWork.BeginTransaction())
{
licenceEditionPartVersion.Content.PrintedDocumentBlobKey = licenceEditionDocBlobKey;
GvaFile printedLicenceFile = new GvaFile()
{
Filename = "migratedLicence",
FileContentId = licenceEditionDocBlobKey,
MimeType = "application/pdf"
};
this.unitOfWork.DbContext.Set<GvaFile>().Add(printedLicenceFile);
this.unitOfWork.Save();
licenceEditionPartVersion.Content.PrintedFileId = printedLicenceFile.GvaFileId;
lot.UpdatePart<PersonLicenceEditionDO>(string.Format("licenceEditions/{0}", licenceEditionPartVersion.Part.Index), licenceEditionPartVersion.Content, this.userContext);
lot.Commit(this.userContext, this.lotEventDispatcher);
this.lotRepository.ExecSpSetLotPartTokens(licenceEditionPartVersion.PartId);
this.unitOfWork.Save();
transaction.Commit();
}
}
示例2: UpdateLotCaseTypes
public void UpdateLotCaseTypes(string set, GvaCaseType caseType, Lot lot, UserContext userContext)
{
Part updatedPart = null;
if (set == "Person")
{
PersonDataDO personData = lot.Index.GetPart<PersonDataDO>("personData").Content;
personData.CaseTypes.Add(caseType.GvaCaseTypeId);
this.caseTypeRepository.AddCaseTypes(lot, personData.CaseTypes);
updatedPart = lot.UpdatePart("personData", personData, userContext).Part;
}
else if (set == "Organization")
{
NomValue caseTypeNom = new NomValue()
{
NomValueId = caseType.GvaCaseTypeId,
Name = caseType.Name,
Alias = caseType.Alias
};
OrganizationDataDO organizationData = lot.Index.GetPart<OrganizationDataDO>("organizationData").Content;
organizationData.CaseTypes.Add(caseTypeNom);
this.caseTypeRepository.AddCaseTypes(lot, organizationData.CaseTypes.Select(ct => ct.NomValueId));
updatedPart = lot.UpdatePart("organizationData", organizationData, userContext).Part;
}
lot.Commit(userContext, this.lotEventDispatcher);
this.unitOfWork.Save();
this.lotRepository.ExecSpSetLotPartTokens(updatedPart.PartId);
}