Esempio n. 1
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                Session["PathToViewOrder"] = null;

                OrgId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, false);

                if (!IsPostBack)
                {
                    order                = new clsWorkOrders();
                    order.iOrgId         = OrgId;
                    order.daCurrentDate  = DateTime.Now;
                    repOrders.DataSource = new DataView(order.GetActivityWorkOrder());
                    repOrders.DataBind();
                }
            }
            catch (Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
                Session["lastpage"]     = "selectMode.aspx";
                Session["error"]        = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
                if (order != null)
                {
                    order.Dispose();
                }
            }
        }
Esempio n. 2
0
        private void btnFind_Click(object sender, System.EventArgs e)
        {
            int      EquipId, OrderId;
            DataView dwOrders;

            try
            {
                equip          = new clsEquipment();
                equip.iOrgId   = OrgId;
                equip.sEquipId = tbEquipmentId.Text;
                if (equip.SearchEquipId() == 0)
                {
                    Header.ErrorMessage = "<span style='FONT-SIZE:12pt;'>The specified equipment could not be located</span>";
                    tbEquipmentId.Text  = "";
                }
                else
                {
                    EquipId             = equip.iId.Value;
                    order               = new clsWorkOrders();
                    order.iOrgId        = OrgId;
                    order.daCurrentDate = DateTime.Now;
                    dwOrders            = new DataView(order.GetActivityWorkOrder());
                    dwOrders.RowFilter  = "EquipId = " + EquipId.ToString();
                    if (dwOrders.Count > 0)
                    {
                        dwOrders.Sort = "StatusColor desc, OperatorStatusName asc";
                        OrderId       = Convert.ToInt32(dwOrders[0]["Id"].ToString());
                        Response.Redirect("ok_mainDetails.aspx?id=" + OrderId.ToString() + "&back=mainmenu2", false);
                    }
                    else
                    {
                        Response.Redirect("ok_selectEquipment.aspx?orderid=0&equipid=" + EquipId.ToString() + "&back=mainmenu2", false);
                    }
                }
            }
            catch (Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
                Session["lastpage"]     = "ok_mainMenu2.aspx";
                Session["error"]        = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
                if (equip != null)
                {
                    equip.Dispose();
                }
                if (order != null)
                {
                    order.Dispose();
                }
            }
        }
Esempio n. 3
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                OrgId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, false);

                if (tbLastName.Text.Length > 0)
                {
                    Header.BodyOnloadScript = "javascript:GetFocus('" + tbPIN.ClientID + "');";
                }
                else
                {
                    Header.BodyOnloadScript = "javascript:GetFocus('" + tbLastName.ClientID + "');";
                }

                if (!IsPostBack)
                {
                    user         = new clsUsers();
                    user.cAction = "S";
                    user.iOrgId  = OrgId;
                    user.OrgDetails();
                    lblWelcome.Text = "Welcome to the " + user.sOrgName.Value + " Operator Kiosk";

                    order               = new clsWorkOrders();
                    order.iOrgId        = OrgId;
                    order.daCurrentDate = DateTime.Now;

                    dtOrders = order.GetActivityWorkOrder();
                    ViewState["ActivityOrders"] = dtOrders;
                    repOrders.DataSource        = new DataView(dtOrders);
                    repOrders.DataBind();
                }
            }
            catch (Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
                Session["lastpage"]     = "selectMode.aspx";
                Session["error"]        = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
                if (user != null)
                {
                    user.Dispose();
                }
                if (order != null)
                {
                    order.Dispose();
                }
            }
        }