This commit is contained in:
@@ -3717,7 +3717,34 @@ namespace AyaNova.PlugIn.V8
|
|||||||
d.copyWiki = false;
|
d.copyWiki = false;
|
||||||
d.copyAttachments = false;
|
d.copyAttachments = false;
|
||||||
d.stopGeneratingDate = util.DateToV8(c.WorkorderPreventiveMaintenance.StopGeneratingDate);
|
d.stopGeneratingDate = util.DateToV8(c.WorkorderPreventiveMaintenance.StopGeneratingDate);
|
||||||
|
//quickly and inelegantly brute force this bitch
|
||||||
|
switch (c.WorkorderPreventiveMaintenance.DayOfTheWeek)
|
||||||
|
{
|
||||||
|
case AyaDayOfWeek.Monday:
|
||||||
|
d.excludeDaysOfWeek = util.AyaDaysOfWeek.Tuesday | util.AyaDaysOfWeek.Wednesday | util.AyaDaysOfWeek.Thursday | util.AyaDaysOfWeek.Friday | util.AyaDaysOfWeek.Saturday | util.AyaDaysOfWeek.Sunday;
|
||||||
|
break;
|
||||||
|
case AyaDayOfWeek.Tuesday:
|
||||||
|
d.excludeDaysOfWeek = util.AyaDaysOfWeek.Monday | util.AyaDaysOfWeek.Wednesday | util.AyaDaysOfWeek.Thursday | util.AyaDaysOfWeek.Friday | util.AyaDaysOfWeek.Saturday | util.AyaDaysOfWeek.Sunday;
|
||||||
|
break;
|
||||||
|
case AyaDayOfWeek.Wednesday:
|
||||||
|
d.excludeDaysOfWeek = util.AyaDaysOfWeek.Monday | util.AyaDaysOfWeek.Tuesday | util.AyaDaysOfWeek.Thursday | util.AyaDaysOfWeek.Friday | util.AyaDaysOfWeek.Saturday | util.AyaDaysOfWeek.Sunday;
|
||||||
|
break;
|
||||||
|
case AyaDayOfWeek.Thursday:
|
||||||
|
d.excludeDaysOfWeek = util.AyaDaysOfWeek.Monday | util.AyaDaysOfWeek.Tuesday | util.AyaDaysOfWeek.Wednesday | util.AyaDaysOfWeek.Friday | util.AyaDaysOfWeek.Saturday | util.AyaDaysOfWeek.Sunday;
|
||||||
|
break;
|
||||||
|
case AyaDayOfWeek.Friday:
|
||||||
|
d.excludeDaysOfWeek = util.AyaDaysOfWeek.Monday | util.AyaDaysOfWeek.Tuesday | util.AyaDaysOfWeek.Wednesday | util.AyaDaysOfWeek.Thursday | util.AyaDaysOfWeek.Saturday | util.AyaDaysOfWeek.Sunday;
|
||||||
|
break;
|
||||||
|
case AyaDayOfWeek.Saturday:
|
||||||
|
d.excludeDaysOfWeek = util.AyaDaysOfWeek.Monday | util.AyaDaysOfWeek.Tuesday | util.AyaDaysOfWeek.Wednesday | util.AyaDaysOfWeek.Thursday | util.AyaDaysOfWeek.Friday | util.AyaDaysOfWeek.Sunday;
|
||||||
|
break;
|
||||||
|
case AyaDayOfWeek.Sunday:
|
||||||
|
d.excludeDaysOfWeek = util.AyaDaysOfWeek.Monday | util.AyaDaysOfWeek.Tuesday | util.AyaDaysOfWeek.Wednesday | util.AyaDaysOfWeek.Thursday | util.AyaDaysOfWeek.Friday | util.AyaDaysOfWeek.Saturday ;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
d.active = c.WorkorderPreventiveMaintenance.Active;
|
||||||
|
d.nextServiceDate = util.DateToV8(c.WorkorderPreventiveMaintenance.NextServiceDate, true);
|
||||||
|
|
||||||
|
|
||||||
var client = c.uiClient;
|
var client = c.uiClient;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
internal static string ApiBaseUrl { get; set; }
|
internal static string ApiBaseUrl { get; set; }
|
||||||
internal static string JWT { get; set; }
|
internal static string JWT { get; set; }
|
||||||
// public static bool Initialized { get; set; }
|
// public static bool Initialized { get; set; }
|
||||||
// internal static string ServerState { get; set; }
|
// internal static string ServerState { get; set; }
|
||||||
|
|
||||||
|
|
||||||
//public util()
|
//public util()
|
||||||
@@ -470,26 +470,26 @@ namespace AyaNova.PlugIn.V8
|
|||||||
throw new NotImplementedException("V8:util:RootObjectToAyaType -> type " + rot.ToString() + " is not coded yet");
|
throw new NotImplementedException("V8:util:RootObjectToAyaType -> type " + rot.ToString() + " is not coded yet");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Days of week
|
/// Days of week
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Flags]
|
[Flags]
|
||||||
public enum AyaDaysOfWeek : int
|
public enum AyaDaysOfWeek : int
|
||||||
{
|
{
|
||||||
//https://stackoverflow.com/questions/8447/what-does-the-flags-enum-attribute-mean-in-c
|
//https://stackoverflow.com/questions/8447/what-does-the-flags-enum-attribute-mean-in-c
|
||||||
//MAX 31 (2147483647)!!! or will overflow int and needs to be turned into a long
|
//MAX 31 (2147483647)!!! or will overflow int and needs to be turned into a long
|
||||||
//Must be a power of two: https://en.wikipedia.org/wiki/Power_of_two
|
//Must be a power of two: https://en.wikipedia.org/wiki/Power_of_two
|
||||||
//bitwise selection of days of week
|
//bitwise selection of days of week
|
||||||
//https://stackoverflow.com/a/24174625/8939
|
//https://stackoverflow.com/a/24174625/8939
|
||||||
|
|
||||||
Monday = 1,
|
Monday = 1,
|
||||||
Tuesday = 2,
|
Tuesday = 2,
|
||||||
Wednesday = 4,
|
Wednesday = 4,
|
||||||
Thursday = 8,
|
Thursday = 8,
|
||||||
Friday = 16,
|
Friday = 16,
|
||||||
Saturday = 32,
|
Saturday = 32,
|
||||||
Sunday = 64
|
Sunday = 64
|
||||||
}
|
}
|
||||||
public enum AyaType : int
|
public enum AyaType : int
|
||||||
{
|
{
|
||||||
//COREBIZOBJECT attribute must be set on objects that are:
|
//COREBIZOBJECT attribute must be set on objects that are:
|
||||||
|
|||||||
Reference in New Issue
Block a user