protected void GvPatientDtlsMbno_PageIndexChanging(object sender, GridViewPageEventArgs e) { GvPatientDtlsMbno.PageIndex = e.NewPageIndex; ddt = ObjIns.AnimaldetailsMbnoBAL(UniqueInstId, txtRMbno.Text.Trim(), ConnKey); try { if (ddt.Rows.Count > 0) { GvPatientDtlsMbno.Visible = true; GvPatientDtlsMbno.DataSource = ddt; GvPatientDtlsMbno.DataBind(); return; } else { objCommon.ShowAlertMessage("Mobile No does not exist"); Panel1.Visible = false; GvPatientDtlsMbno.Visible = false; txtRMbno.Focus(); } } catch (Exception ex) { ExceptionLogging.SendExcepToDB(ex, Session["UsrName"].ToString(), Request.ServerVariables["REMOTE_ADDR"].ToString()); Response.Redirect("~/Error.aspx"); } }
protected void btnSearch_Click(object sender, EventArgs e) { try { Panel1.Visible = false; if (txt_FregNo.Text.Trim() == "" && txtRMbno.Text.Trim() == "") { objCommon.ShowAlertMessage("Kindly Provide either Registration No / Mobile No"); } else { if (txt_FregNo.Text.Trim() != "") { ViewState["MobileSearch"] = "0"; txtRMbno.Text = ""; Panel1.Visible = true; btn_Save.Visible = false; btn_Update.Visible = true; FetchPatientDetails(txt_FregNo.Text.Trim()); GvPatientDtlsMbno.Visible = false; return; } if (txtRMbno.Text != "") { txt_FregNo.Text = ""; ddt = ObjIns.AnimaldetailsMbnoBAL(UniqueInstId, txtRMbno.Text.Trim(), ConnKey); if (ddt.Rows.Count > 0) { ViewState["MobileSearch"] = "1"; GvPatientDtlsMbno.Visible = true; GvPatientDtlsMbno.DataSource = ddt; GvPatientDtlsMbno.DataBind(); return; } else { objCommon.ShowAlertMessage("Mobile No does not exist"); Panel1.Visible = false; GvPatientDtlsMbno.Visible = false; txtRMbno.Focus(); } } } } catch (Exception ex) { ExceptionLogging.SendExcepToDB(ex, Session["UsrName"].ToString(), Request.ServerVariables["REMOTE_ADDR"].ToString()); Response.Redirect("~/Error.aspx"); } }