Example #1
0
 /// <summary>
 ///     Gets the list of characters on the given account.
 /// </summary>
 /// <param name="keyId">API Key ID to query</param>
 /// <param name="vCode">The Verification Code for this ID</param>
 /// <param name="responseMode"></param>
 /// <returns>A Service Response object, containing the collection of Characters.</returns>
 public EveServiceResponse <IEnumerable <AccountCharacter> > Characters(string keyId, string vCode,
                                                                        ResponseMode responseMode = ResponseMode.Normal)
 {
     Guard.Ensure(!keyId.IsNullOrWhiteSpace());
     Guard.Ensure(!vCode.IsNullOrWhiteSpace());
     return(RunAsyncMethod(CharactersAsync, keyId, vCode, responseMode));
 }
Example #2
0
 private void cmbResponseMode_SelectedIndexChanged(object sender, EventArgs e)
 {
     #region codes ========================================
     if (m_bOpen)
     {
         ResponseMode responseMode = ResponseMode.UNKNOWN;
         if (cmbResponseMode.SelectedIndex == 0)
         {
             responseMode = ResponseMode.COMPACT;
         }
         else
         {
             responseMode = ResponseMode.NORMAL;
         }
         Result nRet = R1000Reader.RFIDSetResponseMode(responseMode);
         if (nRet == Result.OK)
         {
             ErrorMessage(0, 0, "Set Response Mode OK");
         }
         else
         {
             ErrorMessage(0, 0, "Set Response Mode Failure");
         }
     }
     #endregion //end codes
 }
Example #3
0
        public JsonResult SaveUserCommonOpinions(SF_UserCommonOpinions addUserOpinion, SF_UserCommonOpinions deleteUserOpinion)
        {
            var response = new ResponseMode()
            {
                message = KStarForm_Prompt.SaveDraftSuccessfully
            };
            var add = true;
            var del = true;

            if (addUserOpinion != null)
            {
                addUserOpinion.Id       = Guid.NewGuid();
                addUserOpinion.UserId   = this.CurrentUser.SysId;
                addUserOpinion.CreateBy = this.CurrentUser.LoginAccount;
                add = _userCommonOpinionService.AddUserCommonOpinion(addUserOpinion);
            }

            if (deleteUserOpinion != null && deleteUserOpinion.Id != Guid.Empty)
            {
                deleteUserOpinion.ModifiedBy = this.CurrentUser.LoginAccount;
                del = _userCommonOpinionService.DeleteUserCommonOpinion(deleteUserOpinion);
            }

            if (!add && !del)
            {
                response.code    = 999;
                response.message = KStarForm_Prompt.SaveDraftFailure;
            }

            response.data = addUserOpinion;
            return(Json(response, JsonRequestBehavior.AllowGet));
        }
Example #4
0
        /// <summary>
        /// 获取申请人岗位组织公司信息
        /// </summary>
        /// <param name="userAccount"></param>
        /// <returns></returns>
        public JsonResult GetUserPostionOrgInfo(string userAccount, string processCode)
        {
            var        cultureName   = string.Empty;
            HttpCookie cultureCookie = Request.Cookies["_culture"];

            if (cultureCookie != null)
            {
                cultureName = cultureCookie.Value;
            }
            else
            {
                cultureName = Request.UserLanguages != null && Request.UserLanguages.Length > 0 ? Request.UserLanguages[0] : null;
            }

            //审批人默认岗位列表
            var list = _userService.GetStartUserPostionOrgInfo(userAccount, processCode, cultureName);
            //审批人默认岗位
            var result = _organizationService.GetUserDefaultPostionOrgInfo(userAccount, processCode);

            var response = new ResponseMode()
            {
                message = KStarForm_Prompt.GetSuccessfully
            };

            response.data = new { list = list, positionOrg = result.PositionOrg, company = result.Company };
            if (list == null)
            {
                response.code    = 999;
                response.message = KStarForm_Prompt.GetFailure;
            }
            return(Json(response));
        }
Example #5
0
 public EveServiceResponse <ApiKeyInfo> ApiKeyInfo(string keyId, string vCode,
                                                   ResponseMode responseMode = ResponseMode.Normal)
 {
     Guard.Ensure(!keyId.IsNullOrWhiteSpace());
     Guard.Ensure(!vCode.IsNullOrWhiteSpace());
     return(RunAsyncMethod(ApiKeyInfoAsync, keyId, vCode, responseMode));
 }
        public JsonResult CancelSubscribe(string jsonData)
        {
            KStarFormModel formModel = null;


            var response = new ResponseMode()
            {
                message = KStarForm_Prompt.CancelSubscribeSuccessfully
            };

            formModel = JsonConvert.DeserializeObject <KStarFormModel>(jsonData, new JsonSerializerSettings
            {
                DateTimeZoneHandling = DateTimeZoneHandling.Local
            });
            formModel.UserAgent = HttpContext.Request.UserAgent;
            formModel.ViewUrl   = Request.UrlReferrer.LocalPath;
            var result = kStarFormHandleService.CancelSubscribe(formModel);

            if (!result.IsSuccess)
            {
                response.code    = 998;
                response.message = KStarForm_Prompt.CancelSubscribeFailure;
            }
            return(Json(response));
        }
Example #7
0
        /// <summary>Converts an array of character Ids into names</summary>
        /// <param name="ids"></param>
        /// <param name="responseMode">The response Mode.</param>
        /// <returns>The response object.</returns>
        public EveServiceResponse <IEnumerable <CharacterName> > CharacterName(IEnumerable <long> ids,
                                                                               ResponseMode responseMode = ResponseMode.Normal)
        {
            Task <EveServiceResponse <IEnumerable <CharacterName> > > task = CharacterNameAsync(ids, responseMode);

            task.Wait();
            return(task.Result);
        }
 public void OutputResponseMode(ResponseMode valueSet)
 {
     OutputStatusMessage(string.Format("Values in {0}", valueSet.GetType()));
     foreach (var value in Enum.GetValues(typeof(ResponseMode)))
     {
         OutputStatusMessage(value.ToString());
     }
 }
Example #9
0
        /// <summary>The character info.</summary>
        /// <param name="characterId">The character id.</param>
        /// <param name="responseMode">The response Mode.</param>
        /// <returns></returns>
        public EveServiceResponse <CharacterInfo> CharacterInfo(int characterId,
                                                                ResponseMode responseMode = ResponseMode.Normal)
        {
            Task <EveServiceResponse <CharacterInfo> > task = CharacterInfoAsync(characterId, responseMode);

            task.Wait();
            return(task.Result);
        }
