private void Page_Load(object sender, System.EventArgs e) { try { if(Request.QueryString["id"] == null) { Session["lastpage"] = "main.aspx"; Session["error"] = _functions.ErrorMessage(104); Response.Redirect("error.aspx", false); return; } try { OrgId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, false); EquipId = Convert.ToInt32(Request.QueryString["id"]); } catch(FormatException fex) { Session["lastpage"] = "main.aspx"; Session["error"] = _functions.ErrorMessage(105); Response.Redirect("error.aspx", false); return; } sCurrentPage = "manageIssues.aspx?id=" + EquipId.ToString(); if(!IsPostBack) { order = new clsWorkOrders(); order.iOrgId = OrgId; ddlCategory.DataSource = new DataView(order.GetCategoryList()); ddlCategory.DataBind(); ddlCategory.Items.Insert(0, ""); equip = new clsEquipment(); equip.cAction = "S"; equip.iId = EquipId; equip.iOrgId = OrgId; if(equip.EquipmentDetail() == -1) { Session["lastpage"] = ParentPageURL; Session["error"] = _functions.ErrorMessage(102); Response.Redirect("error.aspx", false); return; } lblEquipId.Text = equip.sEquipId.Value; lblMakeModel.Text = equip.sMakeModelName.Value; lblOperator.Text = equip.sEquipOperator.Value; lblType.Text = equip.sType.Value; lblYear.Text = equip.iYear.Value.ToString(); if(!equip.dmCurrentUnits.IsNull) lblUnits.Text = Convert.ToDouble(equip.dmCurrentUnits.Value).ToString(); hlCreateOrder.NavigateUrl = "wo_existingWorkOrders.aspx?id=" + EquipId.ToString(); ShowIssues(); } } catch(Exception ex) { _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName); Session["lastpage"] = ParentPageURL; Session["error"] = ex.Message; Session["error_report"] = ex.ToString(); Response.Redirect("error.aspx", false); } finally { if(order != null) order.Dispose(); if(equip != null) equip.Dispose(); } }
private void Page_Load(object sender, System.EventArgs e) { try { if((Request.QueryString["equipid"] == null) && (Request.QueryString["orderid"] == null)) { Session["lastpage"] = "ok_mainMenu.aspx"; Session["error"] = _functions.ErrorMessage(104); Response.Redirect("error.aspx", false); return; } try { OrderId = Convert.ToInt32(Request.QueryString["orderid"]); EquipId = Convert.ToInt32(Request.QueryString["equipid"]); } catch(FormatException fex) { Session["lastpage"] = "ok_mainMenu.aspx"; Session["error"] = _functions.ErrorMessage(105); Response.Redirect("error.aspx", false); return; } OrgId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, false); if(Request.QueryString["op"] == null) { Operation = "CheckIn"; BackPage = "ok_editCurrentUnits.aspx?orderid=" + OrderId.ToString() + "&equipid=" + EquipId.ToString(); CurrentPage = "ok_addIssues.aspx?orderid=" + OrderId.ToString() + "&equipid=" + EquipId.ToString(); } else { if(Request.QueryString["op"] == "AddIssue") { Operation = "AddIssue"; BackPage = "ok_mainMenu.aspx"; CurrentPage = "ok_addIssues.aspx?op=AddIssue&orderid=" + OrderId.ToString() + "&equipid=" + EquipId.ToString(); } else if(Request.QueryString["op"] == "AddIssueReOpen") { Operation = "AddIssueReOpen"; BackPage = "ok_reopenWorkOrder.aspx?id=" + OrderId.ToString(); CurrentPage = "ok_addIssues.aspx?op=AddIssueReOpen&orderid=" + OrderId.ToString() + "&equipid=" + EquipId.ToString(); } } op = new OperatorInfo(Request.Cookies["bfp_operator"].Value); if(!IsPostBack) { order = new clsWorkOrders(); order.iOrgId = OrgId; order.iId = OrderId; if(Operation == "AddIssueReOpen") { pnlSelectCategory.Visible = true; pnlEnterIssue.Visible = false; pnlViewIssues.Visible = false; repCategories.DataSource = new DataView(order.GetCategoryList()); repCategories.DataBind(); } else { pnlViewIssues.Visible = true; pnlEnterIssue.Visible = false; pnlSelectCategory.Visible = false; lblFirstName.Text = op.FirstName; if(order.GetEquipInfo() != -1) { lblEquipId.Text = order.sEquipId.Value; lblEquipType.Text = order.sEquipTypeName.Value; } else { Session["lastpage"] = BackPage; Session["error"] = _functions.ErrorMessage(102); Response.Redirect("error.aspx", false); return; } dtIssues = order.GetReportedIssueListsOperatorKiosk(); if(dtIssues.Rows.Count > 0) { html_tblNoneIssues.Visible = false; repIssues.DataSource = new DataView(dtIssues); repIssues.DataBind(); } else html_tblNoneIssues.Visible = true; } } } catch(Exception ex) { _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName); Session["lastpage"] = BackPage; Session["error"] = ex.Message; Session["error_report"] = ex.ToString(); Response.Redirect("error.aspx", false); } finally { if(order != null) order.Dispose(); } }
private void Page_Load(object sender, System.EventArgs e) { string [,] arrBrdCrumbs; try { if(Request.QueryString["id"] == null) { Session["lastpage"] = "wo_default.aspx"; Session["error"] = _functions.ErrorMessage(104); Response.Redirect("error.aspx", false); return; } try { OrderId = Convert.ToInt32(Request.QueryString["id"]); OrgId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, false); } catch(FormatException fex) { Session["lastpage"] = "wo_default.aspx"; Session["error"] = _functions.ErrorMessage(105); Response.Redirect("error.aspx", false); return; } // if the coming was from order detail screen m_sBack = Request.QueryString["back"]; switch(m_sBack) { case "view": // from View Work Order Detial screen m_sBackUrl = "wo_addRepairs.aspx?id=" + OrderId.ToString() + "&back=view"; m_sLastPage = "wo_viewWorkOrder.aspx?id=" + OrderId.ToString() + "&#Issues"; tblMain.Rows[9].Visible = false; tblMain.Rows[10].Visible = true; // getting the Bread Crumbs from Cookie and add last item if (Request.Cookies.Count > 0 && Request.Cookies["bfp_navigate"] != null) Header.BrdCrumbsSerialization = Request.Cookies["bfp_navigate"].Value; Header.AddBreadCrumb("Work Order Detail", "/" + m_sLastPage); SaveCancelControl.CausesValidation = false; SaveCancelControl.ParentPageURL = ParentPageURL; SaveCancelControl.ButtonText = " Save "; break; case "open": // from Open Work Order screen m_sBackUrl = "wo_addRepairs.aspx?id=" + OrderId.ToString() + "&back=open"; m_sLastPage = "wo_openWorkOrder.aspx?id=" + OrderId.ToString(); tblMain.Rows[9].Visible = true; tblMain.Rows[10].Visible = false; NextBackControl.BackPage = m_sLastPage; NextBackControl.BackVisible = true; NextBackControl.CausesValidation = false; break; case "past": m_sBackUrl = "wo_addRepairs.aspx?back=past&id=" + OrderId.ToString(); m_sLastPage = "wo_editAddInfo.aspx?back=past&id=" + OrderId.ToString() + "&equipid=0"; tblMain.Rows[9].Visible = true; tblMain.Rows[10].Visible = false; NextBackControl.BackPage = m_sLastPage; NextBackControl.BackVisible = true; NextBackControl.CausesValidation = false; break; default: // from Create Work Order screen m_sBackUrl = "wo_addRepairs.aspx?id=" + OrderId.ToString(); m_sLastPage = "wo_editAddInfo.aspx?id=" + OrderId.ToString() + "&equipid=0"; tblMain.Rows[9].Visible = true; tblMain.Rows[10].Visible = false; NextBackControl.BackPage = m_sLastPage; NextBackControl.BackVisible = true; NextBackControl.CausesValidation = false; break; } if(!IsPostBack) { order = new clsWorkOrders(); order.iOrgId = OrgId; dtCategory = order.GetCategoryList(); ddlCategory.DataSource = new DataView(dtCategory); ddlCategory.DataBind(); ddlCategory.Items.Insert(0, ""); ShowIssues(OrderId); } } catch(Exception ex) { _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName); Session["lastpage"] = m_sLastPage; Session["error"] = ex.Message; Session["error_report"] = ex.ToString(); Response.Redirect("error.aspx", false); } finally { if(order != null) order.Dispose(); } }
private void btnYES_Click(object sender, System.EventArgs e) { try { pnlSelectCategory.Visible = true; pnlEnterIssue.Visible = false; pnlViewIssues.Visible = false; order = new clsWorkOrders(); order.iOrgId = OrgId; repCategories.DataSource = new DataView(order.GetCategoryList()); repCategories.DataBind(); } catch(Exception ex) { _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName); Session["lastpage"] = CurrentPage; Session["error"] = ex.Message; Session["error_report"] = ex.ToString(); Response.Redirect("error.aspx", false); } finally { if(order != null) order.Dispose(); } }