This commit is contained in:
2020-12-16 20:11:41 +00:00
parent 695192c056
commit 0a2ae1f992
2 changed files with 24 additions and 16 deletions

View File

@@ -1002,7 +1002,7 @@ namespace AyaNova.PlugIn.V8
d = new JObject(); d = new JObject();
d.customerId = RavenId; d.customerId = RavenId;
d.userId = SafeGetUserMap(cn.Creator); d.userId = SafeGetUserMap(cn.Creator);
d.noteDate = util.StringDateToV8(cn.Created, true); d.noteDate = util.DateToV8(cn.Created, true);
d.notes = cn.Notes; d.notes = cn.Notes;
Tagit(cn.ClientNoteTypeID, tags); Tagit(cn.ClientNoteTypeID, tags);
SetTags(d, tags); SetTags(d, tags);
@@ -1454,6 +1454,11 @@ namespace AyaNova.PlugIn.V8
progress.Op(ObjectTypeName + " " + d.name); progress.Op(ObjectTypeName + " " + d.name);
d.active = c.Active; d.active = c.Active;
d.notes = c.Notes; d.notes = c.Notes;
d.dateStarted = util.DateToV8(c.DateStarted,true);
d.dateCompleted = util.DateToV8(c.DateCompleted, false);
d.accountNumber = c.AccountNumber;
d.projectOverseerId = SafeGetUserMap(c.ProjectOverseerID);
Tagit(c.RegionID, tags); Tagit(c.RegionID, tags);
SetTags(d, tags); SetTags(d, tags);
@@ -1882,7 +1887,7 @@ namespace AyaNova.PlugIn.V8
dmemo.replied = mem.Replied; dmemo.replied = mem.Replied;
var RavenFromId=SafeGetUserMap(mem.FromID); var RavenFromId=SafeGetUserMap(mem.FromID);
dmemo.fromId = RavenFromId; dmemo.fromId = RavenFromId;
dmemo.sent = util.StringDateToV8(mem.Created, true); dmemo.sent = util.DateToV8(mem.Created, true);
dmemo.toId=SafeGetUserMap(mem.ToID); dmemo.toId=SafeGetUserMap(mem.ToID);
SetTags(dmemo, tags); SetTags(dmemo, tags);
duserid.Add(-7);//special code to server to treat as an import single duserid.Add(-7);//special code to server to treat as an import single

View File

@@ -114,7 +114,8 @@ namespace AyaNova.PlugIn.V8
//Must be *the* SuperUser to continue: //Must be *the* SuperUser to continue:
a = await GetAsync("user/amsu"); a = await GetAsync("user/amsu");
var IsSuperUser = a.ObjectResponse["data"].Value<bool>(); var IsSuperUser = a.ObjectResponse["data"].Value<bool>();
if (!IsSuperUser) { if (!IsSuperUser)
{
JWT = string.Empty; JWT = string.Empty;
return false; return false;
} }
@@ -343,7 +344,8 @@ namespace AyaNova.PlugIn.V8
// v7 to v8 Date conversion // v7 to v8 Date conversion
// //
// //
public static string StringDateToV8(string s, bool neverEmpty=false) public static string DateToV8(object o, bool neverEmpty = false) { return DateToV8(o.ToString(), neverEmpty); }
public static string DateToV8(string s, bool neverEmpty = false)
{ {
if (string.IsNullOrWhiteSpace(s)) if (string.IsNullOrWhiteSpace(s))
{ {
@@ -351,7 +353,8 @@ namespace AyaNova.PlugIn.V8
{ {
return DateTime.UtcNow.ToString("o"); return DateTime.UtcNow.ToString("o");
} }
else { else
{
return string.Empty; return string.Empty;
} }
} }