Exemple #1
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();
            }
        }