internal static void Delete(Podium p) { VerwijderOptredensVanPodium(p); string sql = "DELETE FROM podia WHERE PodiumID = @ID"; Database.ModifyData(sql, Database.AddParameter("@ID", p.ID)); }
static ResizingTier SetupParent(ResizeParent obj, Podium parentPodium, int stackIndexFromTop) { // Check if there is at least one more parent above this ResizingTier parentItem = null; if (ResizeParent.Instance.TierHistory.Count >= stackIndexFromTop) { parentItem = ResizeParent.Instance.TierHistory[ResizeParent.Instance.TierHistory.Count - stackIndexFromTop]; } if ((parentItem != null) && (parentPodium.parentItems.Contains(parentItem) == true) && (parentPodium.ThisTier > 0)) { // Setup this new parent as well parentPodium.UpdateParentItem(obj, parentItem, ResizeParent.Instance.GrowScaleVector); // Update the parent podum's embedded elements foreach (Podium podium in ResizeParent.Instance.AllPodiumsPerTier[parentPodium.ParentTier]) { if (podium != parentPodium) { podium.UpdateEmbedItem(obj); } } } return(parentItem); }
Podium UpdateParentItem(ResizeParent obj, ResizingTier parentItem, Vector3 finalScale) { // Grab the parent podium Podium parentPodium = ResizeParent.Instance.PathToPodiumMap[new ResizeParent.TierPath(parentItem, ParentTier)]; // Reset the size of the parent item parentItem.transform.SetParent(null, true); parentItem.transform.localScale = Vector3.one; // Setup the resize helper to the proportions of the podium ResizeParent.Instance.ResizeHelper.transform.SetParent(parentPodium.itemPlacement, false); ResizeParent.Instance.ResizeHelper.transform.localPosition = Vector3.zero; ResizeParent.Instance.ResizeHelper.transform.localScale = Vector3.one; ResizeParent.Instance.ResizeHelper.transform.localRotation = Quaternion.identity; // Parent the parentTier to the resize helper ResizeParent.Instance.ResizeHelper.transform.SetParent(null, true); parentItem.transform.SetParent(ResizeParent.Instance.ResizeHelper.transform, true); // Position and resize the resize helper ResizeParent.Instance.ResizeHelper.transform.localScale = finalScale; ResizeParent.Instance.ResizeHelper.transform.position = ParentTier.transform.position; // Update the tier of this object parentItem.CurrentTier = ThisTier - 1; // De-parent parentItem.transform.SetParent(null, true); return(parentPodium); }
internal static int Update(Podium podium) { if (podium != null && podium.ID != 0) return UpdatePodium(podium); else return InsertGroep(podium); }
public vm_podium(GmmDbContext pContext) { _context = pContext; _podium = new Podium { Id = 0 }; }
public async Task <IActionResult> Edit(int id, [Bind("Id,Omschrijving")] Podium podium) { if (id != podium.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(podium); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PodiumExists(podium.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(podium)); }
private void picturePodium_Click(object sender,EventArgs e) { try { Podium.ShowPage(); } catch(Exception ex) { MessageBox.Show(ex.Message); } }
private static Podium MaakPodium(DbDataReader reader) { Podium p = new Podium(); p.ID = Convert.ToInt32(reader["PodiumID"]); p.Naam = reader["Naam"].ToString(); return p; }
public async Task <IActionResult> Create([Bind("Id,Omschrijving")] Podium podium) { if (ModelState.IsValid) { _context.Add(podium); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(podium)); }
private static int InsertGroep(Podium podium) { int id = 0; string sql = "INSERT INTO podia (Naam) VALUES (@Naam); SELECT SCOPE_IDENTITY() AS [InsertedReserveringID]"; DbDataReader reader = Database.GetData(sql , Database.AddParameter("@Naam", podium.Naam) ); if (reader.Read()) id = Convert.ToInt32(reader[0]); reader.Close(); return id; }
public static ObservableCollection<Optreden> GetOptredensVanPodium(Podium podium) { ObservableCollection<Optreden> lOptredens = new ObservableCollection<Optreden>(); string sql = "SELECT * FROM optreden WHERE PodiumID = @PID"; DbDataReader reader = Database.GetData(sql, Database.AddParameter("@PID", podium.ID)); while(reader.Read()) { lOptredens.Add(MaakOptreden(reader)); } reader.Close(); return lOptredens; }
internal static int GetAantalUrenByDatumEnPodium(Datum d, Podium p) { int aantal = 0; string sql = "SELECT COUNT(OptredenID) FROM optreden WHERE DatumID = @DatumID and PodiumID = @PodiumID"; DbDataReader reader = Database.GetData(sql, Database.AddParameter("@PodiumID", p.ID), Database.AddParameter("@DatumID", d.DatumID) ); if (reader.Read()) aantal = Convert.ToInt32(reader[0]); reader.Close(); return aantal; }
public static ObservableCollection<Uur> GetUrenThatHaveNoOptredenOfDateAndPodium(Datum d, Podium p) { ObservableCollection<Uur> lUren = new ObservableCollection<Uur>(); string sql = "SELECT uur.UurID, uur.Uur FROM uur WHERE uur.UurID NOT IN(SELECT UurID FROM optreden_uur INNER JOIN optreden ON optreden_uur.OptredenID = optreden.OptredenID WHERE optreden.DatumID = @DatumID and PodiumID = @PodiumID) ORDER BY UurID"; DbDataReader reader = Database.GetData(sql , Database.AddParameter("@DatumID", d.DatumID) , Database.AddParameter("@PodiumID", p.ID) ); while (reader.Read()) { lUren.Add(MaakUur(reader, false)); } reader.Close(); return lUren; }
private void Instance_OnBeforeResize(ResizeParent obj) { if (ResizeParent.Instance.LatestTier == ParentTier) { if (obj.currentDirection == ResizeParent.ResizeDirection.Shrinking) { if ((ThisTier - 1) == obj.CurrentTier) { // Setup one parent up ResizingTier parentItemLevel0 = SetupParent(obj, this, 2); ResizingTier parentItemLevel1 = null; if (parentItemLevel0 != null) { // Grab the next parent up Podium parentPodium = UpdateParentItem(obj, parentItemLevel0, ResizeParent.Instance.ShrinkScaleVector); // Setup the 2nd level parent parentItemLevel1 = SetupParent(obj, parentPodium, 3); } // Parent this to the resize parent if (parentItemLevel0 != null) { parentItemLevel0.transform.SetParent(obj.transform, true); } if (parentItemLevel1 != null) { parentItemLevel1.transform.SetParent(obj.transform, true); } } } else { if ((embedItem != null) && (ThisTier == obj.CurrentTier)) { // Check if this object is only one step smaller than the current tier UpdateEmbedItem(obj); } } } }
public IActionResult ProcessarCampeonato([FromBody] List <Filme> filmes) { List <Filme> FilmesFase = filmes.OrderBy(f => f.Titulo).ToList(); if (FilmesFase.Count != 8) { return(BadRequest()); } List <Filme> VencedoresFase = new List <Filme>(); while (FilmesFase.Count > 2) { for (int i = 0; i < (FilmesFase.Count() / 2); i++) { if (FilmesFase[i].Nota > FilmesFase[FilmesFase.Count() - i - 1].Nota) { VencedoresFase.Add(FilmesFase[i]); } else { VencedoresFase.Add(FilmesFase[FilmesFase.Count() - i - 1]); } } FilmesFase = VencedoresFase; VencedoresFase = new List <Filme>(); } Podium Final = new Podium() { Vencedor = FilmesFase.OrderBy(f => f.Nota).LastOrDefault(), Vice = FilmesFase.OrderBy(f => f.Nota).FirstOrDefault() }; return(Ok(Final)); }
internal static ObservableCollection<Uur> getUrenVoorLineUp(Datum datum, Podium podium) { ObservableCollection<Uur> lUren = new ObservableCollection<Uur>(); string sql = "select u.uurid, u.uur, d.datumId, d.datum, ou.optredenId, g.naam as grpnaam, g.beschrijving as grpbeschrijving, g.facebook as grpfacebook, g.twitter as grptwitter, g.groepid as groepid, g.[image] as grpimage, p.podiumid, p.naam as podiumnaam from uur u left outer join datum d on datumid = @DatumID left outer join (select o.optredenid, groepid, podiumid, datumid, uurid from optreden o inner join optreden_uur u on u.optredenid = o.optredenid and podiumid = @PodiumID) ou on ou.datumid = d.datumid and ou.uurid = u.uurid left outer join podia p on p.PodiumID = ou.PodiumID left outer join groep g on g.groepId = ou.GroepId where u.uurid >= ( select min(optreden_uur.UurID) from optreden inner join optreden_uur on optreden.OptredenID = optreden_uur.OptredenID WHERE optreden.PodiumID = @PodiumID and optreden.DatumID = @DatumID ) - 1 and u.uurid <= ( select max(optreden_uur.UurID) from optreden inner join optreden_uur on optreden.OptredenID = optreden_uur.OptredenID WHERE optreden.PodiumID = @PodiumID and optreden.DatumID = @DatumID ) + 1"; DbDataReader reader = Database.GetData(sql, Database.AddParameter("@PodiumID", podium.ID), Database.AddParameter("@DatumID", datum.DatumID) ); while (reader.Read()) { lUren.Add(MaakUurSpeciaal(reader)); } reader.Close(); return lUren; }
// Update is called once per frame void Start() { texts = new Dictionary<string, Text>(); images = new Dictionary<string, Image>(); Manager.instance.numPlayers = 0; for (int i = 0; i < 4; i++) Manager.instance.playerTanks[i] = 0; //Cache all player select data playerSelect = transform.FindChild("PlayerSelect").GetComponent<CanvasGroup>(); playerSelect.alpha = 1; playerSelect.interactable = true; playerSelect.blocksRaycasts = true; podiums = new Podium[4]; for (int i = 0; i < podiums.Length; i++) { Transform tank = playerSelect.transform.FindChild("Player" + (i + 1)); podiums[i] = new Podium(); podiums[i].state = PStates.DISABLED; podiums[i].display = tank.FindChild("Display").GetComponent<Image>(); podiums[i].display.sprite = disabledSprite; } for(int i = 0; i < 9; i++) { Transform im = playerSelect.transform.FindChild("Portraits/" + (i + 1) + "/Display"); images.Add("Character" + (i + 1) + "P1", im.parent.FindChild("P1").GetComponent<Image>()); images["Character" + (i + 1) + "P1"].enabled = false; images.Add("Character" + (i + 1) + "P2", im.parent.FindChild("P2").GetComponent<Image>()); images["Character" + (i + 1) + "P2"].enabled = false; images.Add("Character" + (i + 1) + "P3", im.parent.FindChild("P3").GetComponent<Image>()); images["Character" + (i + 1) + "P3"].enabled = false; images.Add("Character" + (i + 1) + "P4", im.parent.FindChild("P4").GetComponent<Image>()); images["Character" + (i + 1) + "P4"].enabled = false; images.Add("Character" + (i + 1) + "P1Tag", im.parent.FindChild("P1Tag").GetComponent<Image>()); images["Character" + (i + 1) + "P1Tag"].enabled = false; images.Add("Character" + (i + 1) + "P2Tag", im.parent.FindChild("P2Tag").GetComponent<Image>()); images["Character" + (i + 1) + "P2Tag"].enabled = false; images.Add("Character" + (i + 1) + "P3Tag", im.parent.FindChild("P3Tag").GetComponent<Image>()); images["Character" + (i + 1) + "P3Tag"].enabled = false; images.Add("Character" + (i + 1) + "P4Tag", im.parent.FindChild("P4Tag").GetComponent<Image>()); images["Character" + (i + 1) + "P4Tag"].enabled = false; } //Cache all scene select data if (scenes.Length != areaNames.Length) Debug.Log("There is a mismatch of artwork and arena names"); sceneSelect = transform.FindChild("SceneSelect").GetComponent<CanvasGroup>(); sceneSelect.alpha = 0; sceneSelect.interactable = false; sceneSelect.blocksRaycasts = false; texts.Add("PlayerDisplay", sceneSelect.transform.FindChild("SelectPlayer").GetComponent<Text>()); images.Add("ArenaDisplay", sceneSelect.transform.FindChild("LevelArt").GetComponent<Image>()); texts.Add("ArenaNameDisplay", sceneSelect.transform.FindChild("LevelName").GetComponent<Text>()); //Cache all match options data matchOptions = transform.FindChild("MatchOptions").GetComponent<CanvasGroup>(); matchOptions.alpha = 0; matchOptions.interactable = false; matchOptions.blocksRaycasts = false; texts.Add("GameModeText", matchOptions.transform.FindChild("GameModeText").GetComponent<Text>()); texts.Add("MatchDurationText", matchOptions.transform.FindChild("MatchDurationText").GetComponent<Text>()); texts.Add("GameModeDesc", matchOptions.transform.FindChild("GameModeDesc").GetComponent<Text>()); texts.Add("MatchDuration", matchOptions.transform.FindChild("MatchDuration/Text").GetComponent<Text>()); texts.Add("GameMode", matchOptions.transform.FindChild("GameMode/Text").GetComponent<Text>()); texts.Add("TargetScore", matchOptions.transform.FindChild("TargetScore/Text").GetComponent<Text>()); texts.Add("TargetScoreText", matchOptions.transform.FindChild("TargetScoreText").GetComponent<Text>()); texts.Add("MovementMultiplier", matchOptions.transform.FindChild("MovementMultiplier/Text").GetComponent<Text>()); texts.Add("MovementMultiplierText", matchOptions.transform.FindChild("MovementMultiplierText").GetComponent<Text>()); texts.Add("GravityScale", matchOptions.transform.FindChild("GravityScale/Text").GetComponent<Text>()); texts.Add("GravityScaleText", matchOptions.transform.FindChild("GravityScaleText").GetComponent<Text>()); loading = transform.FindChild("Loading").gameObject; loading.SetActive(false); UpdatePodiums(); UpdateSceneSelectVisual(); UpdateMatchOptionsVisual(); }
private void Awake() { _podium = FindObjectOfType <Podium>(); //anim = GetComponent<Animator>(); }
private static void VerwijderOptredensVanPodium(Podium p) { ObservableCollection<Optreden> lOptredens = OptredenRepository.GetOptredensVanPodium(p); foreach(Optreden o in lOptredens) { UrenRepository.VerwijderOptredenUurByOptreden(o); OptredenRepository.Delete(o); } }
private static int UpdatePodium(Podium podium) { string sql = "UPDATE podia SET Naam = @Naam WHERE PodiumID = @ID"; Database.ModifyData(sql , Database.AddParameter("@Naam", podium.Naam) , Database.AddParameter("@ID", podium.ID) ); return podium.ID; }
public void GetPodiumById(int pPodiumIdId) { _podium = (_context.Podia.Where(b => b.Id == pPodiumIdId).SingleOrDefault()); }