using Kingdee.CDP.WebApi.SDK; using MyCode.Project.Domain.Config; using MyCode.Project.Domain.Message.Response.User; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MyCode.Project.Services { public static class K3CloudHelp { private static K3CloudApi k3CloudApi; public static K3CloudApi GetK3CloudApiInstance() { K3CloudOption k3CloudOption = new K3CloudOption() { AcctID = K3CloudConfig.AcctID, AppID = K3CloudConfig.AppID, AppSec = K3CloudConfig.AppSec, LCID = Convert.ToInt32(K3CloudConfig.LCID), ServerUrl = K3CloudConfig.ServerUrl, UserName = K3CloudConfig.UserName, OrgNumber = K3CloudConfig.OrgNumber }; if (k3CloudApi == null) { k3CloudApi = new K3CloudApi(k3CloudOption.ServerUrl, 30); } k3CloudApi.InitClient( k3CloudOption.AcctID, k3CloudOption.AppID, k3CloudOption.AppSec, k3CloudOption.UserName, k3CloudOption.LCID, k3CloudOption.OrgNumber, k3CloudOption.ServerUrl ); return k3CloudApi; } public static K3CloudApi CreateDefaultK3CloudApi() { return k3CloudApi; } private class K3CloudOption { /// /// DBID /// public string AcctID { get; set; } /// /// 应用ID /// public string AppID { get; set; } /// /// 应用密钥 /// public string AppSec { get; set; } /// /// 服务器地址 /// public string ServerUrl { get; set; } /// /// 默认语言ID /// public int LCID { get; set; } /// /// 默认用户名称 /// public string UserName { get; set; } /// /// 默认组织ID /// public string OrgNumber { get; set; } } } }