Example #10
0
        public EveServiceResponse <Account> AccountStatus(string keyId, string vCode,
                                                          ResponseMode responseMode = ResponseMode.Normal)
        {
            Guard.Ensure(!keyId.IsNullOrWhiteSpace());
            Guard.Ensure(!vCode.IsNullOrWhiteSpace());

            return(RunAsyncMethod(AccountStatusAsync, keyId, vCode, responseMode));
        }
Example #11
0
        /// <summary>The character id.</summary>
        /// <param name="names">The names.</param>
        /// <param name="responseMode">The response Mode.</param>
        /// <returns></returns>
        public EveServiceResponse <IEnumerable <CharacterName> > CharacterId(IEnumerable <string> names,
                                                                             ResponseMode responseMode = ResponseMode.Normal)
        {
            Task <EveServiceResponse <IEnumerable <CharacterName> > > task = CharacterIdAsync(names, responseMode);

            task.Wait();
            return(task.Result);
        }
Example #12
0
        /// <summary>
        ///     Gets the status of an account user.
        /// </summary>
        /// <param name="keyId">API Key ID to query</param>
        /// <param name="vCode">The Verification Code for this ID</param>
        /// <param name="responseMode"></param>
        /// <returns>An account object</returns>
        public Task <EveServiceResponse <Account> > AccountStatusAsync(string keyId, string vCode,
                                                                       ResponseMode responseMode = ResponseMode.Normal)
        {
            Guard.Ensure(!keyId.IsNullOrWhiteSpace());
            Guard.Ensure(!vCode.IsNullOrWhiteSpace());

            string cacheKey = AccountStatusCacheKeyFormat.FormatInvariant(keyId);

            return(GetServiceResponseAsync(keyId, vCode, 0, AccountStatusPath, null, cacheKey,
                                           ApiConstants.SixtyMinuteCache, responseMode, ParseAccountXml));
        }
Example #13
0
        // GetBulkUploadUrl helper method calls the GetBulkUploadUrl service operation
        // to request the upload identifier and upload Url via GetBulkUploadUrlResponse.
        private async Task <GetBulkUploadUrlResponse> GetBulkUploadUrl(ResponseMode responseMode, long accountId)
        {
            var request = new GetBulkUploadUrlRequest
            {
                ResponseMode = responseMode,
                AccountId    = accountId
            };

            return(await Service.CallAsync(
                       (s, r) => s.GetBulkUploadUrlAsync(r), request));
        }
Example #14
0
        public Task <EveServiceResponse <ApiKeyInfo> > ApiKeyInfoAsync(string keyId, string vCode,
                                                                       ResponseMode responseMode = ResponseMode.Normal)
        {
            Guard.Ensure(!keyId.IsNullOrWhiteSpace());
            Guard.Ensure(!vCode.IsNullOrWhiteSpace());

            string cacheKey = ApiKeyInfoCacheKeyFormat.FormatInvariant(keyId);

            return(GetServiceResponseAsync(keyId, vCode, 0, ApiKeyInfoPath, null, cacheKey, ApiConstants.FiveMinuteCache,
                                           responseMode, ParseApiKeyInfoXml));
        }
Example #15
0
        public Task <EveServiceResponse <ServerStatus> > ServerStatusAsync(ResponseMode responseMode = ResponseMode.Normal)
        {
            const string MethodPath     = "{0}/ServerStatus.xml.aspx";
            const string CacheKeyFormat = "ServerStatus";

            string cacheKey = CacheKeyFormat.FormatInvariant();

            IDictionary <string, string> apiParams = new Dictionary <string, string>();

            return(GetServiceResponseAsync(null, null, 0, MethodPath.FormatInvariant(RequestPrefix), apiParams, cacheKey,
                                           ApiConstants.SixtyMinuteCache, responseMode, ParseServerStatusResponse));
        }
Example #16
0
        public Task<EveServiceResponse<ServerStatus>> ServerStatusAsync(ResponseMode responseMode = ResponseMode.Normal)
        {
            const string MethodPath = "{0}/ServerStatus.xml.aspx";
            const string CacheKeyFormat = "ServerStatus";

            string cacheKey = CacheKeyFormat.FormatInvariant();

            IDictionary<string, string> apiParams = new Dictionary<string, string>();

            return GetServiceResponseAsync(null, null, 0, MethodPath.FormatInvariant(RequestPrefix), apiParams, cacheKey,
                ApiConstants.SixtyMinuteCache, responseMode, ParseServerStatusResponse);
        }
Example #17
0
        /// <summary>The conquerable station list async.</summary>
        /// <param name="responseMode">The response mode.</param>
        /// <returns>The <see cref="Task" />.</returns>
        public Task <EveServiceResponse <IEnumerable <ConquerableStation> > > ConquerableStationListAsync(
            ResponseMode responseMode = ResponseMode.Normal)
        {
            const string MethodPath     = "{0}/ConquerableStationList.xml.aspx";
            const string CacheKeyFormat = "ConquerableStationList";

            string cacheKey = CacheKeyFormat.FormatInvariant();

            IDictionary <string, string> apiParams = new Dictionary <string, string>();

            return(GetServiceResponseAsync(null, null, 0, MethodPath.FormatInvariant(RequestPrefix), apiParams, cacheKey,
                                           ApiConstants.SixtyMinuteCache, responseMode, ParseConquerableStationListResponse));
        }
Example #18
0
        /// <summary>Retrieves the Character Sheet data from the Eve web service.</summary>
        /// <param name="keyId">API Key ID to query</param>
        /// <param name="vCode">The Verification Code for this ID</param>
        /// <param name="characterId">Character to query.</param>
        /// <param name="responseMode">The response Mode.</param>
        /// <returns>The given character's data.</returns>
        public Task <EveServiceResponse <CharacterData> > CharacterSheetAsync(string keyId, string vCode, long characterId,
                                                                              ResponseMode responseMode = ResponseMode.Normal)
        {
            Guard.Ensure(!keyId.IsNullOrWhiteSpace());
            Guard.Ensure(!vCode.IsNullOrWhiteSpace());
            Guard.Ensure(characterId > 0);

            const string MethodPath     = "/char/CharacterSheet.xml.aspx";
            const string CacheKeyFormat = "CharacterSheet{0}_{1}";

            string cacheKey = CacheKeyFormat.FormatInvariant(keyId, characterId);

            return(GetServiceResponseAsync(keyId, vCode, characterId, MethodPath.FormatInvariant(PathPrefix), null,
                                           cacheKey, ApiConstants.SixtyMinuteCache, responseMode, ParseCharacterSheetResponse));
        }
