private void buttonPronadji_Click(object sender, EventArgs e) { if (this.textBoxIdKarte.Text != "") { Ekarta_AdminPortClient veza = new Ekarta_AdminPortClient(); string result = veza.getKarta(Int32.Parse(this.textBoxIdKarte.Text)); if (result != "_") { string[] array = result.Split('_'); this.textBoxPolazak.Text = array[0]; this.textBoxDolazak.Text = array[1]; this.textBoxTrasa.Text = array[2]; this.textBoxVremePolaska.Text = array[3]; this.textBoxCena.Text = array[4]; this.textBoxPopust.Text = array[5]; this.textBoxAktivna.Text = array[6] == "0" ? "Ne" : "Da"; this.textBoxPovratna.Text = array[7] == "0" ? "Ne" : "Da"; } else { MessageBox.Show("Ne postoji karta sa ovim identifikacionim brojem!", "Obavestenje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.textBoxIdKarte.Focus(); } } else { MessageBox.Show("Unesite identifikacioni broj karte!", "Obavestenje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.textBoxIdKarte.Focus(); } }
private void buttonPlati_Click(object sender, EventArgs e) { if (this.textBoxIdKarte.Text != "") { if (this.textBoxPolazak.Text != "") { if (this.textBoxAktivna.Text == "Ne") { Ekarta_AdminPortClient veza = new Ekarta_AdminPortClient(); try { veza.activate(Int32.Parse(this.textBoxIdKarte.Text)); } catch (Exception ex) { } this.textBoxAktivna.Text = "Da"; MessageBox.Show("Kartaje aktivirana!", "Obavestenje", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Karta je vec placena!", "Obavestenje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { MessageBox.Show("Ne postoji karta sa ovim identifikacionim brojem!", "Obavestenje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { MessageBox.Show("Unesite identifikacioni broj karte!", "Obavestenje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void buttonPonisti_Click(object sender, EventArgs e) { if (this.textBoxIdKarte.Text != "") { if (this.textBoxPolazak.Text != "") { Ekarta_AdminPortClient veza = new Ekarta_AdminPortClient(); try { veza.unsetKarta(Int32.Parse(this.textBoxIdKarte.Text)); } catch (Exception ex) { } MessageBox.Show("Karta je Izbrisana!", "Obavestenje", MessageBoxButtons.OK, MessageBoxIcon.Information); isprazniSvaPolja(); } else { MessageBox.Show("Ne postoji karta sa ovim identifikacionim brojem!", "Obavestenje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { MessageBox.Show("Unesite identifikacioni broj karte!", "Obavestenje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void button1_Click(object sender, EventArgs e) { string idTrasa = this.comboBoxTrasa.SelectedValue.ToString(); string idPopust = this.comboBoxVrstaPopust.SelectedValue.ToString(); string idStanicaPolaska = this.comboBoxPolaznaStanica.SelectedValue.ToString(); string idStanicaDolaska = this.comboBoxDolaznaStanica.SelectedValue.ToString(); string vreme = comboBoxVremePolaska.Text; string vremePolaska = dateTimePickerDatumPutovanja.Value.Day + "-" + dateTimePickerDatumPutovanja.Value.Month + "-" + dateTimePickerDatumPutovanja.Value.Year + "-" + vreme.Split(':')[0] + "-" + vreme.Split(':')[1]; string povratna = this.checkBoxPovratna.Checked ? "1" : "0"; Ekarta_AdminPortClient veza = new Ekarta_AdminPortClient(); string cena = ""; try { cena = veza.izracunajCenuKarte(Int32.Parse(idTrasa), Int32.Parse(idStanicaPolaska), Int32.Parse(idStanicaDolaska), Int32.Parse(idPopust), Int32.Parse(povratna)); } catch (Exception ex) { MessageBox.Show(ex.Message); } string zaSlanje = idTrasa + "_" + idPopust + "_" + idStanicaPolaska + "_" + idStanicaDolaska + "_" + vremePolaska + "_" + povratna + "_" + cena; try { veza.setKarta(zaSlanje); } catch (Exception ex) { } ponistiSve(); MessageBox.Show("Karta uspesno rezervisana","Obavestenje",MessageBoxButtons.OK,MessageBoxIcon.Information); }