protected void ClearItems() { TxtPersonalId.Text = string.Empty; CmbGender.ClearSelection(); DP_Birthday.Clear(); TxtFirstName.Text = string.Empty; TxtSecondName.Text = string.Empty; TxtLastName.Text = string.Empty; TxtSecondLastName.Text = string.Empty; TxtPhone.Text = string.Empty; TxtCellPhone.Text = string.Empty; TxtWhatsapp.Text = string.Empty; TxtEmail.Text = string.Empty; TxtAddress.Text = string.Empty; GrdPatients.Rebind(); }
protected void GrdPatients_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { if (e.Item != null) { if (e.Item.ItemIndex >= 0) { int Id = int.Parse(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Id"].ToString()); switch (e.CommandName) { case "ViewData": System.Data.DataTable dt = Data.DataProvider.Instance().GetPatients(Id); foreach (System.Data.DataRow drow in dt.Rows) { TxtPersonalId.Text = drow["PersonalId"].ToString(); CmbGender.SelectedValue = drow["Gender"].ToString(); DP_Birthday.SelectedDate = DateTime.Parse(drow["Birthday"].ToString()); TxtFirstName.Text = drow["FirstName"].ToString(); TxtSecondName.Text = drow["SecondName"].ToString(); TxtLastName.Text = drow["LastName"].ToString(); TxtSecondLastName.Text = drow["SecondLastName"].ToString(); TxtPhone.Text = drow["Phone"].ToString(); TxtCellPhone.Text = drow["CellPhone"].ToString(); TxtWhatsapp.Text = drow["Whatsapp"].ToString(); TxtEmail.Text = drow["Email"].ToString(); TxtAddress.Text = drow["Address"].ToString(); } break; default: GrdPatients.Rebind(); break; } e.Item.Selected = true; } } }