Example #19
0
        /// <summary>The character info async.</summary>
        /// <param name="characterId">The character id.</param>
        /// <param name="responseMode">The response Mode.</param>
        /// <returns>The <see cref="Task" />.</returns>
        public Task <EveServiceResponse <CharacterInfo> > CharacterInfoAsync(int characterId,
                                                                             ResponseMode responseMode = ResponseMode.Normal)
        {
            Guard.Ensure(characterId > 0);
            const string MethodPath     = "{0}/CharacterInfo.xml.aspx";
            const string CacheKeyFormat = "Eve_CharacterInfo{0}";

            string cacheKey = CacheKeyFormat.FormatInvariant(characterId);
            IDictionary <string, string> apiParams = new Dictionary <string, string>();

            apiParams.Add(ApiConstants.CharacterId, characterId.ToInvariantString());

            return(GetServiceResponseAsync(null, null, 0, MethodPath.FormatInvariant(RequestPrefix), apiParams, cacheKey,
                                           ApiConstants.SixtyMinuteCache, responseMode, ParseCharacterInfoResult));
        }
        public JsonResult ApiSubmit(string jsonData)
        {
            KStarFormModel formModel = null;
            var            response  = new ResponseMode()
            {
                message = "提交成功"
            };

            try
            {
                QueryMode queryMode = new QueryMode()
                {
                    K2Id = this.GetK2ID()
                };
                var workMode = this.GetWorkMode(queryMode);

                formModel = JsonConvert.DeserializeObject <KStarFormModel>(jsonData, new JsonSerializerSettings
                {
                    DateTimeZoneHandling = DateTimeZoneHandling.Local
                });
                if (workMode == WorkMode.PreStartup)
                {
                    //预发起模式校验K2ID重复提交
                    var formInstance = _kStarFormStorageService.GetPrcServer_FormInstanceByFolio(queryMode.K2Id);
                    if (formInstance != null)
                    {
                        //表单状态为已提交,请勿重复提交!
                        throw new KStarCustomException(KStarForm_Prompt.FormIDRepeatSubmit);
                    }
                }

                formModel.UserAgent = HttpContext.Request.UserAgent;
                var result = kStarFormHandleService.Submit(formModel);
                if (!result.IsSuccess)
                {
                    response.code    = 998;
                    response.message = KStarForm_Prompt.SubmitFailure;
                }

                response.data = (result.IsSuccess, result.FormInstance.Id, result.FormInstance.Folio);
            }
            catch (Exception ex)
            {
                throw new KStarCustomException(ex.Message);
            }

            return(Json(response));
        }
Example #21
0
        /// <summary>
        /// 前端加载申请人列表数据
        /// </summary>
        /// <param name="userAccount"></param>
        /// <param name="appUserAccount"></param>
        /// <param name="processCode"></param>
        /// <returns></returns>
        public JsonResult GetApplicationUserList(string userAccount, string appUserAccount, string processCode)
        {
            List <MD_User> applicationUserList = _processDelegation.GetDelegationUserList(userAccount, processCode, 1, appUserAccount);

            var response = new ResponseMode()
            {
                message = KStarForm_Prompt.GetSuccessfully
            };

            response.data = applicationUserList;
            if (applicationUserList == null)
            {
                response.code    = 999;
                response.message = KStarForm_Prompt.GetFailure;
            }
            return(Json(response));
        }
Example #22
0
        private void btnRefresh_Click(object sender, EventArgs e)
        {
            #region codes ========================================
            if (m_bOpen)
            {
                //Response Mode
                ResponseMode responseMode = ResponseMode.UNKNOWN;
                R1000Reader.RFIDGetResponseMode(ref responseMode);
                if (responseMode == ResponseMode.COMPACT)
                {
                    cmbResponseMode.SelectedIndex = 0;
                }
                else
                {
                    cmbResponseMode.SelectedIndex = 1;
                }

                //Operation Mode
                RadioOperationMode operationMode = RadioOperationMode.UNKNOWN;
                operationMode = R1000Reader.RFIDGetOperationMode();
                if (operationMode == RadioOperationMode.CONTINUOUS)
                {
                    cmbOperationMode.SelectedIndex = 0;
                    m_bContinue = true;
                }
                else
                {
                    cmbOperationMode.SelectedIndex = 1;
                    m_bContinue = false;
                }

                //tag stop count
                numTagStopCount.Value = R1000Reader.RFIDGetStopCount();

                AntennaPortConfig antPortConfig = new AntennaPortConfig();
                R1000Reader.RFIDGetAntennaPortConfiguration(0, ref antPortConfig);
                txtdwelltime.Text   = antPortConfig.dwellTime.ToString();
                txtInvRounds.Text   = antPortConfig.numberInventoryCycles.ToString();
                traPowerLevel.Value = (int)antPortConfig.powerLevel / 10;
                lbldBm.Text         = traPowerLevel.Value.ToString() + "dBm";

                ErrorMessage(0, 0, "Config Refreshed");
            }
            #endregion //end codes
        }
Example #23
0
        /// <summary>
        /// This method uses the Dapper Library to get multiple result sets from SQL Server and return it in a single Base Class Object so that one method is all what is required.
        /// </summary>
        /// <param name="StoredProcedure">The Stored Procedure Name</param>
        /// <param name="Mode">The types of responses from a dapper SqlMapper.QueryMultiple query</param>
        /// <param name="paramList">The paramwithvalues class array</param>
        /// <returns></returns>
        public static IEnumerable <MainResponseObject> DapperRepo(string StoredProcedure,
                                                                  ResponseMode Mode,
                                                                  params paramWithValues[] paramList)
        {
            // This is SQL Connection only, do not mess with it
            SqlConnection con;
            string        constr = ConfigurationManager.ConnectionStrings[theConString].ToString();

            con = new SqlConnection(constr);
            con.Open();

            // These are argument related only
            DynamicParameters args = new DynamicParameters(new { });
            int    result          = 0;
            string message         = "";

            // Take all from paramWithValues list and turn in to Dapper Arguments
            foreach (paramWithValues item in paramList)
            {
                args.Add(item.param, item.value, item.dbType, item.paramDirection);
            }
            args.Add("@result", result, DbType.Int32, ParameterDirection.Output);
            args.Add("@message", message, DbType.String, ParameterDirection.Output);

            var objDetails = SqlMapper.QueryMultiple(con, StoredProcedure, param: args, commandType: CommandType.StoredProcedure);

            MainResponseObject ObjMaster = new MainResponseObject();

            // This will switch and call the appropriate function
            // The Mode object will identify which function to call and a return type of an inherited class of MainResponseObject is set
            switch (Mode)
            {
            default:
                break;
            }

            ObjMaster.Response = GetResponseObject(args).ToList();

            List <MainResponseObject> MainResponseObject = new List <MainResponseObject>();

            MainResponseObject.Add(ObjMaster);
            con.Close();

            return(MainResponseObject);
        }
