/// <summary> /// /// </summary> /// <param name="apiBaseUrl"></param> /// <param name="primarySubscriptionKey"></param> /// <param name="secondarySubscriptionKey"></param> public FantasySoccerClient(string primarySubscriptionKey, string secondarySubscriptionKey) { Uri statApiBaseUrl = SoccerConfig.StateApiBaseUrl; Uri scoreApiBaseUrl = SoccerConfig.ScoreApiBaseUrl; Uri ProjectionApiBaseUrl = SoccerConfig.ProjectionApiBaseUrl; AreaServices = new AreaServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey); CompetitionServices = new CompetitionServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey); SeasonServices = new SeasonServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey); BoxScoreServices = new BoxScoreService(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey); GameServices = new GameServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey); MembershipServices = new MembershipServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey); PlayerGameStatServices = new PlayerGameStatServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey); PlayerSeasonStatServices = new PlayerSeasonStatServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey); PlayerServices = new PlayerServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey); ScheduleServices = new ScheduleServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey); SeasonServices = new SeasonServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey); StandingServices = new StandingServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey); TeamGameServices = new TeamGameServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey); TeamSeasonService = new TeamSeasonService(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey); TeamServices = new TeamServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey); VenueServices = new VenueServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey); ProjectionServices = new ProjectionServices(ProjectionApiBaseUrl.AbsoluteUri, SoccerConfig.ProjectionPrimarySubscriptionKey, SoccerConfig.ProjectionSecondarySubscriptionKey); }
public ActionResult Edit(int id, VenueServices vs) { try { if (!ModelState.IsValid) { var viewModel = new VenueServiceViewModel { VS = vs, Venues = _context.venues.ToList(), SubCategories = _context.subCategories.ToList() }; //return View("CustomerForm", viewModel); } // TODO: Add update logic here var vsinDb = _context.VenueServices.Single(s => s.Id == vs.Id); vsinDb.SubCategoriesId = vs.SubCategoriesId; vsinDb.VenuesId = vs.VenuesId; vsinDb.ActualCostPrice = vs.ActualCostPrice; vsinDb.DiscountedPercentage = vs.DiscountedPercentage; _context.SaveChanges(); return(RedirectToAction("Index")); } catch (Exception ex) { return(View("Index")); } }
public ActionResult Create(VenueServices vs, string PostMethod) { try { if (ModelState.IsValid) { var viewModel = new VenueServiceViewModel { VS = vs, Venues = _context.venues.ToList(), SubCategories = _context.subCategories.ToList() }; } vs.ApplicationUserCreatedById = "4af95f1c-0f73-4df9-bb6d-166a07b6e5f4"; vs.ApplicationUserCreatedDate = DateTime.Now; vs.ApplicationUserLastUpdatedById = vs.ApplicationUserCreatedById; vs.ApplicationUserLastUpdatedDate = DateTime.Now; // TODO: Add insert logic here _context.VenueServices.Add(vs); _context.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
private void button3_Click(object sender, EventArgs e) { try { VenueServices catService = new VenueServices(); Venue venue = catService.GetById(id); venue.Id = id; venue.Name = textBox5.Text; venue.Place = textBox4.Text; venue.Cost = Convert.ToDouble(textBox3.Text); venue.Contact = textBox2.Text; int result = catService.update(venue); if (result > 0) { MessageBox.Show("Venue updated."); UpdateGridView(); } else { MessageBox.Show("Error"); } } catch (Exception) { MessageBox.Show("Error!"); } }
private void Customer_Book_Event_Load(object sender, EventArgs e) { VenueServices catService = new VenueServices(); var list = catService.GetAllVenues(); List <string> categoryNames = new List <string>(); foreach (var item in list) { categoryNames.Add(item.Name); } comboBox2.DataSource = categoryNames; EquipmentServices eService = new EquipmentServices(); var list1 = eService.GetAllFood(); List <string> foodName = new List <string>(); foreach (var item in list1) { foodName.Add(item.Name); } checkedListBox1.DataSource = foodName; EquipmentService eqService = new EquipmentService(); var list2 = eqService.GetAllEquipment(); List <string> eqName = new List <string>(); foreach (var item in list2) { eqName.Add(item.Name); } checkedListBox2.DataSource = eqName; }
public ActionResult Delete(int id, VenueServices vs) { try { // TODO: Add delete logic here var vsinDb = _context.VenueServices.Single(c => c.Id == vs.Id); _context.VenueServices.Remove(vsinDb); _context.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
private void button4_Click(object sender, EventArgs e) { VenueServices catService = new VenueServices(); int result = catService.delete(id); if (result > 0) { MessageBox.Show("venue deleted."); UpdateGridView(); } else { MessageBox.Show("Error"); } }
// GET: VenueServices/Create public ActionResult Create(VenueServices vs) { try { var viewModel = new VenueServiceViewModel { VS = vs, Venues = _context.venues.ToList(), SubCategories = _context.subCategories.ToList() }; return(View("Create", viewModel)); } catch (Exception ex) { return(View()); } }
/// <summary> /// /// </summary> /// <param name="apiBaseUrl"></param> /// <param name="primarySubscriptionKey"></param> /// <param name="secondarySubscriptionKey"></param> public SportDataCSGOClient(string primarySubscriptionKey, string ProjectionPrimarySubscriptionKey) { Uri scoreApiBaseUrl = CSGOConfig.ScoreApiBaseUrl; Uri statApiBaseUrl = CSGOConfig.StateApiBaseUrl; Uri ProjectionApiBaseUrl = CSGOConfig.ProjectionApiBaseUrl; AreasServices = new AreaServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey); CompetitionServices = new CompetitionServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey); GameServices = new GameServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey); MembershipServices = new MembershipServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey); PlayerServices = new PlayerServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey); SeasonServices = new SeasonServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey); ScheduleServices = new ScheduleServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey); TeamServices = new TeamServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey); VenueServices = new VenueServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey); BoxScoreServices = new BoxScoreServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey); ProjectionServices = new ProjectionServices(ProjectionApiBaseUrl.AbsoluteUri, ProjectionPrimarySubscriptionKey); }
private void button3_Click(object sender, EventArgs e) { try { if (textBox2.Text == string.Empty || textBox4.Text == string.Empty || comboBox1.Text == string.Empty || checkedListBox1.CheckedItems.Count == 0 || checkedListBox2.CheckedItems.Count == 0) { MessageBox.Show("Please Fillup All Requirements...."); } else { totalCost = 0; int g = Convert.ToInt32(textBox4.Text); VenueServices vs = new VenueServices(); var x = vs.GetByName(comboBox2.Text); totalCost += (x.Cost); EquipmentServices eq = new EquipmentServices(); foreach (string s in checkedListBox1.CheckedItems) { var y = eq.GetByName(s); totalCost += ((y.Cost) * g); food1 += s + " "; } EquipmentService es = new EquipmentService(); foreach (string s in checkedListBox2.CheckedItems) { var z = es.GetByName(s); totalCost += (z.Cost); equipment1 += s + " "; } textBox1.Text = totalCost.ToString(); InsertInto(comboBox1.Text, comboBox2.Text, dateTimePicker1.Value.ToShortDateString().ToString(), g, p, food1, equipment1, totalCost); } } catch (Exception) { MessageBox.Show("Something is Wrong!!!"); } }
private void buttonbookingstatus_Click(object sender, EventArgs e) { if (textBox2.Text == string.Empty || textBox3.Text == string.Empty || textBox4.Text == string.Empty || textBox5.Text == string.Empty) { MessageBox.Show("All required must be fillup!"); } else { VenueServices venService = new VenueServices(); int result = venService.Insert(new Venue() { Name = textBox5.Text, Place = textBox4.Text, Cost = Convert.ToDouble(textBox3.Text), Contact = textBox2.Text }); if (result > 0) { MessageBox.Show("Venue added."); UpdateGridView(); } else { MessageBox.Show("Error"); } } }
private void Customer_View_Venue_Load(object sender, EventArgs e) { VenueServices v = new VenueServices(); dataGridView1.DataSource = v.GetAllVenues(); }
private void Venue_management_Load(object sender, EventArgs e) { VenueServices venService = new VenueServices(); dataGridView1.DataSource = venService.GetAllVenues(); }
void UpdateGridView() { VenueServices catService = new VenueServices(); dataGridView1.DataSource = catService.GetAllVenues(); }