소스 검색

Start on API Interface

master
rpm-mcarman 3 년 전
부모
커밋
c7cdd0aa21
100개의 변경된 파일15174개의 추가작업 그리고 24개의 파일을 삭제
  1. +1
    -1
      CustomerImp.cs
  2. +1
    -1
      Equipment.cs
  3. +14534
    -0
      Log/log.log
  4. +1
    -1
      Part.cs
  5. +23
    -7
      Program.cs
  6. +44
    -0
      RESTObjects/Customer.cs
  7. +0
    -12
      RESTObjects/CustomerSpec.cs
  8. +33
    -0
      RESTObjects/InspectionLevel.cs
  9. +51
    -0
      RESTObjects/InspectionType.cs
  10. +38
    -0
      RESTObjects/Make.cs
  11. +36
    -0
      RESTObjects/Model.cs
  12. +29
    -0
      RESTObjects/Product.cs
  13. +25
    -1
      RESTObjects/RESTResponse.cs
  14. +70
    -0
      RESTObjects/RESTService.cs
  15. +264
    -0
      RESTObjects/Template.cs
  16. +1
    -1
      WorkOrder.cs
  17. BIN
      bin/Debug/net6.0/jdis_import.dll
  18. BIN
      bin/Debug/net6.0/jdis_import.pdb
  19. BIN
      bin/release/net6.0/ubuntu.18.04-x64/._Independentsoft.Exchange.dll
  20. +4
    -0
      bin/release/net6.0/ubuntu.18.04-x64/CCAddress.xml
  21. BIN
      bin/release/net6.0/ubuntu.18.04-x64/Independentsoft.Exchange.dll
  22. +19
    -0
      bin/release/net6.0/ubuntu.18.04-x64/IntervalData.xml
  23. BIN
      bin/release/net6.0/ubuntu.18.04-x64/Microsoft.CSharp.dll
  24. BIN
      bin/release/net6.0/ubuntu.18.04-x64/Microsoft.Exchange.WebServices.Auth.dll
  25. BIN
      bin/release/net6.0/ubuntu.18.04-x64/Microsoft.Exchange.WebServices.dll
  26. BIN
      bin/release/net6.0/ubuntu.18.04-x64/Microsoft.Identity.Client.dll
  27. BIN
      bin/release/net6.0/ubuntu.18.04-x64/Microsoft.IdentityModel.Abstractions.dll
  28. BIN
      bin/release/net6.0/ubuntu.18.04-x64/Microsoft.VisualBasic.Core.dll
  29. BIN
      bin/release/net6.0/ubuntu.18.04-x64/Microsoft.VisualBasic.dll
  30. BIN
      bin/release/net6.0/ubuntu.18.04-x64/Microsoft.Win32.Primitives.dll
  31. BIN
      bin/release/net6.0/ubuntu.18.04-x64/Microsoft.Win32.Registry.dll
  32. BIN
      bin/release/net6.0/ubuntu.18.04-x64/Newtonsoft.Json.Bson.dll
  33. BIN
      bin/release/net6.0/ubuntu.18.04-x64/Newtonsoft.Json.dll
  34. BIN
      bin/release/net6.0/ubuntu.18.04-x64/RestSharp.dll
  35. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.AppContext.dll
  36. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Buffers.dll
  37. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Collections.Concurrent.dll
  38. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Collections.Immutable.dll
  39. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Collections.NonGeneric.dll
  40. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Collections.Specialized.dll
  41. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Collections.dll
  42. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.ComponentModel.Annotations.dll
  43. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.ComponentModel.DataAnnotations.dll
  44. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.ComponentModel.EventBasedAsync.dll
  45. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.ComponentModel.Primitives.dll
  46. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.ComponentModel.TypeConverter.dll
  47. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.ComponentModel.dll
  48. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Configuration.dll
  49. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Console.dll
  50. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Core.dll
  51. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Data.Common.dll
  52. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Data.DataSetExtensions.dll
  53. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Data.SqlClient.dll
  54. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Data.dll
  55. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Diagnostics.Contracts.dll
  56. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Diagnostics.Debug.dll
  57. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Diagnostics.DiagnosticSource.dll
  58. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Diagnostics.FileVersionInfo.dll
  59. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Diagnostics.Process.dll
  60. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Diagnostics.StackTrace.dll
  61. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Diagnostics.TextWriterTraceListener.dll
  62. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Diagnostics.Tools.dll
  63. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Diagnostics.TraceSource.dll
  64. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Diagnostics.Tracing.dll
  65. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Drawing.Primitives.dll
  66. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Drawing.dll
  67. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Dynamic.Runtime.dll
  68. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Formats.Asn1.dll
  69. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Globalization.Calendars.dll
  70. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Globalization.Extensions.dll
  71. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Globalization.dll
  72. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.IO.Compression.Brotli.dll
  73. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.IO.Compression.FileSystem.dll
  74. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.IO.Compression.ZipFile.dll
  75. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.IO.Compression.dll
  76. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.IO.FileSystem.AccessControl.dll
  77. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.IO.FileSystem.DriveInfo.dll
  78. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.IO.FileSystem.Primitives.dll
  79. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.IO.FileSystem.Watcher.dll
  80. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.IO.FileSystem.dll
  81. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.IO.IsolatedStorage.dll
  82. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.IO.MemoryMappedFiles.dll
  83. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.IO.Pipes.AccessControl.dll
  84. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.IO.Pipes.dll
  85. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.IO.UnmanagedMemoryStream.dll
  86. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.IO.dll
  87. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Linq.Expressions.dll
  88. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Linq.Parallel.dll
  89. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Linq.Queryable.dll
  90. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Linq.dll
  91. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Memory.dll
  92. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Net.Http.Formatting.dll
  93. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Net.Http.Json.dll
  94. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Net.Http.dll
  95. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Net.HttpListener.dll
  96. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Net.Mail.dll
  97. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Net.NameResolution.dll
  98. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Net.NetworkInformation.dll
  99. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Net.Ping.dll
  100. BIN
      bin/release/net6.0/ubuntu.18.04-x64/System.Net.Primitives.dll

