private void button4_Click(object sender, EventArgs e) { CreateMain main = new CreateMain(OrgName); main.Show(); this.Hide(); }
private void button5_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(cbxPromos.SelectedItem.ToString())) { cbxPromos.BackColor = Color.MistyRose; } else { CreateMain create = new CreateMain(cbxPromos.SelectedItem.ToString()); create.Show(); this.Hide(); } }
private void button3_Click(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(tbBrandName.Text) || lbSelectedWresters.Items.Count > 0 ) { foreach (var i in lbSelectedWresters.Items) { WrestlersEntity updateW = storeHelper.WrestlersList.FirstOrDefault(w => w.Name == i.ToString()); updateW.BrandName = tbBrandName.Text; wHelper.SaveWrestlersList(updateW); } foreach (var x in lbAllRoster.Items) { WrestlersEntity updateW = storeHelper.WrestlersList.FirstOrDefault(w => w.Name == x.ToString()); updateW.BrandName = ""; wHelper.SaveWrestlersList(updateW); } IDSetterHelper idHelper = new IDSetterHelper(); BrandsEntity newBrand = new BrandsEntity() { BrandID = idHelper.CurrentID(true, false, false, false, false, false, false), ConnOrgName = OrgName, Name = tbBrandName.Text }; bHelper.SaveBrandsList(newBrand); CreateMain main = new CreateMain(OrgName); main.Show(); this.Hide(); } else { tbBrandName.BackColor = Color.MistyRose; lbSelectedWresters.BackColor = Color.MistyRose; } }
private void button3_Click(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(tbNewName.Text) || cbxWeightClass.SelectedItem != null || cbxSpec.SelectedItem != null || cbxGenre.SelectedItem != null ) { string assocCo = ""; if (cbxAsscBrand.SelectedItem != null) { assocCo = cbxAsscBrand.SelectedItem.ToString(); } else { assocCo = ""; } TitlesEntity newTitle = new TitlesEntity() { Name = tbNewName.Text, OwnerOrgName = OrgName, BrandName = assocCo, WeightClass = cbxWeightClass.SelectedItem.ToString(), Specialization = cbxSpec.SelectedItem.ToString(), GenereType = cbxGenre.SelectedItem.ToString() }; tiHelper.SaveTitlesList(newTitle); CreateMain main = new CreateMain(OrgName); main.Show(); this.Hide(); } else { tbNewName.BackColor = Color.MistyRose; cbxWeightClass.BackColor = Color.MistyRose; cbxSpec.BackColor = Color.MistyRose; cbxGenre.BackColor = Color.MistyRose; } }
private void btnSave_Click(object sender, EventArgs e) { TeamsEntity newTeam = new TeamsEntity(); List <WrestlersEntity> wrestUpdate = new List <WrestlersEntity>(); for (int i = 0; i < lbSelected.Items.Count; i++) { switch (lbSelected.Items.Count) { case 2: newTeam = new TeamsEntity() { TeamName = tbTeamName.Text, OrgName = OrgName, BrandName = cbxAsscBrand.SelectedItem.ToString(), Wins = 0, Losses = 0, Draws = 0, MemberName1 = lbSelected.Items[0].ToString(), MemberName2 = lbSelected.Items[1].ToString() }; wrestUpdate.Add(storeHelper.WrestlersList.FirstOrDefault(w => w.Name == lbSelected.Items[0].ToString())); wrestUpdate.Add(storeHelper.WrestlersList.FirstOrDefault(w => w.Name == lbSelected.Items[1].ToString())); break; case 3: newTeam = new TeamsEntity() { TeamName = tbTeamName.Text, OrgName = OrgName, BrandName = cbxAsscBrand.SelectedItem.ToString(), Wins = 0, Losses = 0, Draws = 0, MemberName1 = lbSelected.Items[0].ToString(), MemberName2 = lbSelected.Items[1].ToString(), MemberName3 = lbSelected.Items[2].ToString() }; wrestUpdate.Add(storeHelper.WrestlersList.FirstOrDefault(w => w.Name == lbSelected.Items[0].ToString())); wrestUpdate.Add(storeHelper.WrestlersList.FirstOrDefault(w => w.Name == lbSelected.Items[1].ToString())); wrestUpdate.Add(storeHelper.WrestlersList.FirstOrDefault(w => w.Name == lbSelected.Items[2].ToString())); break; case 4: newTeam = new TeamsEntity() { TeamName = tbTeamName.Text, OrgName = OrgName, BrandName = cbxAsscBrand.SelectedItem.ToString(), Wins = 0, Losses = 0, Draws = 0, MemberName1 = lbSelected.Items[0].ToString(), MemberName2 = lbSelected.Items[1].ToString(), MemberName3 = lbSelected.Items[2].ToString(), MemberName4 = lbSelected.Items[3].ToString() }; wrestUpdate.Add(storeHelper.WrestlersList.FirstOrDefault(w => w.Name == lbSelected.Items[0].ToString())); wrestUpdate.Add(storeHelper.WrestlersList.FirstOrDefault(w => w.Name == lbSelected.Items[1].ToString())); wrestUpdate.Add(storeHelper.WrestlersList.FirstOrDefault(w => w.Name == lbSelected.Items[2].ToString())); wrestUpdate.Add(storeHelper.WrestlersList.FirstOrDefault(w => w.Name == lbSelected.Items[3].ToString())); break; default: lbSelected.BackColor = Color.MistyRose; break; } } foreach (WrestlersEntity w in wrestUpdate) { w.BrandName = cbxAsscBrand.SelectedItem.ToString(); w.TeamName = tbTeamName.Text; wHelper.SaveWrestlersList(w); } tHelper.SaveTeamsList(newTeam); CreateMain main = new CreateMain(OrgName); main.Show(); this.Hide(); }