public Document(string number, DocumentTypeEnum type) { Number = number; Type = type; Validate(); }
public IReportSaver CreateReportSaver(DocumentTypeEnum documentType) { return(documentType switch { DocumentTypeEnum.Excel => _serviceProvider.GetService <ExcelMonthReportSaver>() ?? throw new NullReferenceException(), _ => throw new ArgumentOutOfRangeException(nameof(documentType), documentType, null) });
public RecentCalibrationsViewModel(Document document, CustomerContact customerContact) { if (document == null) { return; } UserId = document.UserId; Created = document.Created; DocumentId = document.Id; CompanyName = document.CompanyName; DocumentTypeEnum = DocumentTypeHelper.Parse(document); DocumentType = DocumentTypeEnum.AsDisplayString(); DocumentIcon = DocumentType.Replace(" ", ""); Expiration = document.InspectionDate.GetValueOrDefault().Date.AddYears(2); Registration = document.RegistrationNumber; Technician = document.Technician; Customer = document.CustomerContact; DepotName = document.DepotName; if (customerContact != null) { PrimaryEmailAddress = customerContact.Email; SecondaryEmailAddress = customerContact.SecondaryEmail; } }
/// <summary> /// Initializes a new instance of the <see cref="DocumentDetail" /> class. /// </summary> /// <param name="accountHolderCode">The code of account holder, to which the document applies. (required).</param> /// <param name="bankAccountUUID">The unique ID of the Bank Account to which the document applies. >Required if the documentType is `BANK_STATEMENT` (i.e., a document is being submitted in order to verify a bank account). >Refer to the [Onboarding and verification](https://docs.adyen.com/marketpay/onboarding-and-verification) section for details on when a document should be submitted in order to verify a bank account..</param> /// <param name="description">Description of the document..</param> /// <param name="documentType">The type of a document. Permitted values: * `BANK_STATEMENT` denotes an image containing a bank statement or other document proving ownership of a specific bank account. * `PASSPORT` denotes an image containing the identity page(s) of a passport. * `ID_CARD_FRONT` denotes an image containing only the front of the ID card. In order for a document to be usable, both the `ID_CARD_FRONT` and `ID_CARD_BACK` must be submitted. * `ID_CARD_BACK` denotes an image containing only the back of the ID card. In order for a document to be usable, both the `ID_CARD_FRONT` and `ID_CARD_BACK` must be submitted. * `DRIVING_LICENCE_FRONT` denotes an image containing only the front of the driving licence. In order for a document to be usable, both the `DRIVING_LICENCE_FRONT` and `DRIVING_LICENCE_BACK` must be submitted. * `DRIVING_LICENCE_BACK` denotes an image containing only the back of the driving licence. In order for a document to be usable, both the `DRIVING_LICENCE_FRONT` and `DRIVING_LICENCE_FRONT` must be submitted. >Please refer to [Verification checks](https://docs.adyen.com/marketpay/onboarding-and-verification/verification-checks) for details on when each document type should be submitted. (required).</param> /// <param name="filename">Filename of the document. (required).</param> /// <param name="shareholderCode">The code of the shareholder, to which the document applies. >Required if the account holder referred to by the `accountHolderCode` has a `legalEntity` of type `Business` and the `documentType` is either `PASSPORT`, `ID_CARD_FRONT`, `ID_CARD_BACK`, `DRIVING_LICENCE_FRONT`, `DRIVING_LICENCE_BACK` (i.e. a document is being submitted in order to verify a shareholder). >Refer to the [Onboarding and verification](https://docs.adyen.com/marketpay/onboarding-and-verification) section for details on when a document should be submitted in order to verify a shareholder..</param> public DocumentDetail(string accountHolderCode = default(string), string bankAccountUUID = default(string), string description = default(string), DocumentTypeEnum documentType = default(DocumentTypeEnum), string filename = default(string), string shareholderCode = default(string)) { // to ensure "accountHolderCode" is required (not null) if (accountHolderCode == null) { throw new InvalidDataException("accountHolderCode is a required property for DocumentDetail and cannot be null"); } else { this.AccountHolderCode = accountHolderCode; } // to ensure "documentType" is required (not null) if (documentType == null) { throw new InvalidDataException("documentType is a required property for DocumentDetail and cannot be null"); } else { this.DocumentType = documentType; } // to ensure "filename" is required (not null) if (filename == null) { throw new InvalidDataException("filename is a required property for DocumentDetail and cannot be null"); } else { this.Filename = filename; } this.DocumentType = documentType; this.Filename = filename; this.BankAccountUUID = bankAccountUUID; this.Description = description; this.ShareholderCode = shareholderCode; }
public GeneratedDocumentDomain Generate(string inputContent, string fileName, DocumentTypeEnum inputDocType, DocumentTypeEnum outputDocTypeDomain, Nullable <int> templateVersionId) { DocumentTypeDomain inputType = _documentTypeRepository.GetByName(inputDocType.ToString("g")); DocumentTypeDomain outputType = _documentTypeRepository.GetByName(outputDocTypeDomain.ToString("g")); return(Generate(inputContent, fileName, inputType, outputType, templateVersionId)); }
// Helper method for readability // Returns true if input == expectedInput AND output == expectedOutput private bool CompareDocTypes(DocumentTypeDomain inputDocType, DocumentTypeDomain outputDocTypeDomain, DocumentTypeEnum expectedInput, DocumentTypeEnum expectedOutput) { // "g" means that the conversion of enum to string will be the most intuitive one // For example, if the enum value is MyValue then ToString("g") will return "MyValue" return(string.Equals(inputDocType.Name, expectedInput.ToString("g"), StringComparison.CurrentCultureIgnoreCase) && string.Equals(outputDocTypeDomain.Name, expectedOutput.ToString("g"), StringComparison.CurrentCultureIgnoreCase)); }
public DocumentModel GetDocument(DocumentTypeEnum type) { if (Documents == null) { return(null); } return(Documents.Where(d => d.DocumentTypeId == (int)type).FirstOrDefault()); }
public Document(string numero, DocumentTypeEnum tipo) { if (tipo == DocumentTypeEnum.CPF) { setCpf(numero); } Numero = numero; Tipo = tipo; }
public void setCpf(string numero) { if (!ValidaCPF(numero)) { showError(DocumentTypeEnum.CPF); } Numero = numero; Tipo = DocumentTypeEnum.CPF; }
public static string formatForDocument(DocumentTypeEnum documentType) { string format = String.Empty; if (documentType.Equals(DocumentTypeEnum.DNI)) format = "##\\.###\\.###"; else if (documentType.Equals(DocumentTypeEnum.CUIL)) format = "##-########-#"; else if (documentType.Equals(DocumentTypeEnum.CUIT)) format = "##-########-#"; return format; }
public static string maskForDocument(DocumentTypeEnum documentType) { string format = String.Empty; if (documentType.Equals(DocumentTypeEnum.DNI)) format = "00\\.000\\.000"; else if (documentType.Equals(DocumentTypeEnum.CUIL)) format = "00-00000000-0"; else if (documentType.Equals(DocumentTypeEnum.CUIT)) format = "00-00000000-0"; return format; }
internal static DocumentTypeEnum TransGetType(string DocumentId) { DocumentTypeEnum transType = DocumentTypeEnum.dcTypeNone; string transDoc = DocumentId; if (RTLAPIEngine.SystemSettings.WorkstationInfo.Document.IsInCollection(transDoc)) { var doc = RTLAPIEngine.SystemSettings.WorkstationInfo.Document[transDoc]; transType = doc.TransDocType; } return(transType); }
public static bool IsAssemblyDocument(DocumentTypeEnum activeDocumentType) { if (activeDocumentType == DocumentTypeEnum.kAssemblyDocumentObject) { return(true); } else { return(false); } }
public static DocumentGenerator GetGenerator(DocumentTypeEnum documentType) { switch (documentType) { case DocumentTypeEnum.Invoice: return(new InvoiceGenerator()); //case DocumentTypeEnum.InvoiceCorrection: // return new InvoiceCorrectionGenereator(); default: return(null); } }
public GeneratedDocumentDomain ExportTemplate(int templateVersionId, DocumentTypeEnum outputDocType) { TemplateVersionDomain templateVersionDomain = _templateVersionManipulation.GetByVersionId(templateVersionId); if (templateVersionDomain == null) { throw new NsiArgumentNullException(TemplateManagementMessages.TemplateVersionInvalidId); } string name = _templateManipulation.GetTemplateNameById(templateVersionDomain.TemplateId); GeneratedDocumentDomain generatedDocumentDomain = _documentGenerator.Generate(templateVersionDomain.Content, name, DocumentTypeEnum.Json, outputDocType, templateVersionId); return(generatedDocumentDomain); }
public bool CopyAttachment(DocumentTypeEnum bookmark) { var res = false; switch (bookmark) { case (DocumentTypeEnum.Agreement): { res = CopyAgreement(); } break; case (DocumentTypeEnum.TechSpecs): { res = CopyTechSpecs(); } break; case (DocumentTypeEnum.Qualifications): { res = CopyQualificationsToBuffer(); } break; } return(res); }
public BaseConverter(string fileName, DocumentTypeEnum resultType) { FileName = fileName; string newName; switch (resultType) { case DocumentTypeEnum.Csv: newName = Path.Combine(Path.GetDirectoryName(fileName), Path.GetFileNameWithoutExtension(fileName) + ".csv"); Result = new CsvDocumentType(newName); break; default: //TODO: Test purposes newName = Path.Combine(Path.GetDirectoryName(fileName), Path.GetFileNameWithoutExtension(fileName) + ".csv"); Result = new CsvDocumentType(newName); break; } }
/// <summary> /// Initializes a new instance of the <see cref="Doc" /> class. /// </summary> /// <param name="name">A name for identifying your document. (required).</param> /// <param name="documentType">The type of document being created. (required).</param> /// <param name="documentContent">The HTML data to be transformed into a document. You must supply content using document_content or document_url. (required).</param> /// <param name="documentUrl">The URL to fetch the HTML data to be transformed into a document. You must supply content using document_content or document_url. .</param> /// <param name="test">Enable test mode for this document. Test documents are not charged for but include a watermark. (default to true).</param> /// <param name="pipeline">Specify a specific version of the DocRaptor Pipeline to use.</param> /// <param name="strict">Force strict HTML validation..</param> /// <param name="ignoreResourceErrors">Failed loading of images/javascripts/stylesheets/etc. will not cause the rendering to stop. (default to true).</param> /// <param name="ignoreConsoleMessages">Prevent console.log from stopping document rendering during JavaScript execution. (default to false).</param> /// <param name="tag">A field for storing a small amount of metadata with this document.</param> /// <param name="help">Request support help with this request if it succeeds. (default to false).</param> /// <param name="javascript">Enable DocRaptor JavaScript parsing. PrinceXML JavaScript parsing is also available elsewhere. (default to false).</param> /// <param name="referrer">Set HTTP referrer when generating this document..</param> /// <param name="callbackUrl">A URL that will receive a POST request after successfully completing an asynchronous document. The POST data will include download_url and download_id similar to status API responses. WARNING: this only works on asynchronous documents. .</param> /// <param name="hostedDownloadLimit">The number of times a hosted document can be downloaded. If no limit is specified, the document will be available for an unlimited number of downloads..</param> /// <param name="hostedExpiresAt">The date and time at which a hosted document will be removed and no longer available. Must be a properly formatted ISO 8601 datetime, like 1981-01-23T08:02:30-05:00..</param> /// <param name="princeOptions">princeOptions.</param> public Doc(string name, DocumentTypeEnum documentType, string documentContent, string documentUrl = default(string), bool?test = true, string pipeline = default(string), StrictEnum?strict = default(StrictEnum?), bool?ignoreResourceErrors = true, bool?ignoreConsoleMessages = false, string tag = default(string), bool?help = false, bool?javascript = false, string referrer = default(string), string callbackUrl = default(string), int?hostedDownloadLimit = default(int?), string hostedExpiresAt = default(string), PrinceOptions princeOptions = default(PrinceOptions)) { Name = name ?? throw new ArgumentNullException(nameof(name), "name is a required property for Doc and cannot be null"); DocumentType = documentType; DocumentContent = documentContent ?? throw new ArgumentNullException(nameof(DocumentContent), "documentContent is a required property for Doc and cannot be null"); DocumentUrl = documentUrl; Test = test ?? true; Pipeline = pipeline; Strict = strict; IgnoreResourceErrors = ignoreResourceErrors ?? true; IgnoreConsoleMessages = ignoreConsoleMessages ?? false; Tag = tag; Help = help ?? false; Javascript = javascript ?? false; Referrer = referrer; CallbackUrl = callbackUrl; HostedDownloadLimit = hostedDownloadLimit; HostedExpiresAt = hostedExpiresAt; PrinceOptions = princeOptions; }
public CalibrationsDueViewModel(Document document) { if (document == null) { return; } UserId = document.UserId; Created = document.Created; DocumentId = document.Id; DocumentTypeEnum = DocumentTypeHelper.Parse(document); DocumentType = DocumentTypeEnum.AsDisplayString(); DocumentIcon = DocumentType.Replace(" ", ""); Date = document.InspectionDate.GetValueOrDefault(); Expiration = document.InspectionDate.GetValueOrDefault().AddYears(2); Registration = document.RegistrationNumber; Technician = document.Technician; Customer = document.CustomerContact; DepotName = document.DepotName; var tachographDocument = document as TachographDocument; VehicleManufacturer = tachographDocument != null ? tachographDocument.VehicleMake : string.Empty; }
public List <DocumentRequisite> GetFilesInfo(int fileListId, DocumentTypeEnum documentType) { return(dataManager.GetFiles(fileListId, new List <int> { (int)documentType })); }
public static DocumentType GetDocumentType(DocumentTypeEnum value, SeedsEntities database, MergeOption mergeOption = MergeOption.NoTracking) { return database.DocumentType.Execute(mergeOption).Single(t => t.ID == (short) value); }
public VoucherBuilder WithCreditDocumentType() { this.documentType = DocumentTypeEnum.Cr; return this; }
/// <summary> /// Initializes a new instance of the <see cref="Doc" /> class. /// </summary> /// <param name="name">A name for identifying your document. (required).</param> /// <param name="documentType">The type of document being created. (required).</param> /// <param name="documentContent">The HTML data to be transformed into a document. You must supply content using document_content or document_url. (required).</param> /// <param name="documentUrl">The URL to fetch the HTML data to be transformed into a document. You must supply content using document_content or document_url. .</param> /// <param name="test">Enable test mode for this document. Test documents are not charged for but include a watermark. (default to true).</param> /// <param name="pipeline">Specify a specific verison of the DocRaptor Pipeline to use..</param> /// <param name="strict">Force strict HTML validation..</param> /// <param name="ignoreResourceErrors">Failed loading of images/javascripts/stylesheets/etc. will not cause the rendering to stop. (default to true).</param> /// <param name="ignoreConsoleMessages">Prevent console.log from stopping document rendering during JavaScript execution. (default to false).</param> /// <param name="tag">A field for storing a small amount of metadata with this document..</param> /// <param name="help">Request support help with this request if it succeeds. (default to false).</param> /// <param name="javascript">Enable DocRaptor JavaScript parsing. PrinceXML JavaScript parsing is also available elsewhere. (default to false).</param> /// <param name="referrer">Set HTTP referrer when generating this document..</param> /// <param name="callbackUrl">A URL that will receive a POST request after successfully completing an asynchronous document. The POST data will include download_url and download_id similar to status API responses. WARNING: this only works on asynchronous documents. .</param> /// <param name="hostedDownloadLimit">The number of times a hosted document can be downloaded. If no limit is specified, the document will be available for an unlimited number of downloads..</param> /// <param name="hostedExpiresAt">The date and time at which a hosted document will be removed and no longer available. Must be a properly formatted ISO 8601 datetime, like 1981-01-23T08:02:30-05:00..</param> /// <param name="princeOptions">princeOptions.</param> public Doc(string name = default(string), DocumentTypeEnum documentType = default(DocumentTypeEnum), string documentContent = default(string), string documentUrl = default(string), bool?test = true, string pipeline = default(string), StrictEnum?strict = default(StrictEnum?), bool?ignoreResourceErrors = true, bool?ignoreConsoleMessages = false, string tag = default(string), bool?help = false, bool?javascript = false, string referrer = default(string), string callbackUrl = default(string), int?hostedDownloadLimit = default(int?), string hostedExpiresAt = default(string), PrinceOptions princeOptions = default(PrinceOptions)) { // to ensure "name" is required (not null) if (name == null) { throw new InvalidDataException("name is a required property for Doc and cannot be null"); } else { this.Name = name; } // to ensure "documentType" is required (not null) if (documentType == null) { throw new InvalidDataException("documentType is a required property for Doc and cannot be null"); } else { this.DocumentType = documentType; } // to ensure "documentContent" is required (not null) if (documentContent == null) { throw new InvalidDataException("documentContent is a required property for Doc and cannot be null"); } else { this.DocumentContent = documentContent; } this.DocumentUrl = documentUrl; // use default value if no "test" provided if (test == null) { this.Test = true; } else { this.Test = test; } this.Pipeline = pipeline; this.Strict = strict; // use default value if no "ignoreResourceErrors" provided if (ignoreResourceErrors == null) { this.IgnoreResourceErrors = true; } else { this.IgnoreResourceErrors = ignoreResourceErrors; } // use default value if no "ignoreConsoleMessages" provided if (ignoreConsoleMessages == null) { this.IgnoreConsoleMessages = false; } else { this.IgnoreConsoleMessages = ignoreConsoleMessages; } this.Tag = tag; // use default value if no "help" provided if (help == null) { this.Help = false; } else { this.Help = help; } // use default value if no "javascript" provided if (javascript == null) { this.Javascript = false; } else { this.Javascript = javascript; } this.Referrer = referrer; this.CallbackUrl = callbackUrl; this.HostedDownloadLimit = hostedDownloadLimit; this.HostedExpiresAt = hostedExpiresAt; this.PrinceOptions = princeOptions; }
public BinaryConverter(string fileName, DocumentTypeEnum resultType) : base(fileName, resultType) { }
public VoucherBuilder() { this.documentType = DocumentTypeEnum.Dr; }
private void showError(DocumentTypeEnum type) { throw new ArgumentException(type.ToString() + " Inválido"); }
protected Descriptor( DescriptorType descriptorType, Type type, string header, GetGolumnsDelegate getColumns, CreateEditorDelegate createEditor, DocumentTypeEnum? documentType = null, RefBookTypeEnum? refBookType = null, ReportTypeEnum? reportType = null) { this.descriptorType = descriptorType; this.type = type; this.header = header; this.getColumns = getColumns; this.createEditor = createEditor; if (documentType.HasValue) { this.documentType = documentType.Value; } if (refBookType.HasValue) { this.refBookType = refBookType.Value; } if (reportType.HasValue) { this.reportType = reportType.Value; } }
private string InternalGetTemplateFile(DocumentTypeEnum documentType, SystemOfMeasureEnum systemOfMeasure, DraftingStandardEnum draftingStandard, Object documentSubType) { return ApplicationInstance.GetTemplateFile( documentType, systemOfMeasure, draftingStandard, documentSubType); }
public string GetTemplateFile(DocumentTypeEnum documentType, SystemOfMeasureEnum systemOfMeasure, DraftingStandardEnum draftingStandard, Object documentSubType) { return InternalGetTemplateFile( documentType, systemOfMeasure, draftingStandard, documentSubType); }
private string InternalGetTemplateFile(DocumentTypeEnum documentType, SystemOfMeasureEnum systemOfMeasure, DraftingStandardEnum draftingStandard, Object documentSubType) { return(ApplicationInstance.GetTemplateFile(documentType, systemOfMeasure, draftingStandard, documentSubType)); }
public string GetTemplateFile(DocumentTypeEnum documentType, SystemOfMeasureEnum systemOfMeasure, DraftingStandardEnum draftingStandard, Object documentSubType) { return(InternalGetTemplateFile(documentType, systemOfMeasure, draftingStandard, documentSubType)); }
public CreateDocumentRequestBuilder WithDocumentType(DocumentTypeEnum documentType) { _documentType = documentType; return this; }
public CatalogProfileLink(DocumentTypeEnum type = DocumentTypeEnum.Feed, KindEnum kind = KindEnum.None) { _type = type; _kind = kind; }
private CompleteRiskAssessmentReviewRequest CreateCompleteRiskAssessmentReviewRequest(CompleteReviewViewModel viewModel, RiskAssessmentDto riskAssessment, string newFileName, long documentLibraryId, DocumentTypeEnum documentTypeEnum) { var completeRiskAssessmentReviewRequest = new CompleteRiskAssessmentReviewRequestBuilder() .WithClientId(CurrentUser.CompanyId) .WithUserId(CurrentUser.UserId) .WithCompleteReview_completeReviewViewModel(viewModel); if (documentLibraryId != default(long)) { var requestBuilder = new CreateDocumentRequestBuilder() .WithCompanyId(CurrentUser.CompanyId) .WithDocumentOriginTypeId(DocumentOriginType.TaskCompleted) .WithDocumentType(documentTypeEnum) .WithFilename(newFileName) .WithDocumentLibraryId(documentLibraryId); if (riskAssessment.RiskAssessmentSite != null) requestBuilder.WithSiteId(riskAssessment.RiskAssessmentSite.Id); var createDocumentRequest = requestBuilder.Build(); completeRiskAssessmentReviewRequest.WithCreateDocumentRequest(createDocumentRequest); } return completeRiskAssessmentReviewRequest.Build(); }
public AdminSupportedFile(string fileExtension, bool containsModel, DocumentTypeEnum documentType) { this.FileExtension = fileExtension; this.ContainsModel = containsModel; this.DocumentType = documentType; }
private static void ItemTransactionSaveSaleWithReturnOfReturnable() { string transDoc = "FS"; string transSerial = "1"; double PartyID = 1; var currency = APIEngine.SystemSettings.BaseCurrency; var ItemTransaction = new S50cBL18.BSOItemTransaction(); DocumentTypeEnum DocType = DocumentTypeEnum.dcTypeSale; var NewTransDocNumber = APIEngine.DSOCache.DocumentProvider.GetNewDocNumber(transSerial, transDoc); //------------------------------------------------------------- // *** Header //------------------------------------------------------------- // Motor do documento ItemTransaction.Transaction.TransDocType = DocType; ItemTransaction.Transaction.TransDocNumber = NewTransDocNumber.DocNumber; ItemTransaction.PermissionsType = FrontOfficePermissionEnum.foPermByUser; ItemTransaction.InitNewTransaction(transDoc, transSerial); // Motor dos detalhes (linhas) var bsoItemTransDetail = new S50cBL18.BSOItemTransactionDetail(); bsoItemTransDetail.PermissionsType = FrontOfficePermissionEnum.foPermByUser; bsoItemTransDetail.TransactionType = ItemTransaction.Transaction.TransDocType; bsoItemTransDetail.UserPermissions = APIEngine.SystemSettings.User; ItemTransaction.BSOItemTransactionDetail = bsoItemTransDetail; // ItemTransaction.PartyID = PartyID; ItemTransaction.TransactionTaxIncluded = true; ItemTransaction.createDate = DateTime.Now; ItemTransaction.CreateTime = new DateTime(DateTime.Now.TimeOfDay.Ticks); ItemTransaction.ActualDeliveryDate = DateTime.Now; ItemTransaction.BaseCurrency = currency.CurrencyID; ItemTransaction.BaseCurrencyExchange = currency.BuyExchange; ItemTransaction.Transaction.Comments = "Returnable Packaging"; //------------------------------------------------------------- // *** Header //------------------------------------------------------------- //------------------------------------------------------------- // *** DETAILS //------------------------------------------------------------- if (ItemTransaction.Transaction.Details == null) { ItemTransaction.Transaction.Details = new S50cBO18.ItemTransactionDetailList(); } //Add Line_1: art1 type normal var StockTransactionDetail = AddItemDetail(ItemTransaction, 1, "Bacalhau", 1, 33); ItemTransaction.AddDetail(StockTransactionDetail, true); ////Add Line_2: Enter customer returnables ,Customer input value is negative StockTransactionDetail = AddItemDetail(ItemTransaction, 1, "TARAS", -3, 0.30); ItemTransaction.AddDetail(StockTransactionDetail, true); //------------------------------------------------------------- // *** DETAILS //------------------------------------------------------------- //------------------------------------------------------------- // *** SAVE DOCUMENT //------------------------------------------------------------- //*** SAVE only if document have Lines if (ItemTransaction.Transaction.Details.Count > 0) { try { //Ensure Till is open ItemTransaction.EnsureOpenTill(ItemTransaction.Transaction.Till.TillID); //Calculate ItemTransaction.Calculate(true, true); //Save Document ItemTransaction.SaveDocument(false, false); //Console.Error.Write(ItemTransaction.Transaction.TransactionID.ToString()); } catch (Exception ex) { Console.Error.Write(ex.Message); } } //------------------------------------------------------------- // *** SAVE DOCUMENT //------------------------------------------------------------- }
public DocumentModel(DocumentTypeEnum docType, int id) { this.ConsolidatedActIds = new List <int>(); this.DocType = docType; this.DocId = id; }
public IExistingDocumentsViewModelFactory WithDefaultDocumentType(DocumentTypeEnum defaultDocumentType) { _defaultDocumentType = defaultDocumentType; return this; }
public Document(string fileName, DocumentTypeEnum documentType) { FileName = fileName; DocType = documentType; isDeleted = false; }
public Process(string inputPath, DocumentTypeEnum baseType, DocumentTypeEnum resultType) { InputDirectory = inputPath; ResultType = resultType; BaseType = baseType; }
public CatalogProfileLink(DocumentTypeEnum type = DocumentTypeEnum.Feed, KindEnum kind = KindEnum.None) { _type = type; _kind = kind; }
public async Task <string> GetDocumentNumber(DocumentTypeEnum documentType, int customerDivisionId) { var query = _customerDivisionDocumentSettingRepo.FindByCondition(ds => ds.DivisionId == customerDivisionId) .Include(dt => dt.DocumentType) .Include(ns => ns.DocumentNumberSequence) .Include(d => d.Division).ThenInclude(c => c.Customer); var divisionDocumentSetting = query.FirstOrDefault(t => t.DocumentType.Type == documentType); // DivisionDocumentSetting muss immer gesetzt werden. Am Anfang mit Defaultwerte. var documentNumberSequence = divisionDocumentSetting?.DocumentNumberSequence; var documentNumber = string.Empty; documentNumber += $"{documentNumberSequence.Prefix}{documentNumberSequence.SeparatorAfterPrefix}"; if (documentNumberSequence.CanAddDocumentTypeShortName) { documentNumber += divisionDocumentSetting.DocumentType.ShortName; } var paddingCustomerNumber = string.Empty; if (documentNumberSequence.CanAddPaddingForCustomerNumber) { for (int i = 0; i < documentNumberSequence.PaddingLengthForCustomerNumber - 5; i++) { paddingCustomerNumber += '0'; } } documentNumber += $"{paddingCustomerNumber}{divisionDocumentSetting.Division.Customer.RefErpCustomerNumber}{documentNumberSequence.PostfixForCustomerNumber}{documentNumberSequence.Separator}"; if (documentNumberSequence.CanAddDivisionShortName) { documentNumber += divisionDocumentSetting.Division.ShortName; } documentNumber += documentNumberSequence.Separator; bool retrySave; do { var paddingCounter = string.Empty; var nextCounter = documentNumberSequence.Counter + 1; var counterLength = nextCounter.ToString().Length; if (documentNumberSequence.CanAddPaddingForCounter && counterLength < documentNumberSequence.PaddingLengthForCounter) { for (int i = 0; i < documentNumberSequence.PaddingLengthForCounter - counterLength; i++) { paddingCounter += '0'; } } ++documentNumberSequence.Counter; retrySave = false; try { _documentNumberSequenceRepo.Save(); documentNumber += $"{paddingCounter}{documentNumberSequence.Counter}"; } catch (DbUpdateConcurrencyException e) { retrySave = true; await e.Entries.Single().ReloadAsync(); } } while (retrySave); return(documentNumber); }
public IDocumentsViewModelFactory WithDocumentDefaultType(DocumentTypeEnum documentType) { _documentType = documentType; return this; }