Skip to content

Commit

Permalink
Changed: latest text parser.
Browse files Browse the repository at this point in the history
  • Loading branch information
yagasoft committed Dec 11, 2023
1 parent 395c17c commit 95680b6
Show file tree
Hide file tree
Showing 6 changed files with 2,170 additions and 3,097 deletions.
12 changes: 6 additions & 6 deletions Yagasoft.AutoNumbering.Plugins/BLL/AutoNumberingEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using Yagasoft.AutoNumbering.Plugins.Helpers;
using Yagasoft.Libraries.Common;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Client;
using Yagasoft.AutoNumbering.Plugins.Helpers;
using Yagasoft.Libraries.Common;

#endregion

namespace Yagasoft.AutoNumbering.Plugins.BLL
{
/// <summary>
/// Author: Ahmed Elsawalhy<br />
/// Version: 2.1.1
/// Version: 2.1.2
/// </summary>
[Log]
internal class AutoNumberingEngine
Expand All @@ -37,7 +37,7 @@ internal class Result
private readonly IEnumerable<string> inputParams;

private int padding;

private readonly Guid orgId;
private readonly bool isUpdate;
private AutoNumbering updatedAutoNumbering;
Expand Down Expand Up @@ -370,7 +370,7 @@ internal string ParseParamVariables(int paramIndex)

private string ParseAttributeVariables(string rawString)
{
return CrmParser.Parse(rawString, image, service, this, orgId, typeof(Constructs));
return CrmParser.Interpreter.Parse(rawString, [typeof(Constructs)]).Evaluate(service, image, this);
}

private string ParseDateVariables(string rawString)
Expand All @@ -385,7 +385,7 @@ private string ParseDateVariables(string rawString)
}
var rawVariable = match.Groups[1].Value;
rawVariable = CrmParser.Parse(rawVariable, image, service, this, orgId, typeof(Constructs));
rawVariable = CrmParser.Interpreter.Parse(rawVariable, [typeof(Constructs)]).Evaluate(service, image, this);
var date = DateTime.UtcNow.ConvertToCrmUserTimeZone(service, autoNumberConfig.Owner.Id);
return string.Format("{0:" + rawVariable + "}", date);
Expand Down
Loading

0 comments on commit 95680b6

Please sign in to comment.