Beispiel #1
0
 public SuggestionInfo(SuggestionEntity suggestion, AppEntity app, int originalHltbId, string originalHltbName)
 {
     Suggestion       = suggestion;
     App              = app;
     OriginalHltbId   = originalHltbId;
     OriginalHltbName = originalHltbName;
 }
Beispiel #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);
        }
Beispiel #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));
        }
Beispiel #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);
        }
Beispiel #5
0
        public static Task InsertSuggestion(SuggestionEntity suggestion, int retries = -1)
        {
            if (suggestion == null)
            {
                throw new ArgumentNullException(nameof(suggestion));
            }

            return(InsertSuggestionInternal(suggestion, retries));
        }
Beispiel #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");
    }
Beispiel #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);
    }
Beispiel #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));
        }
Beispiel #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);
        }
Beispiel #10
0
 /// <summary>
 /// 删除体检建议数据
 /// </summary>
 /// <param name="Suggestion">体检建议实体</param>
 public void DeleteSuggestion(SuggestionEntity Suggestion)
 {
     DataAccess.DeleteSuggestion(Suggestion);
 }
Beispiel #11
0
 /// <summary>
 /// 保存体检建议数据
 /// </summary>
 /// <param name="Suggestion">体检建议实体</param>
 public void SaveSuggestion(SuggestionEntity Suggestion)
 {
     DataAccess.SaveSuggestion(Suggestion);
 }
Beispiel #12
0
 public static Task <ConcurrentBag <SuggestionEntity> > GetAllSuggestions(string rowFilter = null, int retries = -1)
 {
     return(GetAllSteamToHltbEntities <SuggestionEntity>(rowFilter ?? SuggestionEntity.SuggestionFilter, SuggestionEntity.GetPartitions(), retries));
 }