Exemplo n.º 1
0
        private void cmdAddStop_Click(object sender, EventArgs e)
        {
            Server.Service1 server = new Server.Service1();
            bool            addstop;
            bool            addstoppassed;

            server.addstop(textBox1.Text, txtStopName.Text, txtLongitude.Text, txtLatitude.Text, out addstop, out addstoppassed);
            if (addstop)
            {
                MessageBox.Show("Stop has been added");
                Server.Service1 myserver = new Server.Service1();
                BindingSource   bs       = new BindingSource();
                bs.DataSource            = myserver.getstops(textBox1.Text);
                dataGridView1.DataSource = bs;
            }
            else
            {
                MessageBox.Show(" enter something");
            }
        }
Exemplo n.º 2
0
        private void cmdChange_Click(object sender, EventArgs e)
        {
            Server.Service1 server = new Server.Service1();
            bool            updatestops;
            bool            updatestopsPassed;

            server.updatestops(textBox1.Text, txtOldstopname.Text, txtnewstopname.Text, out updatestops, out updatestopsPassed);
            if (updatestops)
            {
                MessageBox.Show("stop updated");
                Server.Service1 myserver = new Server.Service1();
                BindingSource   bs       = new BindingSource();
                bs.DataSource            = myserver.getstops(textBox1.Text);
                dataGridView1.DataSource = bs;
            }
            else
            {
                MessageBox.Show("stop not founded .Please enter valid stopname");
            }
        }