protected void Button1_Click(object sender, EventArgs e) { Pacient c1 = new Pacient(); GridView1.DataSource = c1.search(TextBox1.Text); GridView1.DataBind(); }
protected void OnRowDeleting(object sender, GridViewDeleteEventArgs e) { Pacient c1 = new Pacient(); c1.Delete(Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Values[0])); this.BindGrid(); }
private void BindGrid() { Pacient c1 = new Pacient(); GridView1.DataSource = c1.Select(); GridView1.DataBind(); }
protected void OnRowUpdating(object sender, GridViewUpdateEventArgs e) { GridViewRow row = GridView1.Rows[e.RowIndex]; Pacient c1 = new Pacient(); c1.Update(Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Values[0]), (row.FindControl("txtName") as TextBox).Text, (row.FindControl("txtSurname") as TextBox).Text, (row.FindControl("txtEmail") as TextBox).Text, (row.FindControl("txtTel") as TextBox).Text, (row.FindControl("txtTherapy") as TextBox).Text, (row.FindControl("txtData") as TextBox).Text, (row.FindControl("txtOra") as TextBox).Text); GridView1.EditIndex = -1; this.BindGrid(); }