Example #24
0
        /// <summary>Calls the CalendarEventAttendees method on the Eve web service.</summary>
        /// <param name="keyId">API Key ID to query</param>
        /// <param name="vCode">The Verification Code for this ID</param>
        /// <param name="characterId">Character to query.</param>
        /// <param name="eventId">The eventID to query</param>
        /// <param name="responseMode"></param>
        /// <returns>A collection of attendees for the event.</returns>
        public Task<EveServiceResponse<IEnumerable<CalendarEventAttendee>>> CalendarEventAttendees(string keyId,
            string vCode, int characterId, int eventId, ResponseMode responseMode = ResponseMode.Normal)
        {
            Guard.Ensure(!keyId.IsNullOrWhiteSpace());
            Guard.Ensure(!vCode.IsNullOrWhiteSpace());
            Guard.Ensure(characterId > 0);

            const string MethodPath = "{0}/CalendarEventAttendees.xml.aspx";
            const string CacheKeyFormat = "Calendar_EventAttendees{0}_{1}_{2}";

            string cacheKey = CacheKeyFormat.FormatInvariant(keyId, characterId, eventId);

            IDictionary<string, string> apiParams = new Dictionary<string, string>();
            apiParams[ApiConstants.EventId] = eventId.ToInvariantString();

            return GetServiceResponseAsync(keyId, vCode, characterId, MethodPath.FormatInvariant(PathPrefix), apiParams,
                cacheKey, ApiConstants.SixtyMinuteCache, responseMode, ParseCalendarEventAttendeesResponse);
        }
