Пример #1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        ServiceReference1.IcarserviceClient client = new ServiceReference1.IcarserviceClient();
        ServiceReference1.car[]             c      = client.GetCarByName(TextBox1.Text);
        ServiceReference1.UserCar           uc     = new ServiceReference1.UserCar();
        ServiceReference1.car[]             cd1    = client.GetCar(int.Parse(Request.QueryString["word"]));

        uc.carid = c[0].carid;

        Label1.Text    = uc.carid.ToString();
        uc.carname     = c[0].carname;
        uc.carnum      = c[0].carnum;
        uc.cartype     = c[0].cartype;
        uc.source      = TextBox2.Text;
        uc.destination = TextBox3.Text;
        int tempd  = (int.Parse(TextBox4.Text));
        int tempd1 = (cd1[0].fare);
        int result = tempd * tempd1;

        uc.fare       = result;
        uc.Id         = int.Parse(Request.QueryString["Parameter"]);
        uc.userid     = int.Parse(HttpContext.Current.Session["userid"].ToString());
        uc.username   = client.GetUserById(int.Parse(HttpContext.Current.Session["userid"].ToString()));
        uc.seatingcap = c[0].seatingcap;

        string msg = client.UpdateUserCar(uc);

        Response.Redirect("ShowRide.aspx?Parameter=" + uc.userid);
    }
Пример #2
0
    private void AddRowsToGrid1()
    {
        ServiceReference1.IcarserviceClient client = new ServiceReference1.IcarserviceClient();
        ServiceReference1.car[]             cars   = client.GetCarByName(TextBox1.Text);

        foreach (var a in cars)
        {
            mytable.Rows.Add(a.carid, a.carname, a.cartype, a.carnum, a.fare, a.seatingcap);
        }

        // ADD ROWS TO THE DATATABLE.
    }
Пример #3
0
    protected void TextBox1_TextChanged(object sender, EventArgs e)
    {
        TextBox2.Text = " ";
        ServiceReference1.IcarserviceClient client = new ServiceReference1.IcarserviceClient();
        ServiceReference1.car[]             cars   = client.GetCarByName(TextBox1.Text);
        CreateGrid();
        AddRowsToGrid1();

        // NOW BIND THE GRIDVIEW WITH THE DATATABLE.
        GridView1.DataSource = mytable;

        GridView1.DataBind();
        Editable();
    }