public ActionResult CreateSubmission(uint id) { List <WeenieChange> data = SandboxContentProviderHost.CurrentProvider.GetMyWeenieChanges(GetUserToken()); WeenieChange theOne = data.FirstOrDefault(wc => wc.Weenie.WeenieId == id); if (theOne != null) { theOne.Submitted = true; theOne.SubmissionTime = DateTime.Now; SandboxContentProviderHost.CurrentProvider.UpdateWeenieChange(GetUserGuid(), theOne); WeenieSubmissionEvent wse = new WeenieSubmissionEvent(); wse.SubmittingUserGuid = theOne.UserGuid; wse.ChangelogComment = theOne.Weenie.UserChangeSummary; wse.SubmittingUser = CurrentUser.DisplayName; wse.WeenieId = theOne.Weenie.WeenieId; // icon generation data for thumbnail wse.ItemType = theOne.Weenie.ItemType; wse.UnderlayId = theOne.Weenie.UnderlayId; wse.OverlayId = theOne.Weenie.OverlayId; wse.IconId = theOne.Weenie.IconId; wse.UiEffects = theOne.Weenie.UIEffects; wse.WeenieName = theOne.Weenie.Name; wse.SubmissionTime = DateTimeOffset.Now; DiscordController.PostToDiscordAsync(wse); } return(new EmptyResult()); // RedirectToAction("Sandbox"); }
public ActionResult CreateSubmission(uint id) { List <WeenieChange> data = SandboxContentProviderHost.CurrentProvider.GetMyWeenieChanges(GetUserToken()); WeenieChange theOne = data.FirstOrDefault(wc => wc.Weenie.WeenieClassId == id); if (theOne != null) { theOne.Submitted = true; SandboxContentProviderHost.CurrentProvider.UpdateWeenieChange(GetUserGuid(), theOne); WeenieSubmissionEvent wse = new WeenieSubmissionEvent(); wse.SubmittingUserGuid = theOne.UserGuid; wse.ChangelogComment = theOne.Weenie.UserChangeSummary; wse.SubmittingUser = CurrentUser.DisplayName; wse.WeenieId = theOne.Weenie.DataObjectId; wse.WeenieName = theOne.Weenie.Name; wse.SubmissionTime = DateTimeOffset.Now; DiscordController.PostToDiscordAsync(wse); } return(RedirectToAction("Sandbox")); }