Example #25
0
        /// <summary>
        /// 获取用户常用语
        /// </summary>
        /// <param name="userAccount"></param>
        /// <returns></returns>
        public JsonResult GetUserCommonOpinions()
        {
            var userCommonOpinionList = _userCommonOpinionService.GetUserCommonOpinions(this.CurrentUser.SysId);

            var response = new ResponseMode()
            {
                message = KStarForm_Prompt.GetSuccessfully
            };

            response.data = userCommonOpinionList;
            if (userCommonOpinionList.Count == 0)
            {
                response.code    = 999;
                response.message = KStarForm_Prompt.GetFailure;
            }

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
Example #26
0
        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <param name="userAccount"></param>
        /// <returns></returns>
        public JsonResult GetUserInfo(string userAccount)
        {
            var userInfo = _userService.GetUserInfo(userAccount);

            var response = new ResponseMode()
            {
                message = KStarForm_Prompt.GetSuccessfully
            };

            response.data = userInfo;
            if (userInfo == null)
            {
                response.code    = 999;
                response.message = KStarForm_Prompt.GetFailure;
            }

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
Example #27
0
        /// <summary>
        /// 获取当前处理人
        /// 1 porttal 表单页面 流程记录-审批记录: 获取“当前处理人”使用
        /// </summary>
        /// <param name="formId"></param>
        /// <returns></returns>
        public JsonResult GetCurrApproversData(long formId)
        {
            var result = _kStarWorkFlowService.GetCurrApproversProcessing(formId);
            List <ProcPredictionDeal> procPredictionDealList = new List <ProcPredictionDeal>();
            List <string>             userNames = new List <string>();

            foreach (ProcPredictionModel item in result)
            {
                var userStr = GetApproveName(item);

                ProcPredictionDeal procPredictionDeal = new ProcPredictionDeal
                {
                    ActivityName        = item.ActivityName,
                    ActivityDisplayName = item.ActivityDisplayName,
                    Status             = item.Status,
                    Sort               = item.Sort,
                    ApprovalMode       = item.ApprovalMode,
                    StartTime          = item.StartTime,
                    Settings           = item.Settings,
                    ProcessingSource   = item.ProcessingSource,
                    ActivityID         = item.ActivityID,
                    NoneProcessing     = item.NoneProcessing,
                    SelectActivityName = item.SelectActivityName,
                    Approvers          = GetApproves(item),
                    ApproverName       = userStr.ApproveName,
                    ApproverPositions  = userStr.ApproverPositions
                };
                userNames.AddRange(procPredictionDeal.Approvers.Select(t => t.UserAccount));
                procPredictionDealList.Add(procPredictionDeal);
            }
            procPredictionDealList = SetApproversUserUserStatus(procPredictionDealList, userNames);
            var response = new ResponseMode()
            {
                message = KStarForm_Prompt.GetSuccessfully
            };

            response.data = procPredictionDealList;
            if (procPredictionDealList == null)
            {
                response.code    = 999;
                response.message = KStarForm_Prompt.GetFailure;
            }
            return(Json(response));
        }
Example #28
0
        public JsonResult GetFormContentField(long formId, string fieldName)
        {
            KStarFormData    formData    = _kStarFormStorageService.GetFormDataById(formId);
            FormContentModel formContent = formData.FormContent;
            var model = JObject.Parse(formContent.FormDataToJson);

            var response = new ResponseMode()
            {
                message = KStarForm_Prompt.GetSuccessfully
            };

            response.data = model[fieldName].ToString();
            if (model[fieldName] == null)
            {
                response.code    = 999;
                response.message = KStarForm_Prompt.GetFailure;
            }
            return(Json(response));
        }
Example #29
0
        public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
        {
            var results = new List <ValidationResult>();

            if (EnablePkce && ResponseType?.Contains(IdentityConstants.ResponseTypes.Code) != true)
            {
                results.Add(new ValidationResult($"Require '{IdentityConstants.ResponseTypes.Code}' response type with PKCE.", new[] { nameof(EnablePkce) }));
            }
            if (ResponseType?.Contains(IdentityConstants.ResponseTypes.Code) == true)
            {
                if (ClientSecret.IsNullOrEmpty())
                {
                    results.Add(new ValidationResult($"Require '{nameof(ClientSecret)}' to execute '{IdentityConstants.ResponseTypes.Code}' response type.", new[] { nameof(ClientSecret) }));
                }
            }
            if (!(ResponseMode?.Equals(IdentityConstants.ResponseModes.Query) == true || ResponseMode?.Equals(IdentityConstants.ResponseModes.FormPost) == true))
            {
                results.Add(new ValidationResult($"Invalid response mode '{ResponseMode}'. '{IdentityConstants.ResponseModes.FormPost}' and '{IdentityConstants.ResponseModes.Query}' is supported. ", new[] { nameof(ResponseMode) }));
            }
            return(results);
        }
Example #30
0
        public JsonResult ProcPrediction(string jsonData)
        {
            KStarFormModel formModel = null;

            formModel = JsonConvert.DeserializeObject <KStarFormModel>(jsonData);
            //DOTO 被曝光说有常规流程,如果节点编码是乱序的,预判的节点排序是不对的。--等待案例验证这个bug
            var result = _kStarWorkFlowService.ProcPrediction(formModel);
            List <ProcPredictionDeal> procPredictionDealList = ConvertProcPredictionDeal(result);
            var response = new ResponseMode()
            {
                message = KStarForm_Prompt.GetSuccessfully
            };

            response.data = procPredictionDealList;
            if (procPredictionDealList == null)
            {
                response.code    = 999;
                response.message = KStarForm_Prompt.GetFailure;
            }
            return(Json(response));
        }
Example #31
0
        public Task<EveServiceResponse<CorporateData>> CorporationSheetAsync(string keyId, string vCode, int corpId = 0,
            ResponseMode responseMode = ResponseMode.Normal)
        {
            Guard.Ensure(!keyId.IsNullOrWhiteSpace());
            Guard.Ensure(!vCode.IsNullOrWhiteSpace());

            const string MethodPath = "{0}/CorporationSheet.xml.aspx";
            const string CacheKeyFormat = "CorporationSheet{0}";

            string cacheKey = CacheKeyFormat.FormatInvariant(keyId,
                corpId > 0 ? "_{0}".FormatInvariant(corpId) : string.Empty);

            IDictionary<string, string> apiParams = new Dictionary<string, string>();
            if (corpId > 0)
            {
                apiParams["corporationID"] = corpId.ToInvariantString();
            }

            return GetServiceResponseAsync(keyId, vCode, 0, MethodPath.FormatInvariant(PathPrefix), apiParams, cacheKey,
                ApiConstants.SixtyMinuteCache, responseMode, ProcessCorporationSheetResponse);
        }
Example #32
0
        /// <summary>The notification texts.</summary>
        /// <param name="keyId">The key id.</param>
        /// <param name="vCode">The v code.</param>
        /// <param name="characterId">The character id.</param>
        /// <param name="notificationIds">The notification ids.</param>
        /// <param name="responseMode">The response Mode.</param>
        /// <returns>The <see cref="Task" />.</returns>
        public Task <EveServiceResponse <IEnumerable <NotificationText> > > NotificationTextsAsync(
            string keyId,
            string vCode,
            long characterId,
            IEnumerable <long> notificationIds,
            ResponseMode responseMode = ResponseMode.Normal)
        {
            Guard.Ensure(!keyId.IsNullOrWhiteSpace());
            Guard.Ensure(!vCode.IsNullOrWhiteSpace());
            Guard.Ensure(characterId > 0);

            const string MethodPath     = "{0}/NotificationTexts.xml.aspx";
            const string CacheKeyFormat = "NotificationTexts{0}_{1}_{2}";

            string cacheKey = CacheKeyFormat.FormatInvariant(keyId, characterId, notificationIds.GetHashCode());
            IDictionary <string, string> apiParams = new Dictionary <string, string>();

            apiParams[ApiConstants.Ids] = string.Join(",", notificationIds.Select(id => id.ToInvariantString()));

            return(GetServiceResponseAsync(keyId, vCode, characterId, MethodPath.FormatInvariant(PathPrefix), apiParams,
                                           cacheKey, ApiConstants.SixtyMinuteCache, responseMode, ProcessNotificationTextsResponse));
        }
Example #33
0
        public JsonResult DeleteUserCommonOpinion(SF_UserCommonOpinions delUserOpinion)
        {
            var response = new ResponseMode()
            {
                message = KStarForm_Prompt.SaveDraftSuccessfully
            };
            var del = false;

            if (delUserOpinion != null && delUserOpinion.Id != Guid.Empty)
            {
                delUserOpinion.ModifiedBy = this.CurrentUser.LoginAccount;
                del = _userCommonOpinionService.DeleteUserCommonOpinion(delUserOpinion);
            }

            if (!del)
            {
                response.code    = 999;
                response.message = KStarForm_Prompt.SaveDraftFailure;
            }

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
Example #34
0
 public EveServiceResponse<ApiKeyInfo> ApiKeyInfo(string keyId, string vCode,
     ResponseMode responseMode = ResponseMode.Normal)
 {
     Guard.Ensure(!keyId.IsNullOrWhiteSpace());
     Guard.Ensure(!vCode.IsNullOrWhiteSpace());
     return RunAsyncMethod(ApiKeyInfoAsync, keyId, vCode, responseMode);
 }
Example #35
0
 /// <summary>The kill mails</summary>
 /// <param name="keyId">API Key ID to query</param>
 /// <param name="vCode">The Verification Code for this ID</param>
 /// <param name="characterId">Character to query.</param>
 /// <param name="responseMode">The response Mode.</param>
 /// <returns></returns>
 public EveServiceResponse<IEnumerable<Entities.Killmail.KillMail>> KillMails(string keyId, string vCode, int characterId,
     ResponseMode responseMode = ResponseMode.Normal)
 {
     return RunAsyncMethod(KillMailsAsync, keyId, vCode, characterId, responseMode);
 }
Example #36
0
 public EveServiceResponse<ServerStatus> ServerStatus(ResponseMode responseMode = ResponseMode.Normal)
 {
     return RunAsyncMethod(ServerStatusAsync, responseMode);
 }
Example #37
0
        public Task<EveServiceResponse<IEnumerable<Entities.Killmail.KillMail>>> KillMailsAsync(string keyId, string vCode,
            int characterId, ResponseMode responseMode = ResponseMode.Normal)
        {
            Guard.Ensure(!keyId.IsNullOrWhiteSpace());
            Guard.Ensure(!vCode.IsNullOrWhiteSpace());
            Guard.Ensure(characterId > 0);

            const string MethodPath = "{0}/KillMails.xml.aspx";
            const string CacheKeyFormat = "{0}KillMails{1}_{2}";

            string cacheKey = CacheKeyFormat.FormatInvariant(PathPrefix, keyId, characterId);

            return GetServiceResponseAsync(keyId, vCode, characterId, MethodPath.FormatInvariant(PathPrefix), null,
                cacheKey, ApiConstants.FiveMinuteCache, responseMode, ProcessKillMailResponse);
        }
Example #38
0
        /// <summary>The wallet transactions.</summary>
        /// <param name="keyId">The key id.</param>
        /// <param name="vCode">The v code.</param>
        /// <param name="characterId">The character id.</param>
        /// <param name="accountKey"></param>
        /// <param name="fromId">The from id.</param>
        /// <param name="rowCount">The row count.</param>
        /// <param name="responseMode">The response Mode.</param>
        /// <returns>The <see cref="Task" />.</returns>
        public Task<EveServiceResponse<IEnumerable<WalletTransaction>>> WalletTransactionsAsync(
            string keyId,
            string vCode,
            int characterId,
            int accountKey,
            long? fromId = null,
            int? rowCount = null,
            ResponseMode responseMode = ResponseMode.Normal)
        {
            Guard.Ensure(!keyId.IsNullOrWhiteSpace());
            Guard.Ensure(!vCode.IsNullOrWhiteSpace());
            Guard.Ensure(characterId > 0);
            Guard.Ensure(rowCount == null || rowCount.Value > 0);

            const string MethodPath = "{0}/WalletTransactions.xml.aspx";
            const string CacheKeyFormat = "WalletTransactions{0}_{1}{2}{3}{4}";

            const string FromId = "fromID";
            const string RowCount = "rowCount";
            const string AccountKey = "accountKey";


            IDictionary<string, string> apiParams = new Dictionary<string, string>();

            apiParams[AccountKey] = accountKey.ToInvariantString();

            if (fromId != null)
            {
                apiParams[FromId] = fromId.Value.ToInvariantString();
            }

            if (rowCount != null)
            {
                apiParams[RowCount] = rowCount.Value.ToInvariantString();
            }

            string cacheKey = CacheKeyFormat.FormatInvariant(keyId, characterId, accountKey,
                fromId.HasValue ? fromId.Value.ToInvariantString() : string.Empty,
                rowCount.HasValue ? rowCount.Value.ToInvariantString() : string.Empty);

            return GetServiceResponseAsync(keyId, vCode, characterId, MethodPath.FormatInvariant(PathPrefix), apiParams,
                cacheKey, ApiConstants.SixtyMinuteCache, responseMode, ProcessWalletTransctionResponse);
        }
Example #39
0
 /// <summary>The account balance.</summary>
 /// <param name="keyId">The key id.</param>
 /// <param name="vCode">The v code.</param>
 /// <param name="characterId">The character id.</param>
 /// <param name="responseMode">The response mode.</param>
 /// <returns></returns>
 public EveServiceResponse<IEnumerable<AccountBalance>> AccountBalance(string keyId, string vCode,
     int characterId, ResponseMode responseMode = ResponseMode.Normal)
 {
     return RunAsyncMethod(AccountBalanceAsync, keyId, vCode, characterId, responseMode);
 }
Example #40
0
 /// <summary>The contract items.</summary>
 /// <param name="keyId">The key id.</param>
 /// <param name="vCode">The v code.</param>
 /// <param name="characterId">The character id.</param>
 /// <param name="contractId">The contract id.</param>
 /// <param name="responseMode">The response mode.</param>
 /// <returns></returns>
 public EveServiceResponse<IEnumerable<ContractItem>> ContractItems(string keyId, string vCode, int characterId,
     long contractId, ResponseMode responseMode = ResponseMode.Normal)
 {
     return RunAsyncMethod(ContractItemsAsync, keyId, vCode, characterId, contractId, responseMode);
 }
Example #41
0
        /// <summary>The notification texts.</summary>
        /// <param name="keyId">The key id.</param>
        /// <param name="vCode">The v code.</param>
        /// <param name="characterId">The character id.</param>
        /// <param name="notificationIds">The notification ids.</param>
        /// <param name="responseMode">The response Mode.</param>
        /// <returns>The <see cref="Task" />.</returns>
        public Task<EveServiceResponse<IEnumerable<NotificationText>>> NotificationTextsAsync(
            string keyId,
            string vCode,
            int characterId,
            IEnumerable<long> notificationIds,
            ResponseMode responseMode = ResponseMode.Normal)
        {
            Guard.Ensure(!keyId.IsNullOrWhiteSpace());
            Guard.Ensure(!vCode.IsNullOrWhiteSpace());
            Guard.Ensure(characterId > 0);

            const string MethodPath = "{0}/NotificationTexts.xml.aspx";
            const string CacheKeyFormat = "NotificationTexts{0}_{1}_{2}";

            string cacheKey = CacheKeyFormat.FormatInvariant(keyId, characterId, notificationIds.GetHashCode());
            IDictionary<string, string> apiParams = new Dictionary<string, string>();
            apiParams[ApiConstants.Ids] = string.Join(",", notificationIds.Select(id => id.ToInvariantString()));

            return GetServiceResponseAsync(keyId, vCode, characterId, MethodPath.FormatInvariant(PathPrefix), apiParams,
                cacheKey, ApiConstants.SixtyMinuteCache, responseMode, ProcessNotificationTextsResponse);
        }
Example #42
0
 /// <summary>The skill queue.</summary>
 /// <param name="keyId">The key id.</param>
 /// <param name="vCode">The v code.</param>
 /// <param name="characterId">The character id.</param>
 /// <param name="responseMode">The response Mode.</param>
 /// <returns>The <see cref="Task" />.</returns>
 public EveServiceResponse<IEnumerable<QueuedSkill>> SkillQueue(string keyId, string vCode, int characterId,
     ResponseMode responseMode = ResponseMode.Normal)
 {
     return RunAsyncMethod(SkillQueueAsync, keyId, vCode, characterId, responseMode);
 }
Example #43
0
 public EveServiceResponse<IEnumerable<Entities.Blueprint>> Blueprints(string keyId, string vCode, int characterId,
     ResponseMode responseMode = ResponseMode.Normal)
 {
     return RunAsyncMethod(BlueprintsAsync, keyId, vCode, characterId, responseMode);
 }
Example #44
0
 /// <summary>The market orders.</summary>
 /// <param name="keyId">The key id.</param>
 /// <param name="vCode">The v code.</param>
 /// <param name="characterId">The character id.</param>
 /// <param name="responseMode">The response mode.</param>
 /// <returns></returns>
 public EveServiceResponse<IEnumerable<MarketOrder>> MarketOrders(string keyId, string vCode, int characterId,
     ResponseMode responseMode = ResponseMode.Normal)
 {
     return RunAsyncMethod(MarketOrdersAsync, keyId, vCode, characterId, responseMode);
 }
Example #45
0
        /// <summary>Gets the Industry Jobs for the given user.</summary>
        /// <param name="keyId">API Key ID to query</param>
        /// <param name="vCode">The Verification Code for this ID</param>
        /// <param name="characterId">Character to query.</param>
        /// <param name="responseMode">The response Mode.</param>
        /// <returns>A collection of Industry Job data.</returns>
        public Task<EveServiceResponse<IEnumerable<IndustryJob>>> IndustryJobsAsync(string keyId, string vCode,
            int characterId, ResponseMode responseMode = ResponseMode.Normal)
        {
            Guard.Against(keyId.IsNullOrWhiteSpace());
            Guard.Against(vCode.IsNullOrWhiteSpace());
            Guard.Against(characterId <= 0);

            const string MethodPath = "{0}/IndustryJobs.xml.aspx";
            const string CacheKeyFormat = "CharacterIndustryJobs{0}_{1}";

            string cacheKey = CacheKeyFormat.FormatInvariant(keyId, characterId);

            return GetServiceResponseAsync(keyId, vCode, characterId, MethodPath.FormatInvariant(PathPrefix), null,
                cacheKey, ApiConstants.SixtyMinuteCache, responseMode, ParseIndustryJobsResponse);
        }
Example #46
0
 /// <summary>The industry jobs.</summary>
 /// <param name="keyId">The key id.</param>
 /// <param name="vCode">The v code.</param>
 /// <param name="characterId">The character id.</param>
 /// <param name="responseMode">The response mode.</param>
 /// <returns></returns>
 public EveServiceResponse<IEnumerable<IndustryJob>> IndustryJobs(string keyId, string vCode, int characterId,
     ResponseMode responseMode = ResponseMode.Normal)
 {
     return RunAsyncMethod(IndustryJobsAsync, keyId, vCode, characterId, responseMode);
 }
Example #47
0
        /// <summary>Gets the character's factional warfare statistics.</summary>
        /// <param name="keyId">API Key ID to query</param>
        /// <param name="vCode">The Verification Code for this ID</param>
        /// <param name="characterId">Character to query.</param>
        /// <param name="responseMode">The response Mode.</param>
        /// <returns>Factional warfare data.</returns>
        public Task<EveServiceResponse<FactionalWarfareStats>> FactionalWarfareStatistics(string keyId, string vCode,
            int characterId, ResponseMode responseMode = ResponseMode.Normal)
        {
            Guard.Against(keyId.IsNullOrWhiteSpace());
            Guard.Against(vCode.IsNullOrWhiteSpace());
            Guard.Against(characterId == 0);

            const string MethodPath = "{0}/FacWarStats.xml.aspx";
            const string CacheKeyFormat = "CharacterFacWarStats{0}_{1}";

            string cacheKey = CacheKeyFormat.FormatInvariant(keyId, characterId);

            return GetServiceResponseAsync(keyId, vCode, characterId, MethodPath.FormatInvariant(PathPrefix), null,
                cacheKey, ApiConstants.SixtyMinuteCache, responseMode, ParseFacWarfareResponse);
        }
Example #48
0
        /// <summary>Retrieves the list of contracts</summary>
        /// <param name="keyId">API Key ID to query</param>
        /// <param name="vCode">The Verification Code for this ID</param>
        /// <param name="characterId">Character to query.</param>
        /// <param name="contractId">Contract ID to get items for.</param>
        /// <param name="responseMode">The response Mode.</param>
        /// <returns>The <see cref="Task" />.</returns>
        public Task<EveServiceResponse<IEnumerable<ContractItem>>> ContractItemsAsync(string keyId, string vCode,
            int characterId, long contractId, ResponseMode responseMode = ResponseMode.Normal)
        {
            Guard.Against(keyId.IsNullOrWhiteSpace());
            Guard.Against(vCode.IsNullOrWhiteSpace());
            Guard.Against(characterId == 0);
            Guard.Against(contractId == 0);

            const string MethodPath = "{0}/ContractItems.xml.aspx";
            const string CacheKeyFormat = "CharacterContractItems{0}_{1}_{2}";

            string cacheKey = CacheKeyFormat.FormatInvariant(keyId, characterId, contractId);

            IDictionary<string, string> apiParams = new Dictionary<string, string>();

            const string ContractId = "contractID";
            apiParams[ContractId] = contractId.ToInvariantString();

            return GetServiceResponseAsync(keyId, vCode, characterId, MethodPath.FormatInvariant(PathPrefix), apiParams,
                cacheKey, ApiConstants.SixtyMinuteCache, responseMode, ParseContractItemResponse);
        }
Example #49
0
        public EveServiceResponse<Account> AccountStatus(string keyId, string vCode,
            ResponseMode responseMode = ResponseMode.Normal)
        {
            Guard.Ensure(!keyId.IsNullOrWhiteSpace());
            Guard.Ensure(!vCode.IsNullOrWhiteSpace());

            return RunAsyncMethod(AccountStatusAsync, keyId, vCode, responseMode);
        }
Example #50
0
 /// <summary>The wallet transactions.</summary>
 /// <param name="keyId">The key id.</param>
 /// <param name="vCode">The v code.</param>
 /// <param name="characterId">The character id.</param>
 /// <param name="accountKey">The account key.</param>
 /// <param name="fromId">The from id.</param>
 /// <param name="rowCount">The row count.</param>
 /// <param name="responseMode">The response mode.</param>
 /// <returns></returns>
 public EveServiceResponse<IEnumerable<WalletTransaction>> WalletTransactions(
     string keyId,
     string vCode,
     int characterId,
     int accountKey,
     long? fromId = null,
     int? rowCount = null,
     ResponseMode responseMode = ResponseMode.Normal)
 {
     return RunAsyncMethod(WalletTransactionsAsync, keyId, vCode, characterId, accountKey, fromId, rowCount,
         responseMode);
 }
Example #51
0
 /// <summary>The npc standings.</summary>
 /// <param name="keyId">The key id.</param>
 /// <param name="vCode">The v code.</param>
 /// <param name="characterId">The character id.</param>
 /// <param name="responseMode">The response mode.</param>
 /// <returns></returns>
 public EveServiceResponse<IEnumerable<NpcStanding>> NPCStandings(string keyId, string vCode, int characterId,
     ResponseMode responseMode = ResponseMode.Normal)
 {
     return RunAsyncMethod(NPCStandingsAsync, keyId, vCode, characterId, responseMode);
 }
Example #52
0
 /// <summary>
 ///     Gets the list of characters on the given account.
 /// </summary>
 /// <param name="keyId">API Key ID to query</param>
 /// <param name="vCode">The Verification Code for this ID</param>
 /// <param name="responseMode"></param>
 /// <returns>A Service Response object, containing the collection of Characters.</returns>
 public EveServiceResponse<IEnumerable<AccountCharacter>> Characters(string keyId, string vCode,
     ResponseMode responseMode = ResponseMode.Normal)
 {
     Guard.Ensure(!keyId.IsNullOrWhiteSpace());
     Guard.Ensure(!vCode.IsNullOrWhiteSpace());
     return RunAsyncMethod(CharactersAsync, keyId, vCode, responseMode);
 }
Example #53
0
 /// <summary>The notification texts.</summary>
 /// <param name="keyId">The key id.</param>
 /// <param name="vCode">The v code.</param>
 /// <param name="characterId">The character id.</param>
 /// <param name="notificationIds">The notification ids.</param>
 /// <param name="responseMode">The response mode.</param>
 /// <returns></returns>
 public EveServiceResponse<IEnumerable<NotificationText>> NotificationTexts(string keyId, string vCode,
     int characterId, IEnumerable<long> notificationIds, ResponseMode responseMode = ResponseMode.Normal)
 {
     return RunAsyncMethod(NotificationTextsAsync, keyId, vCode, characterId, notificationIds, responseMode);
 }
Example #54
0
        /// <summary>The standings.</summary>
        /// <param name="keyId">The key id.</param>
        /// <param name="vCode">The v code.</param>
        /// <param name="characterId">The character id.</param>
        /// <param name="responseMode">The response Mode.</param>
        /// <returns>The <see cref="Task" />.</returns>
        public Task<EveServiceResponse<IEnumerable<NpcStanding>>> NPCStandingsAsync(string keyId, string vCode,
            int characterId, ResponseMode responseMode = ResponseMode.Normal)
        {
            Guard.Ensure(!keyId.IsNullOrWhiteSpace());
            Guard.Ensure(!vCode.IsNullOrWhiteSpace());
            Guard.Ensure(characterId > 0);

            const string MethodPath = "{0}/Standings.xml.aspx";
            const string CacheKeyFormat = "CharacterNpcStandings{0}_{1}";

            string cacheKey = CacheKeyFormat.FormatInvariant(keyId, characterId);

            return GetServiceResponseAsync(keyId, vCode, characterId, MethodPath.FormatInvariant(PathPrefix), null,
                cacheKey, ApiConstants.SixtyMinuteCache, responseMode, ProcessStandingsResponse);
        }
Example #55
0
        /// <summary>
        ///     Gets the status of an account user.
        /// </summary>
        /// <param name="keyId">API Key ID to query</param>
        /// <param name="vCode">The Verification Code for this ID</param>
        /// <param name="responseMode"></param>
        /// <returns>An account object</returns>
        public Task<EveServiceResponse<Account>> AccountStatusAsync(string keyId, string vCode,
            ResponseMode responseMode = ResponseMode.Normal)
        {
            Guard.Ensure(!keyId.IsNullOrWhiteSpace());
            Guard.Ensure(!vCode.IsNullOrWhiteSpace());

            string cacheKey = AccountStatusCacheKeyFormat.FormatInvariant(keyId);

            return GetServiceResponseAsync(keyId, vCode, 0, AccountStatusPath, null, cacheKey,
                ApiConstants.SixtyMinuteCache, responseMode, ParseAccountXml);
        }
Example #56
0
        /// <summary>Gets the balance of a character.</summary>
        /// <param name="keyId">API Key ID to query</param>
        /// <param name="vCode">The Verification Code for this ID</param>
        /// <param name="characterId">Character to query.</param>
        /// <param name="responseMode">The response Mode.</param>
        /// <returns>Account balances.</returns>
        public Task<EveServiceResponse<IEnumerable<AccountBalance>>> AccountBalanceAsync(string keyId, string vCode,
            int characterId, ResponseMode responseMode = ResponseMode.Normal)
        {
            Guard.Against(keyId.IsNullOrWhiteSpace());
            Guard.Against(vCode.IsNullOrWhiteSpace());
            Guard.Against(characterId == 0);

            const string methodPath = "{0}/AccountBalance.xml.aspx";
            const string cacheKeyFormat = "Character_AccountBalance_{0}_{1}";

            string cacheKey = cacheKeyFormat.FormatInvariant(keyId, characterId);

            return GetServiceResponseAsync(keyId, vCode, characterId, methodPath.FormatInvariant(PathPrefix), null,
                cacheKey, ApiConstants.SixtyMinuteCache, responseMode, ParseBalanceResponse);
        }
Example #57
0
        public Task<EveServiceResponse<ApiKeyInfo>> ApiKeyInfoAsync(string keyId, string vCode,
            ResponseMode responseMode = ResponseMode.Normal)
        {
            Guard.Ensure(!keyId.IsNullOrWhiteSpace());
            Guard.Ensure(!vCode.IsNullOrWhiteSpace());

            string cacheKey = ApiKeyInfoCacheKeyFormat.FormatInvariant(keyId);

            return GetServiceResponseAsync(keyId, vCode, 0, ApiKeyInfoPath, null, cacheKey, ApiConstants.FiveMinuteCache,
                responseMode, ParseApiKeyInfoXml);
        }
Example #58
0
        /// <summary>Retrieves the given character's asset list.</summary>
        /// <param name="keyId">API Key ID to query</param>
        /// <param name="vCode">The Verification Code for this ID</param>
        /// <param name="characterId">Character to query.</param>
        /// <param name="responseMode">The response Mode.</param>
        /// <returns>An enumerable collection of all items in the characters assets.</returns>
        public Task<EveServiceResponse<IEnumerable<AssetItem>>> AssetListAsync(string keyId, string vCode,
            int characterId, ResponseMode responseMode = ResponseMode.Normal)
        {
            Guard.Against(keyId.IsNullOrWhiteSpace());
            Guard.Against(vCode.IsNullOrWhiteSpace());
            Guard.Against(characterId == 0);

            const string MethodPath = "{0}/AssetList.xml.aspx";
            const string CacheKeyFormat = "Character_AssetList_{0}_{1}";

            string cacheKey = CacheKeyFormat.FormatInvariant(keyId, characterId);

            return GetServiceResponseAsync(keyId, vCode, characterId, MethodPath.FormatInvariant(PathPrefix), null,
                cacheKey, ApiConstants.SixHourCache, responseMode, ParseAssetListResponse);
        }
Example #59
0
        /// <summary>
        ///     Gets the list of characters on the given account.
        /// </summary>
        /// <param name="keyId">API Key ID to query</param>
        /// <param name="vCode">The Verification Code for this ID</param>
        /// <param name="responseMode"></param>
        /// <returns>A Service Response object, containing the collection of Characters.</returns>
        public Task<EveServiceResponse<IEnumerable<AccountCharacter>>> CharactersAsync(string keyId, string vCode,
            ResponseMode responseMode = ResponseMode.Normal)
        {
            Guard.Ensure(!keyId.IsNullOrWhiteSpace());
            Guard.Ensure(!vCode.IsNullOrWhiteSpace());

            string cacheKey = CharacterCacheKeyFormat.FormatInvariant(keyId);

            return GetServiceResponseAsync(keyId, vCode, 0, CharactersPath, null, cacheKey,
                ApiConstants.SixtyMinuteCache, responseMode, ParseCharactersXml);
        }
Example #60
0
 /// <summary>The contact list.</summary>
 /// <param name="keyId">The key id.</param>
 /// <param name="vCode">The v code.</param>
 /// <param name="characterId">The character id.</param>
 /// <param name="responseMode">The response mode.</param>
 /// <returns></returns>
 public EveServiceResponse<IEnumerable<Contact>> ContactList(string keyId, string vCode, int characterId,
     ResponseMode responseMode = ResponseMode.Normal)
 {
     return RunAsyncMethod(ContactListAsync, keyId, vCode, characterId, responseMode);
 }