public TransportMain(string type, string land, string stad)
        {
            InitializeComponent();
            using (TransportServiceClient tsc = new TransportServiceClient())
            {
                if (land.Equals(""))
                    land = null;

                if (stad.Equals(""))
                    stad = null;

                this.lastTransportResult = tsc.getTransport(type, land, stad);

                transportType[] tt = tsc.getAlleTransportTypes();

                if (this.lastTransportResult != null && this.lastTransportResult.Count() > 0)
                {
                    foreach (transport tr in this.lastTransportResult)
                    {
                        transportType ttp = new transportType();
                        foreach (transportType t in tt)
                        {
                            if (t.type_id == tr.type_id)
                            {
                                ttp = t;
                                break;
                            }
                        }

                        listBox1.Items.Add("[" + ttp.naam + "] " + tr.omschrijving);
                    }
                }
            }
        }
        public TransportMain()
        {
            InitializeComponent();
            using(TransportServiceClient tsc = new TransportServiceClient())
            {
                this.lastTransportResult = tsc.getAlleTransportMiddelen();

                 transportType[] tt = tsc.getAlleTransportTypes();

                foreach (transport tr in this.lastTransportResult)
                {
                    transportType ttp = new transportType();
                    foreach(transportType t  in tt)
                    {
                        if(t.type_id == tr.type_id)
                        {
                            ttp = t;
                            break;
                        }
                    }

                    listBox1.Items.Add("[" + ttp.naam + "] " + tr.omschrijving);
                }
            }
        }
Example #3
0
 /// <summary>
 /// Closes transport.
 /// </summary>
 public void Close()
 {
     if (client != null)
     {
         try { client.Close(); } catch { client = null; }
         client = null;
     }
 }
        public TransportFilter()
        {
            InitializeComponent();

            using (TransportServiceClient tsc = new TransportServiceClient())
            {
                ttlist = tsc.getAlleTransportTypes();
                foreach (transportType tt in ttlist)
                    cb_Type.Items.Add(tt.naam);
            }
        }
Example #5
0
 /// <summary>
 /// Opens the specified transport in selected mode.
 /// </summary>
 /// <param name="transportMode">The transport mode.</param>
 /// <param name="worker">The worker.</param>
 public void Open(TransportMode transportMode, ActionWorker worker)
 {
     Close();
     client = new TransportServiceClient();
     if (!string.IsNullOrEmpty(UserName) && !string.IsNullOrEmpty(Password))
     {
         if (client.ClientCredentials != null)
         {
             client.ClientCredentials.UserName.UserName = UserName;
             client.ClientCredentials.UserName.Password = Password;
         }
     }
     OnBeforeOpen(new BeforeOpenArgs(client));
     client.Open();
     worker.ReportProgress(Localizer.ClientOpened);
 }
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            Match mat = Regex.Match(tb_personen.Text, "[0-9]*");
            Match mat2 = Regex.Match(tb_e_dat.Text, "[0-9]{2}-[0-9]{2}-[0-9]{4} [0-9]{2}:[0-9]{2}:[0-9]{2}");
            Match mat3 = Regex.Match(tb_s_dat.Text, "[0-9]{2}-[0-9]{2}-[0-9]{4} [0-9]{2}:[0-9]{2}:[0-9]{2}");

            if (mat.Success && mat2.Success && mat3.Success)
            {

                using (TransportServiceClient tsc = new TransportServiceClient())
                {
                    boeking boek = tsc.boekTransport(this.trans.transport_id, 3, tb_s_dat.Text, tb_e_dat.Text, Int32.Parse(tb_personen.Text));

                    if(boek == null)
                    {
                        textBlock1.Foreground = Brushes.Red;
                        textBlock1.Text = "Error tijdens boeken";
                    } else {

                        OracleConnection oc = CommonMethods.GetConnection();
                        oc.Open();

                        OracleCommand ocmd = oc.CreateCommand();
                        ocmd.CommandText = String.Format("INSERT INTO BOOKING (IDENTIFIER, IDENTIFIER2,  TYPE, END_PERSOON) VALUES ('{0}', '{1}', '{2}', '{3}')",
                            boek.boekings_id,
                            boek.transport_id,
                            "transport",
                            CommonMethods.loginUser.id);
                        ocmd.ExecuteNonQuery();
                        oc.Close();

                        CommonMethods.GetFrame(this).Navigate(new ResultPage());
                    }
                }
            }
            else
            {
                textBlock1.Text = "Foute invoer";
                textBlock1.Foreground = Brushes.Red;
            }
        }
        private void button2_Click(object sender, RoutedEventArgs e)
        {
            if (listBox1.SelectedValue == null)
                return;
            else
            {
                string item = (string)listBox1.SelectedValue;
                foreach (transport trans in this.lastTransportResult)
                {

                    transportType ttp = new transportType();
                    using (TransportServiceClient tsc = new TransportServiceClient())
                    {
                            foreach(transportType t  in tsc.getAlleTransportTypes())
                            {
                                if(t.type_id == trans.type_id)
                                {
                                    ttp = t;
                                    break;
                                }
                            }
                    }

                    if (("[" + ttp.naam + "] " + trans.omschrijving).Equals(item))
                    {
                        CommonMethods.GetFrame(this).Navigate(new TransportBooking(trans));
                        return;
                    }
                }
            }
        }
 public void GetTransports()
 {
     _TransportServices = new Dictionary<string, TransportServiceClient>();
     TransportEntity[] transports = _Manager.GetAllTransports();
     foreach (TransportEntity transport in transports)
     {
         TransportServiceClient service = new TransportServiceClient("WSHttpBinding_ITransportService", transport.TransportURI);
         _TransportServices.Add(transport.Name, service);
     }
 }
Example #9
0
 public WcfClientArgs(TransportServiceClient client, string fileName)
 {
     Client = client;
     FileName = fileName;
 }
Example #10
0
 /// <summary>
 /// Opens the specified transport in selected mode.
 /// </summary>
 /// <param name="transportMode">The transport mode.</param>
 /// <param name="worker">The worker.</param>
 public void Open(TransportMode transportMode, ActionWorker worker)
 {
     Close();
     client = new TransportServiceClient();
     if(!string.IsNullOrEmpty(UserName) && !string.IsNullOrEmpty(Password))
     {
         if (client.ClientCredentials != null)
         {
             client.ClientCredentials.UserName.UserName = UserName;
             client.ClientCredentials.UserName.Password = Password;
         }
     }
     OnBeforeOpen(new BeforeOpenArgs(client));
     client.Open();
     worker.ReportProgress(Localizer.ClientOpened);
 }
Example #11
0
 /// <summary>
 /// Closes transport.
 /// </summary>
 public void Close()
 {
     if (client != null)
     {
         try { client.Close(); } catch { client = null;}
         client = null;
     }
 }
Example #12
0
 public BeforeOpenArgs(TransportServiceClient client)
 {
     Client = client;
 }
Example #13
0
 public BeforeOpenArgs(TransportServiceClient client)
 {
     Client = client;
 }
Example #14
0
 public WcfClientArgs(TransportServiceClient client, string fileName)
 {
     Client   = client;
     FileName = fileName;
 }