public void dele() { show log = exam; var result = log("hello"); Console.WriteLine(result); }
public List<show> byArtist(string aName) { var shows = from a in data.Artists from v in data.Venues from s in data.Shows where a.ArtistName.Equals(aName) select new { v.VenueName, s.ShowName, s.ShowDate, s.ShowTime }; List<show> aShow = new List<show>(); foreach (var entry in shows) { show info = new show(); info.venue = entry.VenueName; info.name = entry.ShowName; info.date = entry.ShowDate.ToShortDateString(); info.start = entry.ShowTime.ToString(); aShow.Add(info); } return aShow; }
public List<show> byVenue(string vName) { var shows = from s in data.Shows from v in data.Venues where v.VenueName.Equals(vName) select new { s.ShowName, s.ShowDate, s.ShowTime, v.VenueName }; List<show> vShows = new List<show>(); foreach (var entry in shows) { show info = new show(); info.name = entry.ShowName; info.date = entry.ShowDate.ToShortDateString(); info.start = entry.ShowTime.ToString(); info.venue = entry.VenueName; vShows.Add(info); } return vShows; }
public void Delete_shows(int id) { show show = db.shows.Find(id); db.shows.Remove(show); db.SaveChanges(); }
public List <show> byArtist(string aName) { var shows = from d in data.ShowDetails where d.Artist.ArtistName.Equals(aName) select new { d.Show.Venue.VenueName, d.Show.ShowName, d.Show.ShowDate, d.Show.ShowTime }; List <show> aShow = new List <show>(); foreach (var entry in shows) { show info = new show(); info.venue = entry.VenueName; info.name = entry.ShowName; info.date = entry.ShowDate.ToShortDateString(); info.start = entry.ShowTime.ToString(); aShow.Add(info); } return(aShow); }
private void display() { if (InvokeRequired) { show d = new show(display); textBox1.Invoke(d); } }
protected override void OnNavigatedTo(NavigationEventArgs e) { //... your code show s = (show)e.Parameter; // latitude = s.latitude; // comment this // longitude = s.longitude; // comment this GetRouteAndDirections((double)s.latitude, (double)s.longitude); // you might want to cast the lat and lon as double //... your code }
public static string test(string s, string ss) { Combine combine = delegate(string s1, string s2) { return(s1 + s2); }; // Remember need to include types in the delegate parameters!! show show = new show(display); // Call the delegate. show(string.Format("{0} {1}", s, ss)); return(combine(s, ss)); }
public RedirectResult Show(int?id, show i) { try { i.items_id = (int)id; show.Update(i); Flash.Set(TempData, "Yep! Updated"); } catch (Exception e) { Flash.Set(TempData, "Ay caramba, I made a mistake 😦" + e); } return(Redirect("/Detail/?id=" + item.Get((int)id))); }
public ActionResult Edit([Bind(Include = "channel_id,channel_name,show_name")] show show) { if (ModelState.IsValid) { //db.Entry(show).State = EntityState.Modified; //db.SaveChanges(); this.repository.Update_shows(show); return(RedirectToAction("Index")); } return(View(show)); }
public ActionResult Create([Bind(Include = "channel_id,channel_name,show_name")] show show) { if (ModelState.IsValid) { //db.shows.Add(show); //db.SaveChanges(); repository.Add_show(show); return(RedirectToAction("Index")); } return(View(show)); }
//管理员添加 public string addload() { string text = ""; show sh = new show(); sh.title = ""; sh.text = ""; sh.state = 0; try { sd.Insert_show(sh); } catch (Exception ex) { return ""; } text = "succ"; return text; }
public override bool StartLoad() { G.NormDoc.QUERRY() .SHOW .WHERE .ARC(C.NormDoc.Volume, C.Volume.Sample, C.Sample.YM).EQUI.BV(YM - 1) .DO(); NormDoc[] normDocs = new NormDoc[G.NormDoc.Rows.Count]; for (int i = 0; i < normDocs.Length; i++) { normDocs[i] = new NormDoc(G.NormDoc.Rows.GetID(i)); } show[] _temp = shows.ToArray(); load_sw load = new load_sw(_temp.Length, new Func <int, bool>( IndexRow => { show temp = _temp[IndexRow]; if (temp.VolumeID > 0) { if (normDocs.FirstOrDefault(x => temp.act == x.Act && temp.invoces == x.Invoces && temp.score == x.Score) == null) { MyTools.AddRowFromTable(G.NormDoc, new KeyValuePair <int, object>(C.NormDoc.Act, temp.act), new KeyValuePair <int, object>(C.NormDoc.Score, temp.score), new KeyValuePair <int, object>(C.NormDoc.Invoces, temp.invoces), new KeyValuePair <int, object>(C.NormDoc.Volume, temp.VolumeID), new KeyValuePair <int, object>(C.NormDoc.Date, temp._date), new KeyValuePair <int, object>(C.NormDoc.Summ, temp.summ), new KeyValuePair <int, object>(C.NormDoc.Resolution, PollutionBase_Class.AllResolution.First(x => x.CurtName.Contains(temp.type_calc)).ID) ); } shows.Remove(temp); } return(true); })); _progress = new Progress_Form(load); _progress.ShowDialog(); DG.ItemsSource = null; DG.ItemsSource = shows; return(true); }
public bool Insert_show(show showIns) { try { db.show.InsertOnSubmit(showIns); db.SubmitChanges(); return true; } catch (Exception e) { Console.WriteLine("{0} Insert_show exception caught." + e); return false; } }
public ActionResult Create(item i) { if (TryValidateModel(i)) { try { item.Create(i); switch (Request["category"]) { case "restaurant": var r = new restaurant() { items_id = i.id, payment_type = Request["payment_type"] }; if (TryValidateModel(r)) { restaurant.Create(r); } else { Flash.Set(TempData, "oops, wrong extras! 😬"); return(View(i)); } break; case "show": var s = new show() { items_id = i.id, datetime = DateTime.Parse(Request["datetime"]) }; if (TryValidateModel(s)) { show.Create(s); } else { Flash.Set(TempData, "oops, wrong extras! 😬"); return(View(i)); } break; case "attraction": var a = new attraction() { items_id = i.id, max_height = int.Parse(Request["max_height"]), min_height = int.Parse(Request["min_height"]) }; if (TryValidateModel(a)) { attraction.Create(a); } else { Flash.Set(TempData, "oops, wrong extras! 😬"); return(View(i)); } break; default: break; } } catch { Flash.Set(TempData, "something went wrong! 😬"); return(View(i)); } Flash.Set(TempData, "Created 🍻"); return(RedirectToAction("Index", "Detail", i.id)); } Flash.Set(TempData, "oops! 😬"); return(View(i)); }
static void Main() { Console.WriteLine("Выберите что нужно сделать?"); Console.WriteLine("- [1] добавить запись"); Console.WriteLine("- [2] удалить запись"); Console.WriteLine("- [3] редактировать"); Console.WriteLine("- [4] показать список"); Console.WriteLine("- [5] выход из программы"); int i = Convert.ToInt32(Console.ReadLine()); if (i == 1) { add addrow = new add(); Console.WriteLine("напишите номер задачи и саму задачу"); int id = Convert.ToInt32(Console.ReadLine()); string task = Console.ReadLine(); addrow.addrow(id, task); Program main = new Program(); Program.Main(); } if (i == 2) { remove removerow = new remove(); Console.WriteLine("напишите номер задачи которую нужно удалить"); int id = Convert.ToInt32(Console.ReadLine()); removerow.removerow(id); Program main = new Program(); Program.Main(); } if (i == 3) { update updaterow = new update(); Console.WriteLine("напишите номер задачи которую надо обновить"); int id = Convert.ToInt32(Console.ReadLine()); string task = Console.ReadLine(); updaterow.updaterow(id, task); Program main = new Program(); Program.Main(); } if (i == 4) { show show = new show(); show.shownotes(); Console.ReadLine(); Program main = new Program(); Program.Main(); } if (i == 5) { Environment.Exit(0); } else { Console.WriteLine("не указано действие"); Program main = new Program(); Program.Main(); } }
private Interfaces.IShow ToShow(show show) { return(new Show(show.shwId, show.shwName, show.shwDescr, show.shwPerformer, show.shwIcon)); }
/// <remarks/> public void showAsync(show show1) { this.showAsync(show1, null); }
/// <remarks/> public void showAsync(show show1, object userState) { if ((this.showOperationCompleted == null)) { this.showOperationCompleted = new System.Threading.SendOrPostCallback(this.OnshowOperationCompleted); } this.InvokeAsync("show", new object[] { show1}, this.showOperationCompleted, userState); }
public void Update_shows(show show) { db.Entry(show).State = EntityState.Modified; db.SaveChanges(); }
public void Update_shows(int id) { show show = db.shows.Find(id); }
private void InitStreams() { //borrar despues List <IQueryConfiguration> configs = main.GetCurrentsConfigurations(); if (configs.Count > 0 && threadStream == null) { stream = Stream.CreateFilteredStream(); stream.TweetMode = TweetMode.Extended; foreach (var config in configs) { foreach (var key in config.Keywords) { stream.AddTrack(key); } } threadStream = new Thread(() => { stream.MatchingTweetReceived += (sender, args) => { IPublication publication = TwitterSearcher.ParseTweetToPublication(args.Tweet, configs[0]); lock (this) { publications2.Add(publication); } }; stream.StartStreamMatchingAllConditions(); }); threadStream.Start(); threadShow = new Thread(() => { while (publications2.Count >= 0) { if (publications2.Count % 10 == 0) { show sho = new show(ShowPublications); this.Invoke(sho, publications2); } else { Thread.Sleep(500); } } }); threadShow.Start(); //Recordar las privacidades queries, y configurations, quitar static de parse tweet y quitar //delegado } else { StopStreams(); } }
public void Add_show(show show) { db.shows.Add(show); db.SaveChanges(); }
public static void Main(string[] args) { int choice; do { Console.Clear(); Console.WriteLine("Hey, welcome to kids Mathmatic Quesitons automation!"); Console.WriteLine("-------------------------------------------"); Console.WriteLine("press 1 for Addition"); Console.WriteLine("press 2 for Subtraction"); Console.WriteLine("press 3 for Multiply"); Console.WriteLine("press 4 for division"); Console.WriteLine(System.Environment.NewLine); Console.WriteLine("what's your choice: "); choice = Convert.ToInt32(Console.ReadLine()); if (choice == 1) { Console.Clear(); Console.WriteLine("Addtion, good choice! How many questions you want: "); int i = Convert.ToInt32(Console.ReadLine()); System.Threading.Thread.Sleep(1000); Console.Clear(); show q = new show(); int j = 0; while (j < i) { q.RandomAddNumbers(); q.showaddquestion(); j = j + 1; } Console.WriteLine(System.Environment.NewLine); Console.WriteLine("Please any key to exit"); Console.ReadKey(); break; } else if (choice == 2) { Console.Clear(); Console.WriteLine("Subtraction, good choice! How many questions you want: "); int i = Convert.ToInt32(Console.ReadLine()); System.Threading.Thread.Sleep(1000); Console.Clear(); show q = new show(); int j = 0; while (j < i) { q.RandomSubNumbers(); q.showSubquestion(); j = j + 1; } Console.WriteLine(System.Environment.NewLine); Console.WriteLine("Please any key to exit"); Console.ReadKey(); break; } else if (choice == 3) { Console.Clear(); Console.WriteLine("Multiply, good choice! How many questions you want: "); int i = Convert.ToInt32(Console.ReadLine()); System.Threading.Thread.Sleep(1000); Console.Clear(); show q = new show(); int j = 0; while (j < i) { q.RandomMulNumbers(); q.showMulquestion(); j = j + 1; } Console.WriteLine(System.Environment.NewLine); Console.WriteLine("Please any key to exit"); Console.ReadKey(); break; } else if (choice == 4) { Console.Clear(); Console.WriteLine("Division, good choice! How many questions you want: "); int i = Convert.ToInt32(Console.ReadLine()); System.Threading.Thread.Sleep(1000); Console.Clear(); show q = new show(); int j = 0; while (j < i) { q.RandomDivNumbers(); q.showDivquestion(); j = j + 1; } Console.WriteLine(System.Environment.NewLine); Console.WriteLine("Please any key to exit"); Console.ReadKey(); break; } else { Console.Clear(); Console.WriteLine("Wrong input!"); System.Threading.Thread.Sleep(1000); } } while(choice > 1 || choice < 5); }
public bool Update_show(show showIns) { try { show a = db.show.First(t => t.id == showIns.id); a.title = showIns.title; a.name = showIns.name; a.sort = showIns.sort; a.changeTime = showIns.changeTime; a.text = showIns.text; a.state = showIns.state; db.SubmitChanges(); return true; } catch (Exception e) { Console.WriteLine("{2} Update_show exception caught." + e); return false; } }