Skip to content

Commit

Permalink
Project updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bzashev committed Feb 22, 2019
1 parent c2d2fa7 commit eab4d0d
Show file tree
Hide file tree
Showing 4 changed files with 1,561 additions and 0 deletions.
159 changes: 159 additions & 0 deletions WebVella.Erp.Plugins.Next/NextPlugin.20190222.cs
@@ -0,0 +1,159 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using WebVella.Erp.Api;
using WebVella.Erp.Api.Models;
using WebVella.Erp.Eql;

namespace WebVella.Erp.Plugins.Next
{
public partial class NextPlugin : ErpPlugin
{
private static void Patch20190222(EntityManager entMan, EntityRelationManager relMan, RecordManager recMan)
{
#region << ***Update record*** Id: a0465e9f-5d5f-433d-acf1-1da0eaec78b4 (task_type) >>
{
var json = @"{
""$type"": ""WebVella.Erp.Api.Models.EntityRecord, WebVella.Erp"",
""id"": ""a0465e9f-5d5f-433d-acf1-1da0eaec78b4"",
""is_default"": true,
""label"": ""New Feature"",
""sort_index"": 6.0,
""is_system"": true,
""is_enabled"": true,
""icon_class"": ""fas fa-fw fa-plus-square"",
""color"": ""#4CAF50"",
""l_scope"": ""[\""projects\""]""
}";
EntityRecord rec = JsonConvert.DeserializeObject<EntityRecord>(json);
var result = recMan.UpdateRecord("task_type", rec);
if (!result.Success) throw new Exception(result.Message);
}
#endregion

#region << ***Update record*** Id: 6105dcf4-4115-435f-94bb-0190d45d1b87 (task_type) >>
{
var json = @"{
""$type"": ""WebVella.Erp.Api.Models.EntityRecord, WebVella.Erp"",
""id"": ""6105dcf4-4115-435f-94bb-0190d45d1b87"",
""is_default"": false,
""label"": ""Improvement"",
""sort_index"": 7.0,
""is_system"": true,
""is_enabled"": true,
""icon_class"": ""far fa-fw fa-caret-square-up"",
""color"": ""#9C27B0"",
""l_scope"": ""[\""projects\""]""
}";
EntityRecord rec = JsonConvert.DeserializeObject<EntityRecord>(json);
var result = recMan.UpdateRecord("task_type", rec);
if (!result.Success) throw new Exception(result.Message);
}
#endregion

#region << ***Update record*** Id: c0a2554c-f59a-434e-be00-217a416f8efd (task_type) >>
{
var json = @"{
""$type"": ""WebVella.Erp.Api.Models.EntityRecord, WebVella.Erp"",
""id"": ""c0a2554c-f59a-434e-be00-217a416f8efd"",
""is_default"": false,
""label"": ""Bug"",
""sort_index"": 8.0,
""is_system"": true,
""is_enabled"": true,
""icon_class"": ""fas fa-fw fa-bug"",
""color"": ""#F44336"",
""l_scope"": ""[\""projects\""]""
}";
EntityRecord rec = JsonConvert.DeserializeObject<EntityRecord>(json);
var result = recMan.UpdateRecord("task_type", rec);
if (!result.Success) throw new Exception(result.Message);
}
#endregion

#region << ***Update record*** Id: da9bf72d-3655-4c51-9f99-047ef9297bf2 (task_type) >>
{
var json = @"{
""$type"": ""WebVella.Erp.Api.Models.EntityRecord, WebVella.Erp"",
""id"": ""da9bf72d-3655-4c51-9f99-047ef9297bf2"",
""is_default"": true,
""label"": ""General"",
""sort_index"": 1.0,
""is_system"": true,
""is_enabled"": true,
""icon_class"": ""fa fa-cog"",
""color"": ""#2196F3"",
""l_scope"": ""[\""projects\""]""
}";
EntityRecord rec = JsonConvert.DeserializeObject<EntityRecord>(json);
var result = recMan.UpdateRecord("task_type", rec);
if (!result.Success) throw new Exception(result.Message);
}
#endregion

#region << ***Update record*** Id: 7b191135-5fbb-4db9-bf24-1a5fc72d8cd5 (task_type) >>
{
var json = @"{
""$type"": ""WebVella.Erp.Api.Models.EntityRecord, WebVella.Erp"",
""id"": ""7b191135-5fbb-4db9-bf24-1a5fc72d8cd5"",
""is_default"": false,
""label"": ""Call"",
""sort_index"": 2.0,
""is_system"": true,
""is_enabled"": true,
""icon_class"": ""fas fa-phone"",
""color"": ""#2196F3"",
""l_scope"": ""[\""projects\""]""
}";
EntityRecord rec = JsonConvert.DeserializeObject<EntityRecord>(json);
var result = recMan.UpdateRecord("task_type", rec);
if (!result.Success) throw new Exception(result.Message);
}
#endregion

#region << ***Update record*** Id: 894ba1ef-1b31-440c-9b33-f301d047d8fb (task_type) >>
{
var json = @"{
""$type"": ""WebVella.Erp.Api.Models.EntityRecord, WebVella.Erp"",
""id"": ""894ba1ef-1b31-440c-9b33-f301d047d8fb"",
""is_default"": false,
""label"": ""Meeting"",
""sort_index"": 4.0,
""is_system"": true,
""is_enabled"": true,
""icon_class"": ""fas fa-users"",
""color"": ""#2196F3"",
""l_scope"": ""[\""projects\""]""
}";
EntityRecord rec = JsonConvert.DeserializeObject<EntityRecord>(json);
var result = recMan.UpdateRecord("task_type", rec);
if (!result.Success) throw new Exception(result.Message);
}
#endregion

#region << ***Update record*** Id: 489b16e1-91b1-4a05-b247-50ed74f7aaaf (task_type) >>
{
var json = @"{
""$type"": ""WebVella.Erp.Api.Models.EntityRecord, WebVella.Erp"",
""id"": ""489b16e1-91b1-4a05-b247-50ed74f7aaaf"",
""is_default"": false,
""label"": ""Email"",
""sort_index"": 3.0,
""is_system"": true,
""is_enabled"": true,
""icon_class"": ""fa fa-envelope"",
""color"": ""#2196F3"",
""l_scope"": ""[\""projects\""]""
}";
EntityRecord rec = JsonConvert.DeserializeObject<EntityRecord>(json);
var result = recMan.UpdateRecord("task_type", rec);
if (!result.Success) throw new Exception(result.Message);
}
#endregion



}
}
}
23 changes: 23 additions & 0 deletions WebVella.Erp.Plugins.Next/NextPlugin._.cs
Expand Up @@ -165,6 +165,29 @@ public void ProcessPatches()
}
}

//PATCH 20190222
{
var patchVersion = 20190222;
if (currentPluginSettings.Version < patchVersion)
{
try
{
currentPluginSettings.Version = patchVersion;
Patch20190222(entMan, relMan, recMan);
}
catch (ValidationException ex)
{
var exception = ex;
throw ex;
}
catch (Exception ex)
{
var exception = ex;
throw ex;
}
}
}

#endregion


Expand Down

0 comments on commit eab4d0d

Please sign in to comment.