private void btnFind_Click(object sender, System.EventArgs e) { try { equip = new clsEquipment(); equip.iOrgId = OrgId; equip.sEquipId = tbEquipId.Text; equip.GetEquipId(); if (equip.iId.Value == 0) { lblError.Visible = true; tbEquipId.Text = ""; } else { pnlFindEquipment.Visible = false; pnlManyEquipment.Visible = false; pnlOneEquipment.Visible = true; ViewState["SelectedEqiupId"] = equip.iId.Value.ToString(); lblEquipId.Text = tbEquipId.Text; lblEquipType.Text = equip.sType.Value; lblMakeModel.Text = equip.sMakeModelName.Value; lblYear.Text = equip.iYear.Value.ToString(); } } catch (Exception ex) { _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName); Session["lastpage"] = "ok_selectEquipment.aspx?orderid=" + OrderId.ToString(); Session["error"] = ex.Message; Session["error_report"] = ex.ToString(); Response.Redirect("error.aspx", false); } finally { if (equip != null) { equip.Dispose(); } } }