Skip to content

Commit 95680b6

Browse files
committed
Changed: latest text parser.
1 parent 395c17c commit 95680b6

File tree

6 files changed

+2170
-3097
lines changed

6 files changed

+2170
-3097
lines changed

Yagasoft.AutoNumbering.Plugins/BLL/AutoNumberingEngine.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
using System.Collections.Generic;
55
using System.Linq;
66
using System.Text.RegularExpressions;
7-
using Yagasoft.AutoNumbering.Plugins.Helpers;
8-
using Yagasoft.Libraries.Common;
97
using Microsoft.Xrm.Sdk;
108
using Microsoft.Xrm.Sdk.Client;
9+
using Yagasoft.AutoNumbering.Plugins.Helpers;
10+
using Yagasoft.Libraries.Common;
1111

1212
#endregion
1313

1414
namespace Yagasoft.AutoNumbering.Plugins.BLL
1515
{
1616
/// <summary>
1717
/// Author: Ahmed Elsawalhy<br />
18-
/// Version: 2.1.1
18+
/// Version: 2.1.2
1919
/// </summary>
2020
[Log]
2121
internal class AutoNumberingEngine
@@ -37,7 +37,7 @@ internal class Result
3737
private readonly IEnumerable<string> inputParams;
3838

3939
private int padding;
40-
40+
4141
private readonly Guid orgId;
4242
private readonly bool isUpdate;
4343
private AutoNumbering updatedAutoNumbering;
@@ -370,7 +370,7 @@ internal string ParseParamVariables(int paramIndex)
370370

371371
private string ParseAttributeVariables(string rawString)
372372
{
373-
return CrmParser.Parse(rawString, image, service, this, orgId, typeof(Constructs));
373+
return CrmParser.Interpreter.Parse(rawString, [typeof(Constructs)]).Evaluate(service, image, this);
374374
}
375375

376376
private string ParseDateVariables(string rawString)
@@ -385,7 +385,7 @@ private string ParseDateVariables(string rawString)
385385
}
386386

387387
var rawVariable = match.Groups[1].Value;
388-
rawVariable = CrmParser.Parse(rawVariable, image, service, this, orgId, typeof(Constructs));
388+
rawVariable = CrmParser.Interpreter.Parse(rawVariable, [typeof(Constructs)]).Evaluate(service, image, this);
389389

390390
var date = DateTime.UtcNow.ConvertToCrmUserTimeZone(service, autoNumberConfig.Owner.Id);
391391
return string.Format("{0:" + rawVariable + "}", date);

0 commit comments

Comments
 (0)