Customer.cs → CustomerImp.cs 파일 보기

@@ -5,7 +5,7 @@ using System.Threading.Tasks;

namespace jdis_import
{
public class Customer
public class CustomerImport
{
public string Number { get; set; }
public string Name { get; set; }

+ 1
- 1
Equipment.cs 파일 보기

@@ -5,7 +5,7 @@ using System.Threading.Tasks;

namespace jdis_import
{
public class Equipment
public class EquipmentImport
{
public int MID { get; set; }
public string Make { get; set; }


+ 14534
- 0
Log/log.log
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기


+ 1
- 1
Part.cs 파일 보기

@@ -5,7 +5,7 @@ using System.Threading.Tasks;

namespace jdis_import
{
public class Part
public class PartImport
{

public string Qty { get; set; }


+ 23
- 7
Program.cs 파일 보기

@@ -8,6 +8,7 @@ using System.IO;
using System.Data;
using System.Data.SqlClient;
using System.Reflection;
using jdis_import.RESTObjects;
/*
Secret Value up-8Q~y46~JyQZjJlsAJ-zpXpglpmuPIJ1Gx3a2O
@@ -21,6 +22,12 @@ namespace jdis_import
{
class Program
{
private static List<Customer> _customers;
private static List<Make> _makes;
private static List<Product> _products;
private static List<Model> _models;
private static List<InspectionType> _inspectionTypes;
private static List<Template> _templates;
private static string _exeDir;
private static bool _log = true;
private static string _connection = "Data Source=192.168.0.7;Initial Catalog=Connexion_Brandt;User ID=mobilepmuser;Password=data4techs;Encrypt=No;TrustServerCertificate=true;Persist Security Info=True;";
@@ -33,6 +40,15 @@ namespace jdis_import
public static Dictionary<string, int> InspectionType;
static async System.Threading.Tasks.Task Main(string[] args)
{
RESTService rservice = new RESTService();
_customers = rservice.RestGet<Customer>("customers.svc");
_makes = rservice.RestGet<Make>("makes.svc");
_products = rservice.RestGet<Product>("products.svc");
_models = rservice.RestGet<Model>("models.svc");
_inspectionTypes = rservice.RestGet<InspectionType>("inspectionTypes.svc");
_templates = rservice.RestGet<Template>("templates.svc");
_exeDir = Environment.CurrentDirectory;
SetupDirectories();
List<ToDo> list = new List<ToDo>();
@@ -460,10 +476,10 @@ namespace jdis_import
{
string file = Path.Combine(_exeDir, todo.FileName);// todo.FileName;
todo.FileName = file;
Customer c = new Customer();
WorkOrder wo = new WorkOrder();
Equipment eq = new Equipment();
List<Part> parts = new List<Part>();
CustomerImport c = new CustomerImport();
WorkOrderImport wo = new WorkOrderImport();
EquipmentImport eq = new EquipmentImport();
List<PartImport> parts = new List<PartImport>();
Console.WriteLine("Line 306: " + file);
Console.WriteLine("Line 307: " + file);
@@ -613,7 +629,7 @@ namespace jdis_import
{
if (qty < 100 && !currentline.Contains("HR"))
{
Part pt = new Part();
PartImport pt = new PartImport();
string sline = currentline.Substring(19).Trim();
//pt.Description = currentline.Substring(34, 14);
pt.Number = sline.Substring(0, sline.IndexOf(" "));
@@ -635,7 +651,7 @@ namespace jdis_import
List<CSVObject> exceptions = new List<CSVObject>();
if (parts.Count == 0)
{
Part p = new Part();
PartImport p = new PartImport();
p.Description = string.Empty;
p.Qty = string.Empty;
p.Number = string.Empty;
@@ -647,7 +663,7 @@ namespace jdis_import
_sqlMessages.Add(e.Message);
}
foreach (Part prt in parts)
foreach (PartImport prt in parts)
{
CSVObject obj = new CSVObject();
obj.Address = string.Format(frmtString, c.Addr1.Trim());


+ 44
- 0
RESTObjects/Customer.cs 파일 보기

@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace jdis_import.RESTObjects
{
[JsonObject(MemberSerialization.OptIn)]
public class Customer
{
[JsonProperty(PropertyName = "Address")]
public string Address { get; set; }
[JsonProperty(PropertyName = "Address2")]
public string Address2 { get; set; }
[JsonProperty(PropertyName = "City")]
public string City { get; set; }
[JsonProperty(PropertyName = "State")]
public string State { get; set; }
[JsonProperty(PropertyName = "Name")]
public string Name { get; set; }
[JsonProperty(PropertyName = "Number")]
public string Number { get; set; }
[JsonProperty(PropertyName = "ID")]
public int ID { get; set; }
[JsonProperty(PropertyName = "IsActive")]
public bool IsActive { get; set; }
[JsonProperty(PropertyName = "Phone1")]
public string Phone1 { get; set; }
[JsonProperty(PropertyName = "Phone2")]
public string Phone2 { get; set; }
[JsonProperty(PropertyName = "Fax")]
public string Fax { get; set; }
[JsonProperty(PropertyName = "CreateDate")]
public DateTime CreateDate { get; set; }
[JsonProperty(PropertyName = "CreateUserID")]
public int CreateUserID { get; set; }
[JsonProperty(PropertyName = "UpdateDate")]
public DateTime? UpdateDate { get; set; }
[JsonProperty(PropertyName = "UpdateUserID")]
public int UpdateUserID { get; set; }

}
}

+ 0
- 12
RESTObjects/CustomerSpec.cs 파일 보기

@@ -1,12 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace jdis_import.RESTObjects
{
public class CustomerSpec
{
}
}

+ 33
- 0
RESTObjects/InspectionLevel.cs 파일 보기

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace jdis_import.RESTObjects
{
public class InspectionLevel
{
[JsonProperty(PropertyName = "CreateDate")]
public DateTime CreateDate { get; set; }
[JsonProperty(PropertyName = "CreateUserID")]
public int CreateUserID { get; set; }
[JsonProperty(PropertyName = "Description")]
public string Description { get; set; }
[JsonProperty(PropertyName = "ID")]
public int ID { get; set; }
[JsonProperty(PropertyName = "InspectionType")]
public InspectionType InspectionType { get; set; }
[JsonProperty(PropertyName = "InspectionTypeID")]
public int InspectionTypeID { get { return this.InspectionType != null ? this.InspectionType.ID : 0; } }
[JsonProperty(PropertyName = "IsActive")]
public bool IsActive { get; set; }
[JsonProperty(PropertyName = "Name")]
public string Name { get; set; }
[JsonProperty(PropertyName = "UpdateDate")]
public DateTime? UpdateDate { get; set; }
[JsonProperty(PropertyName = "UpdateUserID")]
public int? UpdateUserID { get; set; }

}
}

+ 51
- 0
RESTObjects/InspectionType.cs 파일 보기

@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace jdis_import.RESTObjects
{
public class InspectionType
{
[JsonProperty(PropertyName = "CreateDate")]
public DateTime CreateDate { get; set; }
[JsonProperty(PropertyName = "CreateUserID")]
public int CreateUserID { get; set; }
[JsonProperty(PropertyName = "Description")]
public string Description { get; set; }
[JsonProperty(PropertyName = "ID")]
public int ID { get; set; }
[JsonProperty(PropertyName = "InspectionLevels")]
public List<InspectionLevel> InspectionLevels { get; set; }
[JsonProperty(PropertyName = "IsActive")]
public bool IsActive { get; set; }
[JsonProperty(PropertyName = "Name")]
public string Name { get; set; }
[JsonProperty(PropertyName = "UpdateDate")]
public DateTime? UpdateDate { get; set; }
[JsonProperty(PropertyName = "UpdateUserID")]
public int? UpdateUserID { get; set; }
/*
"CreateDate":"\/Date(928164000000-0400)\/",
"CreateUserID":2147483647,
"Description":"String content",
"ID":2147483647,
"InspectionLevels":[{
"CreateDate":"\/Date(928164000000-0400)\/",
"CreateUserID":2147483647,
"Description":"String content",
"ID":2147483647,
"InspectionTypeID":2147483647,
"IsActive":true,
"Name":"String content",
"UpdateDate":"\/Date(928164000000-0400)\/",
"UpdateUserID":2147483647
}],
"IsActive":true,
"Name":"String content",
"UpdateDate":"\/Date(928164000000-0400)\/",
"UpdateUserID":2147483647
*/
}
}

+ 38
- 0
RESTObjects/Make.cs 파일 보기

@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace jdis_import.RESTObjects
{
[JsonObject(MemberSerialization.OptIn)]
public class Make
{

[JsonProperty(PropertyName = "CreateDate")]
public DateTime CreateDate { get; set; }

[JsonProperty(PropertyName = "CreateUserID")]
public int CreateUserID { get; set; }

[JsonProperty(PropertyName = "Description")]
public string Description { get; set; }

[JsonProperty(PropertyName = "ID")]
public int ID { get; set; }

[JsonProperty(PropertyName = "IsActive")]
public bool IsActive { get; set; }

[JsonProperty(PropertyName = "Name")]
public string Name { get; set; }

[JsonProperty(PropertyName = "UpdateDate")]
public DateTime? UpdateDate { get; set; }

[JsonProperty(PropertyName = "UpdateUserID")]
public int? UpdateUserID { get; set; }

}
}

+ 36
- 0
RESTObjects/Model.cs 파일 보기

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace jdis_import.RESTObjects
{
public class Model
{
[JsonProperty(PropertyName = "CreateDate")]
public DateTime CreateDate { get; set; }
[JsonProperty(PropertyName = "CreateUserID")]
public int CreateUserID { get; set; }
[JsonProperty(PropertyName = "Description")]
public string Description { get; set; }
[JsonProperty(PropertyName = "ID")]
public int ID { get; set; }
[JsonProperty(PropertyName = "IsActive")]
public bool IsActive { get; set; }
[JsonProperty(PropertyName = "Make")]
public Make Make { get; set; }
[JsonProperty(PropertyName = "MakeID")]
public int MakeID { get { return this.Make != null ? this.Make.ID : 0; } set { value = this.Make != null ? this.Make.ID : 0; } }
[JsonProperty(PropertyName = "Name")]
public string Name { get; set; }
[JsonProperty(PropertyName = "Product")]
public Product Product { get; set; }
[JsonProperty(PropertyName = "ProductID")]
public int ProductID { get { return this.Product != null ? this.Product.ID : 0; } set { value = this.Product != null ? this.Product.ID : 0; } }
[JsonProperty(PropertyName = "UpdateDate")]
public DateTime? UpdateDate { get; set; }
[JsonProperty(PropertyName = "UpdateUserID")]
public int? UpdateUserID { get; set; }
}
}

+ 29
- 0
RESTObjects/Product.cs 파일 보기

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace jdis_import.RESTObjects
{
public class Product
{

[JsonProperty(PropertyName = "Code")]
public string Code { get; set; }
[JsonProperty(PropertyName = "CreateDate")]
public DateTime CreateDate { get; set; }
[JsonProperty(PropertyName = "CreateUserID")]
public int CreateUserID { get; set; }
[JsonProperty(PropertyName = "Description")]
public string Description { get; set; }
[JsonProperty(PropertyName = "ID")]
public int ID { get; set; }
[JsonProperty(PropertyName = "IsActive")]
public bool IsActive { get; set; }
[JsonProperty(PropertyName = "UpdateDate")]
public DateTime? UpdateDate { get; set; }
[JsonProperty(PropertyName = "UpdateUserID")]
public int? UpdateUserID { get; set; }
}
}

+ 25
- 1
RESTObjects/RESTResponse.cs 파일 보기

@@ -1,5 +1,6 @@
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace jdis_import.RESTObjects
{
@@ -36,4 +37,27 @@ namespace jdis_import.RESTObjects

#endregion
}
public static class Deserialize
{
public static T FromJson<T>(string json)
{
return JsonConvert.DeserializeObject<T>(json, Converter.Settings);
}
}
public static class Serialize
{
public static string ToJson<T>(this T self)
{
return JsonConvert.SerializeObject(self, Converter.Settings);
}
}
internal static class Converter
{
public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
{
MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
DateParseHandling = DateParseHandling.None,
DateFormatHandling = DateFormatHandling.MicrosoftDateFormat,
};
}
}

+ 70
- 0
RESTObjects/RESTService.cs 파일 보기

@@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Net.Http;
using System.Net.Http.Headers;
using RestSharp;

namespace jdis_import.RESTObjects
{
public class RESTService
{
private string _baseUrl = "http://servicesbrandt.rpmindustries.com:8081";
private HttpClient _httpClient;

public RESTService()
{

}
public RESTService(string endPoint, Dictionary<string, string> parameters)
{
_baseUrl = _baseUrl + "/" + endPoint;
foreach (KeyValuePair<string, string> kvp in parameters)
{
_baseUrl = _baseUrl + "/" + kvp.Key;
if (!string.IsNullOrEmpty(kvp.Value))
_baseUrl = _baseUrl + "/" + kvp.Value;
}

_httpClient = new HttpClient(new HttpClientHandler
{
UseCookies = true,
CookieContainer = new System.Net.CookieContainer()
})
{
BaseAddress = new Uri(_baseUrl),
DefaultRequestHeaders = { Accept = { MediaTypeWithQualityHeaderValue.Parse("application/json") } }
};
}
public string RestGet(string endpoint, Dictionary<string, string> parameters = null)
{
string url = _baseUrl + "/" + endpoint + '/';

RestClient client = new RestClient(url);

RestRequest request = new RestRequest(endpoint, Method.Get);
request.AddHeader("Accept", "application/json");
request.Method = Method.Get;
RestResponse response = client.Execute(request);
return response.Content;
}
public List<T> RestGet<T>(string endpoint)
{
RESTResponse<List<T>> rest = new RESTResponse<List<T>>();
string url = _baseUrl + "/" + endpoint + "/";

RestClient client = new RestClient(url);

RestRequest request = new RestRequest();
request.Method = Method.Get;
request.AddHeader("Accept", "application/json");
request.Method = Method.Get;
RestResponse response = client.Execute(request);
rest = Deserialize.FromJson<RESTResponse<List<T>>>(response.Content);
List<T> list = new List<T>();
list.AddRange(rest.data);
return list;
}
}
}

+ 264
- 0
RESTObjects/Template.cs 파일 보기

@@ -0,0 +1,264 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace jdis_import.RESTObjects
{
public class Template
{
[JsonProperty(PropertyName = "CreateDate")]
public DateTime CreateDate { get; set; }
[JsonProperty(PropertyName = "CreateUserID")]
public int CreateUserID { get; set; }
[JsonProperty(PropertyName = "Description")]
public string Description { get; set; }
[JsonProperty(PropertyName = "ID")]
public int ID { get; set; }
[JsonProperty(PropertyName = "Name")]
public string Name { get; set; }
[JsonProperty(PropertyName = "IsActive")]
public bool IsActive { get; set; }
[JsonProperty(PropertyName = "UpdateDate")]
public DateTime? UpdateDate { get; set; }
[JsonProperty(PropertyName = "UpdateUserID")]
public int? UpdateUserID { get; set; }
[JsonProperty(PropertyName = "InspectionLevel")]
public InspectionLevel InspectionLevel { get; set; }
[JsonProperty(PropertyName = "InspectionLevelID")]
public int InspectionLevelID
{
get
{
return this.InspectionLevel != null ? this.InspectionLevel.ID : 0;
}
set
{
value = this.InspectionLevel != null ? this.InspectionLevel.ID : 0;
}
}
[JsonProperty(PropertyName = "InspectionType")]
public InspectionType InspectionType { get; set; }
[JsonProperty(PropertyName = "InspectionTypeID")]
public int InspectionTypeID
{
get
{
return this.InspectionType != null ? this.InspectionType.ID : 0;
}
set
{
value = this.InspectionType != null ? this.InspectionType.ID : 0;
}
}
[JsonProperty(PropertyName = "Model")]
public Model Model { get; set; }
[JsonProperty(PropertyName = "ModelID")]
public int? ModelID { get { return this.Model != null ? Model.ID : null; } set { value = this.Model != null ? Model.ID : null; } }
[JsonProperty(PropertyName = "Product")]
public Product Product { get; set; }
[JsonProperty(PropertyName = "ProductID")]
public int? ProductID { get { return this.Product != null ? Product.ID : null; } set { value = this.Product != null ? Product.ID : null; } }

/*
"TemplateCategories":[{
"Category":{
"CreateDate":"\/Date(928164000000-0400)\/",
"CreateUserID":2147483647,
"Description":"String content",
"ID":2147483647,
"IsActive":true,
"Name":"String content",
"UpdateDate":"\/Date(928164000000-0400)\/",
"UpdateUserID":2147483647
},
"CategoryID":2147483647,
"CreateDate":"\/Date(928164000000-0400)\/",
"CreateUserID":2147483647,
"ID":2147483647,
"SortOrder":2147483647,
"TemplateID":2147483647,
"TemplateItemSpecs":[{
"CreateDate":"\/Date(928164000000-0400)\/",
"CreateUserID":2147483647,
"ID":2147483647,
"Item":{
"Category":{
"CreateDate":"\/Date(928164000000-0400)\/",
"CreateUserID":2147483647,
"Description":"String content",
"ID":2147483647,
"IsActive":true,
"Name":"String content",
"UpdateDate":"\/Date(928164000000-0400)\/",
"UpdateUserID":2147483647
},
"CategoryID":2147483647,
"CreateDate":"\/Date(928164000000-0400)\/",
"CreateUserID":2147483647,
"Description":"String content",
"ID":2147483647,
"InputType":{
"ID":2147483647,
"Name":"String content"
},
"InputTypeID":2147483647,
"IsActive":true,
"ItemResponseTypes":[{
"ID":2147483647,
"ItemID":2147483647,
"ResponseType":{
"Color":"String content",
"CreateDate":"\/Date(928164000000-0400)\/",
"CreateUserID":2147483647,
"ID":2147483647,
"IsActive":true,
"Name":"String content",
"RepairType":{
"Color":"String content",
"ID":2147483647,
"Name":"String content"
},
"UpdateDate":"\/Date(928164000000-0400)\/",
"UpdateUserID":2147483647
},
"ResponseTypeID":2147483647,
"SortOrder":2147483647
}],
"Name":"String content",
"SMSCCode":{
"CreateDate":"\/Date(928164000000-0400)\/",
"CreateUserID":2147483647,
"Description":"String content",
"ID":2147483647,
"IsActive":true,
"Name":"String content",
"UpdateDate":"\/Date(928164000000-0400)\/",
"UpdateUserID":2147483647
},
"SMSCCodeID":2147483647,
"Specs":[{
"CreateDate":"\/Date(928164000000-0400)\/",
"CreateUserID":2147483647,
"ID":2147483647,
"IsActive":true,
"ItemID":2147483647,
"Name":"String content",
"NumberOfTests":2147483647,
"SpecItems":[{
"ComparisonType":{
"Description":"String content",
"ID":2147483647,
"Name":"String content"
},
"ComparisonTypeID":2147483647,
"ID":2147483647,
"Name":"String content",
"Qualifier":"String content",
"SortOrder":2147483647,
"SpecID":2147483647,
"SpecItemValues":[{
"ID":2147483647,
"SortOrder":2147483647,
"SpecItemID":2147483647,
"Value":"String content",
"ValueType":{
"Description":"String content",
"ID":2147483647,
"Name":"String content"
},
"ValueTypeID":2147483647
}],
"Unit":{
"CreateDate":"\/Date(928164000000-0400)\/",
"CreateUserID":2147483647,
"DataType":{
"Description":"String content",
"ID":2147483647,
"Name":"String content"
},
"DataTypeID":2147483647,
"Description":"String content",
"ID":2147483647,
"IsActive":true,
"Name":"String content",
"UpdateDate":"\/Date(928164000000-0400)\/",
"UpdateUserID":2147483647
},
"UnitID":2147483647
}],
"UpdateDate":"\/Date(928164000000-0400)\/",
"UpdateUserID":2147483647
}],
"UpdateDate":"\/Date(928164000000-0400)\/",
"UpdateUserID":2147483647
},
"ItemID":2147483647,
"SortOrder":2147483647,
"Spec":{
"CreateDate":"\/Date(928164000000-0400)\/",
"CreateUserID":2147483647,
"ID":2147483647,
"IsActive":true,
"ItemID":2147483647,
"Name":"String content",
"NumberOfTests":2147483647,
"SpecItems":[{
"ComparisonType":{
"Description":"String content",
"ID":2147483647,
"Name":"String content"
},
"ComparisonTypeID":2147483647,
"ID":2147483647,
"Name":"String content",
"Qualifier":"String content",
"SortOrder":2147483647,
"SpecID":2147483647,
"SpecItemValues":[{
"ID":2147483647,
"SortOrder":2147483647,
"SpecItemID":2147483647,
"Value":"String content",
"ValueType":{
"Description":"String content",
"ID":2147483647,
"Name":"String content"
},
"ValueTypeID":2147483647
}],
"Unit":{
"CreateDate":"\/Date(928164000000-0400)\/",
"CreateUserID":2147483647,
"DataType":{
"Description":"String content",
"ID":2147483647,
"Name":"String content"
},
"DataTypeID":2147483647,
"Description":"String content",
"ID":2147483647,
"IsActive":true,
"Name":"String content",
"UpdateDate":"\/Date(928164000000-0400)\/",
"UpdateUserID":2147483647
},
"UnitID":2147483647
}],
"UpdateDate":"\/Date(928164000000-0400)\/",
"UpdateUserID":2147483647
},
"SpecID":2147483647,
"TemplateCategoryID":2147483647,
"UpdateDate":"\/Date(928164000000-0400)\/",
"UpdateUserID":2147483647
}],
"UpdateDate":"\/Date(928164000000-0400)\/",
"UpdateUserID":2147483647
}],
"UpdateDate":"\/Date(928164000000-0400)\/",
"UpdateUserID":2147483647
*/
}
}

+ 1
- 1
WorkOrder.cs 파일 보기

@@ -5,7 +5,7 @@ using System.Threading.Tasks;

namespace jdis_import
{
public class WorkOrder
public class WorkOrderImport
{
public DateTime CreateDate { get; set; }
public DateTime OpnDt { get; set; }


BIN
bin/Debug/net6.0/jdis_import.dll 파일 보기


BIN
bin/Debug/net6.0/jdis_import.pdb 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/._Independentsoft.Exchange.dll 파일 보기


+ 4
- 0
bin/release/net6.0/ubuntu.18.04-x64/CCAddress.xml 파일 보기

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<Root>
<Mike>mcarman@rpmindustries.com</Mike>
</Root>

BIN
bin/release/net6.0/ubuntu.18.04-x64/Independentsoft.Exchange.dll 파일 보기


+ 19
- 0
bin/release/net6.0/ubuntu.18.04-x64/IntervalData.xml 파일 보기

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<Root>
<ZZ50>1</ZZ50>
<ZZ250>1</ZZ250>
<ZZ500>2</ZZ500>
<ZZ1000>3</ZZ1000>
<ZZ2000>4</ZZ2000>
<ZZ3000>5</ZZ3000>
<ZZ4000>6</ZZ4000>
<ZZ5000>7</ZZ5000>
<ZZ6000>6</ZZ6000>
<ZZ300>1</ZZ300>
<ZZ600>2</ZZ600>
<ZZ1200>3</ZZ1200>
<ZZ2400>4</ZZ2400>
<ZZ3600>6</ZZ3600>
<ZZ4800>2</ZZ4800>
<INSPECTION>11</INSPECTION>
</Root>

BIN
bin/release/net6.0/ubuntu.18.04-x64/Microsoft.CSharp.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/Microsoft.Exchange.WebServices.Auth.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/Microsoft.Exchange.WebServices.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/Microsoft.Identity.Client.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/Microsoft.IdentityModel.Abstractions.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/Microsoft.VisualBasic.Core.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/Microsoft.VisualBasic.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/Microsoft.Win32.Primitives.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/Microsoft.Win32.Registry.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/Newtonsoft.Json.Bson.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/Newtonsoft.Json.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/RestSharp.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.AppContext.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Buffers.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Collections.Concurrent.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Collections.Immutable.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Collections.NonGeneric.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Collections.Specialized.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Collections.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.ComponentModel.Annotations.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.ComponentModel.DataAnnotations.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.ComponentModel.EventBasedAsync.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.ComponentModel.Primitives.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.ComponentModel.TypeConverter.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.ComponentModel.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Configuration.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Console.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Core.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Data.Common.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Data.DataSetExtensions.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Data.SqlClient.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Data.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Diagnostics.Contracts.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Diagnostics.Debug.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Diagnostics.DiagnosticSource.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Diagnostics.FileVersionInfo.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Diagnostics.Process.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Diagnostics.StackTrace.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Diagnostics.TextWriterTraceListener.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Diagnostics.Tools.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Diagnostics.TraceSource.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Diagnostics.Tracing.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Drawing.Primitives.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Drawing.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Dynamic.Runtime.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Formats.Asn1.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Globalization.Calendars.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Globalization.Extensions.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Globalization.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.IO.Compression.Brotli.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.IO.Compression.FileSystem.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.IO.Compression.ZipFile.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.IO.Compression.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.IO.FileSystem.AccessControl.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.IO.FileSystem.DriveInfo.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.IO.FileSystem.Primitives.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.IO.FileSystem.Watcher.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.IO.FileSystem.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.IO.IsolatedStorage.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.IO.MemoryMappedFiles.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.IO.Pipes.AccessControl.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.IO.Pipes.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.IO.UnmanagedMemoryStream.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.IO.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Linq.Expressions.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Linq.Parallel.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Linq.Queryable.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Linq.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Memory.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Net.Http.Formatting.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Net.Http.Json.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Net.Http.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Net.HttpListener.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Net.Mail.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Net.NameResolution.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Net.NetworkInformation.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Net.Ping.dll 파일 보기


BIN
bin/release/net6.0/ubuntu.18.04-x64/System.Net.Primitives.dll 파일 보기


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.

불러오는 중...
취소
저장