This commit is contained in:
@@ -771,6 +771,44 @@ namespace AyaNova.PlugIn.V8
|
||||
await util.PutAsync("user-option/" + RavenContactId.ToString(), d.ToString());
|
||||
|
||||
|
||||
//###########
|
||||
//CUSTOMER NOTES
|
||||
//
|
||||
//
|
||||
/* CLIENT NOTE
|
||||
V8
|
||||
### ROUTE [Route("api/v{version:apiVersion}/customer-note")]
|
||||
### v8 format
|
||||
{
|
||||
"Id": 2,
|
||||
"Concurrency": 90604,
|
||||
"CustomerId": 100,
|
||||
"UserId": 1,
|
||||
"NoteDate": "2020-11-24T17:54:05.68",
|
||||
"Notes": "The quick brown fox jumped over the six lazy dogs.\nPack my box with five dozen liquor jugs.\nThe quick brown fox jumped over the six lazy dogs.\nPack my box with five dozen liquor jugs.\nThe quick brown fox jumped over the six lazy dogs.\nPack my box with five dozen liquor jugs.\nThe getDate() method returns the current day of the month (1-31).\n\nThe getMonth() method returns the month of the specified date. One point to note about the getMonth() method is that it returns 0-indexed values (0-11) where 0 is for January and 11 for December. Hence the addition of 1 to normalize the month's value.\nDate now\n\nnow() is a static method of the Date object. It returns the value in milliseconds that represents the time elapsed since the Epoch. You can pass in the milliseconds returned from the now() method into the Date constructor to instantiate a new Date object:\neot",
|
||||
"Tags": [
|
||||
"gold",
|
||||
"known-user",
|
||||
"olive",
|
||||
"test-role-user"
|
||||
]
|
||||
}
|
||||
*/
|
||||
ClientNotes cnl = ClientNotes.GetItems(c.ID);
|
||||
foreach (ClientNote cn in cnl)
|
||||
{
|
||||
tags.Clear();
|
||||
d = new JObject();
|
||||
d.customerId = RavenId;
|
||||
d.userId = SafeGetUserMap(cn.Creator);
|
||||
d.noteDate = util.StringDateToV8(cn.Created, true);
|
||||
d.notes = cn.Notes;
|
||||
Tagit(cn.ClientNoteTypeID, tags);
|
||||
SetTags(d, tags);
|
||||
await util.PostAsync("customer-note", d.ToString());
|
||||
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------
|
||||
|
||||
@@ -779,26 +817,8 @@ namespace AyaNova.PlugIn.V8
|
||||
|
||||
}
|
||||
}
|
||||
todo customer note:
|
||||
/* CLIENT NOTE
|
||||
V8
|
||||
### ROUTE [Route("api/v{version:apiVersion}/customer-note")]
|
||||
### v8 format
|
||||
{
|
||||
"Id": 2,
|
||||
"Concurrency": 90604,
|
||||
"CustomerId": 100,
|
||||
"UserId": 1,
|
||||
"NoteDate": "2020-11-24T17:54:05.68",
|
||||
"Notes": "The quick brown fox jumped over the six lazy dogs.\nPack my box with five dozen liquor jugs.\nThe quick brown fox jumped over the six lazy dogs.\nPack my box with five dozen liquor jugs.\nThe quick brown fox jumped over the six lazy dogs.\nPack my box with five dozen liquor jugs.\nThe getDate() method returns the current day of the month (1-31).\n\nThe getMonth() method returns the month of the specified date. One point to note about the getMonth() method is that it returns 0-indexed values (0-11) where 0 is for January and 11 for December. Hence the addition of 1 to normalize the month's value.\nDate now\n\nnow() is a static method of the Date object. It returns the value in milliseconds that represents the time elapsed since the Epoch. You can pass in the milliseconds returned from the now() method into the Date constructor to instantiate a new Date object:\neot",
|
||||
"Tags": [
|
||||
"gold",
|
||||
"known-user",
|
||||
"olive",
|
||||
"test-role-user"
|
||||
]
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
#endregion Clients
|
||||
|
||||
#region Headoffices
|
||||
|
||||
@@ -325,6 +325,38 @@ namespace AyaNova.PlugIn.V8
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
///////////////////////////////
|
||||
// v7 to v8 Date conversion
|
||||
//
|
||||
//
|
||||
public static string StringDateToV8(string s, bool neverEmpty=false)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(s))
|
||||
{
|
||||
if (neverEmpty)
|
||||
{
|
||||
return DateTime.UtcNow.ToString("o");
|
||||
}
|
||||
else {
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
DateTime result=new DateTime();
|
||||
if (DateTime.TryParse(s, out result))
|
||||
return result.ToUniversalTime().ToString("o");
|
||||
|
||||
//couldn't be parsed
|
||||
if(neverEmpty)
|
||||
return DateTime.UtcNow.ToString("o");
|
||||
return string.Empty;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public enum AyaUiFieldDataType : int
|
||||
{
|
||||
NoType = 0,
|
||||
|
||||
Reference in New Issue
Block a user