-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.0.46.0 - New Feature: Date Functions
- Loading branch information
Demian Adolfo Raschkovan
committed
Nov 25, 2017
1 parent
d38b32a
commit 29c22a9
Showing
24 changed files
with
145 additions
and
11 deletions.
There are no files selected for viewing
Binary file not shown.
105 changes: 105 additions & 0 deletions
105
msdyncrmWorkflowTools/msdyncrmWorkflowTools/Class/DateFunctions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
using Microsoft.Crm.Sdk.Messages; | ||
using Microsoft.Xrm.Sdk; | ||
using Microsoft.Xrm.Sdk.Query; | ||
using Microsoft.Xrm.Sdk.Workflow; | ||
using System; | ||
using System.Activities; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Text.RegularExpressions; | ||
using System.Threading.Tasks; | ||
|
||
namespace msdyncrmWorkflowTools | ||
{ | ||
public class DateFunctions : CodeActivity | ||
{ | ||
#region "Parameter Definition" | ||
[RequiredArgument] | ||
[Input("Date 1")] | ||
public InArgument<DateTime> Date1 { get; set; } | ||
|
||
[Input("Date 2")] | ||
public InArgument<DateTime> Date2 { get; set; } | ||
|
||
|
||
[Output("Total Days")] | ||
public OutArgument<double> TotalDays { get; set; } | ||
|
||
[Output("Total Hours")] | ||
public OutArgument<double> TotalHours { get; set; } | ||
|
||
[Output("Total Milliseconds")] | ||
public OutArgument<double> TotalMilliseconds { get; set; } | ||
|
||
[Output("Total Minutes")] | ||
public OutArgument<double> TotalMinutes { get; set; } | ||
|
||
[Output("Total Seconds")] | ||
public OutArgument<double> TotalSeconds { get; set; } | ||
|
||
[Output("Day Of Week")] | ||
public OutArgument<int> DayOfWeek { get; set; } | ||
[Output("Day Of Year")] | ||
public OutArgument<int> DayOfYear { get; set; } | ||
[Output("Day")] | ||
public OutArgument<int> Day { get; set; } | ||
[Output("Month")] | ||
public OutArgument<int> Month { get; set; } | ||
[Output("Year")] | ||
public OutArgument<int> Year { get; set; } | ||
[Output("Week Of Year")] | ||
public OutArgument<int> WeekOfYear { get; set; } | ||
|
||
#endregion | ||
|
||
protected override void Execute(CodeActivityContext executionContext) | ||
{ | ||
|
||
#region "Load CRM Service from context" | ||
|
||
Common objCommon = new Common(executionContext); | ||
objCommon.tracingService.Trace("Load CRM Service from context --- OK"); | ||
#endregion | ||
|
||
#region "Read Parameters" | ||
DateTime date1 = this.Date1.Get(executionContext); | ||
DateTime date2 = this.Date2.Get(executionContext); | ||
|
||
#endregion | ||
|
||
|
||
|
||
msdyncrmWorkflowTools_Class commonClass = new msdyncrmWorkflowTools_Class(objCommon.service, objCommon.tracingService); | ||
TimeSpan difference = new TimeSpan(); | ||
int DayOfWeek = 0; | ||
int DayOfYear = 0; | ||
int Day = 0; | ||
int Month = 0; | ||
int Year = 0; | ||
int WeekOfYear = 0; | ||
commonClass.DateFunctions(date1, date2, ref difference, | ||
ref DayOfWeek, ref DayOfYear, ref Day, ref Month, ref Year, ref WeekOfYear); | ||
|
||
|
||
this.TotalDays.Set(executionContext, difference.TotalDays); | ||
this.TotalHours.Set(executionContext, difference.TotalHours); | ||
this.TotalMilliseconds.Set(executionContext, difference.TotalMilliseconds); | ||
this.TotalMinutes.Set(executionContext, difference.TotalMinutes); | ||
this.TotalSeconds.Set(executionContext, difference.TotalSeconds); | ||
|
||
|
||
this.DayOfWeek.Set(executionContext, DayOfWeek); | ||
this.DayOfYear.Set(executionContext, DayOfYear); | ||
this.Day.Set(executionContext, Day); | ||
this.Month.Set(executionContext, Month); | ||
this.Year.Set(executionContext, Year); | ||
this.WeekOfYear.Set(executionContext, WeekOfYear); | ||
|
||
|
||
|
||
} | ||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+4 KB
(100%)
msdyncrmWorkflowTools/msdyncrmWorkflowTools/bin/Debug/msdyncrmWorkflowTools.dll
Binary file not shown.
Binary file modified
BIN
+10 KB
(100%)
msdyncrmWorkflowTools/msdyncrmWorkflowTools/bin/Debug/msdyncrmWorkflowTools.pdb
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...owTools/msdyncrmWorkflowTools/obj/Debug/msdyncrmWorkflowTools.csproj.FileListAbsolute.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
C:\Users\DemianRaschkovan\Source\Repos\Dynamics-365-Workflow-Tools\msdyncrmWorkflowTools\msdyncrmWorkflowTools\obj\Debug\msdyncrmWorkflowTools.csprojResolveAssemblyReference.cache | ||
C:\Users\DemianRaschkovan\Source\Repos\Dynamics-365-Workflow-Tools\msdyncrmWorkflowTools\msdyncrmWorkflowTools\obj\Debug\msdyncrmWorkflowTools.dll | ||
C:\Users\DemianRaschkovan\Source\Repos\Dynamics-365-Workflow-Tools\msdyncrmWorkflowTools\msdyncrmWorkflowTools\obj\Debug\msdyncrmWorkflowTools.pdb | ||
C:\Users\DemianRaschkovan\Source\Repos\Dynamics-365-Workflow-Tools\msdyncrmWorkflowTools\msdyncrmWorkflowTools\obj\Debug\msdyncrmWorkflowTools.csproj.CoreCompileInputs.cache |
Binary file modified
BIN
+3.5 KB
(100%)
msdyncrmWorkflowTools/msdyncrmWorkflowTools/obj/Debug/msdyncrmWorkflowTools.dll
Binary file not shown.
Binary file modified
BIN
+8 KB
(100%)
msdyncrmWorkflowTools/msdyncrmWorkflowTools/obj/Debug/msdyncrmWorkflowTools.pdb
Binary file not shown.
Binary file modified
BIN
+512 Bytes
(100%)
msdyncrmWorkflowTools/msdyncrmWorkflowTools_Class/bin/Debug/msdyncrmWorkflowTools_Class.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
msdyncrmWorkflowTools/msdyncrmWorkflowTools_Class/bin/Debug/msdyncrmWorkflowTools_Class.pdb
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+512 Bytes
(100%)
msdyncrmWorkflowTools/msdyncrmWorkflowTools_Class/obj/Debug/msdyncrmWorkflowTools_Class.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
msdyncrmWorkflowTools/msdyncrmWorkflowTools_Class/obj/Debug/msdyncrmWorkflowTools_Class.pdb
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+512 Bytes
(100%)
...WorkflowTools/msdyncrmWorkflowTools_ConsoleTest/bin/Debug/msdyncrmWorkflowTools_Class.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...WorkflowTools/msdyncrmWorkflowTools_ConsoleTest/bin/Debug/msdyncrmWorkflowTools_Class.pdb
Binary file not shown.
Binary file modified
BIN
-512 Bytes
(93%)
...owTools/msdyncrmWorkflowTools_ConsoleTest/bin/Debug/msdyncrmWorkflowTools_ConsoleTest.exe
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...owTools/msdyncrmWorkflowTools_ConsoleTest/bin/Debug/msdyncrmWorkflowTools_ConsoleTest.pdb
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+10 Bytes
(100%)
...soleTest/obj/Debug/msdyncrmWorkflowTools_ConsoleTest.csprojResolveAssemblyReference.cache
Binary file not shown.
Binary file modified
BIN
-512 Bytes
(93%)
...owTools/msdyncrmWorkflowTools_ConsoleTest/obj/Debug/msdyncrmWorkflowTools_ConsoleTest.exe
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...owTools/msdyncrmWorkflowTools_ConsoleTest/obj/Debug/msdyncrmWorkflowTools_ConsoleTest.pdb
Binary file not shown.