/****** View Appointment patient details from GridView Select ======> *****/ protected void GVAppointmentList_SelectedIndexChanged(object sender, EventArgs e) { // int rowIndex = e.RowIndex; BLL.AppointmentListBll bll = new BLL.AppointmentListBll(); string appointId = ((Label)GVAppointmentList.SelectedRow.FindControl("lblAppointId")).Text; string patientUserId = ((Label)GVAppointmentList.SelectedRow.FindControl("lblUserId")).Text; int nullColumn = bll.GetUserNullInfo(patientUserId); if (nullColumn > 0) { Response.Redirect("UserProfileUI.aspx?aId=" + appointId + ""); } else { Response.Redirect("PatientDetailsUI.aspx?pId=" + patientUserId + ""); } }
protected void GVAppointmentList_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "btnPrescribe") { BLL.AppointmentListBll bll = new BLL.AppointmentListBll(); //string patientUserId = ((Label)GVAppointmentList.SelectedRow.FindControl("lblUserId")).Text; int index = Convert.ToInt32(e.CommandArgument); string appointId = ((Label)GVAppointmentList.Rows[index].Cells[1].FindControl("lblAppointId")).Text; string patientUserId = ((Label)GVAppointmentList.Rows[index].Cells[2].FindControl("lblUserId")).Text; string patientSerial = ((Label)GVAppointmentList.Rows[index].Cells[3].FindControl("lblSerialNo")).Text; int nullColumn = bll.GetUserNullInfo(patientUserId); if (nullColumn > 0) { Response.Redirect("UserProfileUI.aspx?pId=" + patientUserId + ""); } else { Response.Redirect("PrescriptionFormUI.aspx?srlNo=" + patientSerial + "&aId=" + appointId + ""); } } }