public HttpResponseMessage Buy(TicketBuy person) { if (!this.ModelState.IsValid) { //tutaj wywala ogolny blad gdy otrzymal zle dane throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.BadRequest)); } loginAnswer reply = new loginAnswer { ok = 0, tocken = null }; //jezeli wszystko gra, jest siano itp //to ok =0 , tocken tez moze byc random //jak nie udalo sie to ok na 1 i string //todo //dodaje bilet o nazwie, dla uzytkownika o tym tokenie //UWAGA zalazylem ze nazwa biletu jest w person.Name if (Zapytania.kupBilet(person.Tocken, person.Name) == true) { reply.ok = 0; } else { reply.ok = 1;//blad } HttpResponseMessage response = this.Request.CreateResponse(HttpStatusCode.Created, reply); return(response); }
private void show() { switch (num) { case 1: f2.Content = new Routine(this); line1.Visibility = System.Windows.Visibility.Visible; line2.Visibility = System.Windows.Visibility.Visible; numline.Text = ""; end1.Content = "null"; selected = false; break; case 2: if (end1.Content.ToString() != "null") { selected = true; } f2.Content = new Type1(this); break; case 3: num--; if (numline.Text == "") { MessageBox.Show("请自定义选择通票!"); } else { TicketBuy tb = new TicketBuy(this); tb.ShowDialog(); } break; } }
public Spend(TicketBuy tb) { InitializeComponent(); this.tb = tb; if (BuyT.chang) { this.Resources.MergedDictionaries.Remove(tb.path1); this.Resources.MergedDictionaries.Add(tb.path2); } }