public CloudServiceClientBase(
            ILogger logger,
            IHttpClientFactory clientFactory,
            IHttpPlatformHelperService http_helper,
            IToast toast,
            IAuthHelper authHelper,
            ICloudServiceSettings settings,
            IModelValidator validator) : base(logger, http_helper, clientFactory)
        {
            this.authHelper = authHelper;
            this.toast      = toast;
            this.settings   = settings;
            ApiBaseUrl      = string.IsNullOrWhiteSpace(settings.ApiBaseUrl)
                ? throw new ArgumentNullException(nameof(ApiBaseUrl)) : settings.ApiBaseUrl;
            connection = new ApiConnection(logger, this, http_helper, validator);

            #region SetClients

            Account       = new AccountClient(connection);
            Manage        = new ManageClient(connection);
            AuthMessage   = new AuthMessageClient(connection);
            Version       = new VersionClient(connection);
            ActiveUser    = new ActiveUserClient(connection);
            Accelerate    = new AccelerateClient(connection);
            Script        = new ScriptClient(connection);
            DonateRanking = new DonateRankingClient(connection);

            #endregion
        }
示例#2
0
        public void GetClient()
        {
            con = new DBConnection();
            var clients = new List <ManageClient>();

            con.OpenConection();
            con._dr = con.DataReader(@"SELECT * FROM client ORDER BY name ASC");
            while (con._dr.Read())
            {
                var cli = new ManageClient
                {
                    clientId     = Convert.ToInt32(con._dr["clientid"].ToString()),
                    clientName   = con._dr["name"].ToString(),
                    clientAdd    = con._dr["address"].ToString(),
                    clientCon    = con._dr["contact1"].ToString(),
                    clientCon2   = con._dr["contact2"].ToString(),
                    clientStatus = Convert.ToInt32(con._dr["contactstatus"].ToString())
                };
                clients.Add(cli);
            }
            con._dr.Close();
            con.CloseConnection();
            var js = new JavaScriptSerializer();

            Context.Response.Write(js.Serialize(clients));
        }
示例#3
0
 public UploadCommand(ManageClient client, ApiClient apiClient, UploadClient uploader, ILogger <UploadCommand> logger)
 {
     _manager   = client;
     _apiClient = apiClient;
     _uploader  = uploader;
     _logger    = logger;
 }
示例#4
0
 public CheckCommand(ApiClient apiClient, ILogger <CheckCommand> logger, UploadClient uploadClient, ModConfiguration config, ManageClient manager)
 {
     _apiClient    = apiClient;
     _logger       = logger;
     _uploadClient = uploadClient;
     _config       = config;
     _manager      = manager;
 }
示例#5
0
        public void GetClientById(int id)
        {
            con = new DBConnection();
            ManageClient clie = new ManageClient();

            con.OpenConection();
            con._dr = con.DataReader(@"SELECT * FROM client WHERE clientid='" + id + "'");
            while (con._dr.Read())
            {
                clie.clientId     = Convert.ToInt32(con._dr["clientid"].ToString());
                clie.clientName   = con._dr["name"].ToString();
                clie.clientAdd    = con._dr["address"].ToString();
                clie.clientCon    = con._dr["contact1"].ToString();
                clie.clientCon2   = con._dr["contact2"].ToString();
                clie.clientStatus = Convert.ToInt32(con._dr["contactstatus"].ToString());
            }
            con._dr.Close();
            con.CloseConnection();
            JavaScriptSerializer js = new JavaScriptSerializer();

            Context.Response.Write(js.Serialize(clie));
        }
示例#6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Convert.ToString(Request.QueryString["code"])))
            {
                try
                {
                    Authentication authdata = getaccesstoken(Convert.ToString(Request.QueryString["code"]));

                    SetAuthorizationDataAsync(authdata).Wait();


                    ManageClient manageClient = new ManageClient();

                    manageClient.RunAsync(_authorizationData);
                }
                catch (Exception ex) { }
            }
            else
            {
                generatecode();
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ClientDashboardController"/> class
 /// </summary>
 /// <param name="manageClient">manage Client</param>
 public ClientDashboardController(ManageClient manageClient)
 {
     this._manageClient = manageClient;
 }
示例#8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ClientListingController"/> class
 /// </summary>
 /// <param name="manageClient">manage Client</param>
 public ClientListingController(ManageClient manageClient)
 {
     this._manageClient = manageClient;
 }
示例#9
0
 public ChangelogCommand(ManageClient uploadClient, ApiClient apiClient, ILogger <ChangelogCommand> logger)
 {
     _client = uploadClient;
     _api    = apiClient;
     _logger = logger;
 }
示例#10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HomeController"/> class
 /// </summary>
 /// <param name="manageClient">manage Client</param>
 public HomeController(ManageClient manageClient)
 {
     this._manageClient = manageClient;
 }