Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.CheckDbConnectivity();
            PageUtility.CheckInvalidAttempts(this.Page);
            this.BindCompanies();
            this.BindBranches();

            if (this.branchSelect.Items.Count.Equals(0))
            {
                this.Response.Redirect("~/Installation/Default.aspx");
            }

            if (!this.IsPostBack)
            {
                if (this.User.Identity.IsAuthenticated)
                {
                    long globalLoginId = Conversion.TryCastLong(this.User.Identity.Name);

                    if (globalLoginId > 0)
                    {
                        AppUsers.SetCurrentLogin();
                        this.RedirectToDashboard();
                    }
                }
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.CheckDbConnectivity();
            PageUtility.CheckInvalidAttempts(this.Page);

            try
            {
                this.BindBranchDropDownList();
            }
            catch
            {
                //Could not bind the branch office dropdownlist.
                //The target database does not contain mixerp schema.
                //Swallow the exception
                //and redirect to application offline page.
                this.RedirectToOfflinePage();
                return;
            }


            if (!this.IsPostBack)
            {
                if (this.User.Identity.IsAuthenticated)
                {
                    long signInId = Conversion.TryCastLong(this.User.Identity.Name);

                    if (signInId > 0)
                    {
                        CurrentUser.SetSignInView();
                        this.RedirectToDashboard();
                    }
                }
            }
        }