public void FillGridView() { PatientBAO obj = new PatientBAO(); grdOPDList.DataSource = obj.GetOPDPatientList(); grdOPDList.DataBind(); }
protected void btnSave_Click(object sender, EventArgs e) { PatientBAO obj = new PatientBAO(); // Business Layer class which will take care for operation PatientInfo pa = new PatientInfo(); // Entiry Supporting class to travl my form data //Daata Assignment for sendingit to save pa.Name = txtPatientName.Text; pa.Mobile = txtMobileNumber.Text; pa.pincode = Convert.ToInt32(txtPincode.Text); pa.Purposeofvisit = txtPurposeofVisit.Text; pa.Remark = txtRemark.Text; pa.State = ddlState.SelectedValue; pa.AddressLine1 = txtAddressLine1.Text; pa.AddressLine2 = txtAddressLine2.Text; pa.Age = Convert.ToInt32(txtAge.Text); pa.Country = ddlCountry.SelectedValue; pa.City = ddlCity.SelectedValue; pa.Email = txtEmail.Text; pa.Gender = rbtGender.SelectedValue; //Calling Business layer Method top save data of PatientInfo object obj.SavePatient(pa); Page.ClientScript.RegisterStartupScript(Page.GetType(), "Success", "alert('Saved Successfully')", true); Response.Redirect("~/Reception/OPDPatientList.aspx"); }
public void FillPatientDetails(int patientID) { PatientBAO obj = new PatientBAO(); PatientInfo p = obj.GetPatientById(patientID); if (p != null) { lblPatientName.Text = p.Name; lblGender.Text = p.Gender; lblAge.Text = p.Age.ToString(); hdnPkId.Value = p.PatientId.ToString(); } else { Page.ClientScript.RegisterStartupScript(Page.GetType(), "Failuer", "alert('Patient Details Not Found')", true); divBody.Visible = false; return; } }