コード例 #1
0
 public SuggestionInfo(SuggestionEntity suggestion, AppEntity app, int originalHltbId, string originalHltbName)
 {
     Suggestion       = suggestion;
     App              = app;
     OriginalHltbId   = originalHltbId;
     OriginalHltbName = originalHltbName;
 }
コード例 #2
0
        private static async Task AcceptSuggestionInternal([NotNull] AppEntity app, [NotNull] SuggestionEntity suggestion, int retries)
        {
            var batchOperation = new TableBatchOperation
            {
                TableOperation.Delete(suggestion),
                TableOperation.InsertOrReplace(new ProcessedSuggestionEntity(suggestion))
            };

            if (suggestion.IsRetype)
            {
                batchOperation.Delete(app);
                batchOperation.Insert(new AppEntity(app.SteamAppId, app.SteamName, suggestion.AppType));
            }
            else
            {
                batchOperation.Replace(app);
            }

            var table = await GetTable(SteamToHltbTableName, retries).ConfigureAwait(false);

            CommonEventSource.Log.AcceptSuggestionStart(suggestion.SteamAppId, suggestion.HltbId);
            await table.ExecuteBatchAsync(batchOperation).ConfigureAwait(false);

            CommonEventSource.Log.AcceptSuggestionStop(suggestion.SteamAppId, suggestion.HltbId);
        }
コード例 #3
0
        public static Task DeleteSuggestion([NotNull] SuggestionEntity suggestion, AppEntity app = null, int retries = -1)
        {
            if (suggestion == null)
            {
                throw new ArgumentNullException(nameof(suggestion));
            }

            return(DeleteSuggestionInternal(suggestion, app, retries));
        }
コード例 #4
0
        private static async Task InsertSuggestionInternal(SuggestionEntity suggestion, int retries)
        {
            var table = await GetTable(SteamToHltbTableName, retries).ConfigureAwait(false);

            CommonEventSource.Log.InsertSuggestionStart(suggestion.SteamAppId, suggestion.HltbId);
            await table.ExecuteAsync(TableOperation.InsertOrReplace(suggestion)).ConfigureAwait(false);

            CommonEventSource.Log.InsertSuggestionStop(suggestion.SteamAppId, suggestion.HltbId);
        }
コード例 #5
0
        public static Task InsertSuggestion(SuggestionEntity suggestion, int retries = -1)
        {
            if (suggestion == null)
            {
                throw new ArgumentNullException(nameof(suggestion));
            }

            return(InsertSuggestionInternal(suggestion, retries));
        }
コード例 #6
0
    protected void btnSaveSuggestion_Click(object sender, EventArgs e)
    {
        SuggestionEntity Result = GetSuggestionUI();

        m_Suggestion.SaveSuggestion(Result);
        ShowMessage("数据保存成功!");
        //int Succeed = m_Suggestion.SaveSuggestion(Result);
        //if (Succeed > 0) ShowMessage("数据保存成功!");
        //if (Succeed < 0) ShowMessage("数据保存失败!");
        DataBind();
        SetUIState("Default");
    }
コード例 #7
0
    /// <summary>
    /// 从界面获取对象
    /// </summary>
    /// <returns></returns>
    private SuggestionEntity GetSuggestionUI()
    {
        SuggestionEntity Result = new SuggestionEntity();

        Result.SNo        = SNo;
        Result.Name       = txtName.Text;
        Result.KeyWord    = txtKeyWord.Text;
        Result.DeptID     = EnvConverter.ToInt32(hDeptID.Value);
        Result.Suggestion = txtSuggestion.Text;
        Result.Explain    = txtExplain.Text;
        //Result.DisplayOrder = EnvConverter.ToInt32(txtDisplayOrder.Text);
        return(Result);
    }
コード例 #8
0
        //assumes app has been already modified to contain the updated HLTB info
        public static Task AcceptSuggestion([NotNull] AppEntity app, [NotNull] SuggestionEntity suggestion, int retries = -1)
        {
            if (app == null)
            {
                throw new ArgumentNullException(nameof(app));
            }
            if (suggestion == null)
            {
                throw new ArgumentNullException(nameof(suggestion));
            }

            return(AcceptSuggestionInternal(app, suggestion, retries));
        }
コード例 #9
0
        private static async Task DeleteSuggestionInternal([NotNull] SuggestionEntity suggestion, AppEntity app, int retries)
        {
            var batchOperation = new TableBatchOperation
            {
                TableOperation.Delete(suggestion),
                TableOperation.InsertOrReplace(new ProcessedSuggestionEntity(suggestion))
            };

            if (app != null) //this means we want to update the app to be a verified game and stop future non-game suggestions
            {
                app.VerifiedGame = true;
                batchOperation.Replace(app);
            }

            var table = await GetTable(SteamToHltbTableName, retries).ConfigureAwait(false);

            CommonEventSource.Log.DeleteSuggestionStart(suggestion.SteamAppId, suggestion.HltbId);
            await table.ExecuteBatchAsync(batchOperation).ConfigureAwait(false);

            CommonEventSource.Log.DeleteSuggestionStop(suggestion.SteamAppId, suggestion.HltbId);
        }
コード例 #10
0
 /// <summary>
 /// 删除体检建议数据
 /// </summary>
 /// <param name="Suggestion">体检建议实体</param>
 public void DeleteSuggestion(SuggestionEntity Suggestion)
 {
     DataAccess.DeleteSuggestion(Suggestion);
 }
コード例 #11
0
 /// <summary>
 /// 保存体检建议数据
 /// </summary>
 /// <param name="Suggestion">体检建议实体</param>
 public void SaveSuggestion(SuggestionEntity Suggestion)
 {
     DataAccess.SaveSuggestion(Suggestion);
 }
コード例 #12
0
 public static Task <ConcurrentBag <SuggestionEntity> > GetAllSuggestions(string rowFilter = null, int retries = -1)
 {
     return(GetAllSteamToHltbEntities <SuggestionEntity>(rowFilter ?? SuggestionEntity.SuggestionFilter, SuggestionEntity.GetPartitions(), retries));
 }