Esempio n. 1
0
        void bindData()
        {
            CarService.CarServiceClient obj = new CarService.CarServiceClient("BasicHttpBinding_ICarService");

            GridView1.DataSource = obj.GetCars();

            GridView1.DataBind();
            obj.Close();
        }
Esempio n. 2
0
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            CarService.CarServiceClient obj = new CarService.CarServiceClient("BasicHttpBinding_ICarService");

            obj.ReturnCar(Session["email"].ToString(), e.Keys[0].ToString());
            obj.Close();
            bindData();
            bindCars();
        }
Esempio n. 3
0
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            CarService.CarServiceClient obj = new CarService.CarServiceClient("BasicHttpBinding_ICarService");

            int id = int.Parse(e.Keys[0].ToString());

            obj.DeleteCar(id);
            obj.Close();
            bindData();
        }
Esempio n. 4
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string name = TextBox1.Text;

            CarService.CarServiceClient obj = new CarService.CarServiceClient("BasicHttpBinding_ICarService");

            obj.AddCar(name);
            obj.Close();

            bindData();
        }
Esempio n. 5
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            CarService.CarServiceClient obj = new CarService.CarServiceClient("BasicHttpBinding_ICarService");

            obj.AssignCar(Session["email"].ToString(), DropDownList1.SelectedValue);

            obj.Close();

            bindData();
            bindCars();
        }
Esempio n. 6
0
        void bindCars()
        {
            CarService.CarServiceClient obj = new CarService.CarServiceClient("BasicHttpBinding_ICarService");

            string[] ds = obj.GetCarNames();

            DropDownList1.DataSource = ds.ToList();
            DropDownList1.DataBind();

            obj.Close();
        }
Esempio n. 7
0
        void bindData()
        {
            CarService.CarServiceClient obj = new CarService.CarServiceClient("BasicHttpBinding_ICarService");

            DataSet ds = obj.GetUserCar(Session["email"].ToString());

            if (ds.Tables[0].Rows.Count > 0)
            {
                Label1.Visible       = false;
                GridView1.DataSource = ds;
                GridView1.DataBind();
                GridView1.Visible = true;
            }
            else
            {
                Label1.Visible    = true;
                GridView1.Visible = false;
            }

            obj.Close();
        }