void bindData() { CarService.CarServiceClient obj = new CarService.CarServiceClient("BasicHttpBinding_ICarService"); GridView1.DataSource = obj.GetCars(); GridView1.DataBind(); obj.Close(); }
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(); }
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(); }
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(); }
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(); }
void bindCars() { CarService.CarServiceClient obj = new CarService.CarServiceClient("BasicHttpBinding_ICarService"); string[] ds = obj.GetCarNames(); DropDownList1.DataSource = ds.ToList(); DropDownList1.DataBind(); obj.Close(); }
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(); }