コード例 #1
0
        private void SignOut()
        {
            UpdateUserLogOutStatus();
            OsaRequestInfo osaRequest = new OsaRequestInfo(Page.Request);
            string         sessionID  = osaRequest.GetUISessionID();

            if (sessionID != null)
            {
                sessionID = sessionID.Split(",".ToCharArray())[0];
            }
            Helper.UserAccount.Remove(Session["UserSystemID"] as string);
            string deviceIpAddress = Request.Params["REMOTE_ADDR"].ToString();

            DataManagerDevice.Controller.Device.UpdateTimeOutDetailsToNull(deviceIpAddress);
            string osaSessionId = string.Empty;
            string aspSession   = string.Empty;
            string sqlQurey     = string.Format("select MFP_ASP_SESSION, MFP_UI_SESSION from M_MFPS where MFP_IP = N'{0}'", deviceIpAddress);

            using (DataManagerDevice.Database db = new DataManagerDevice.Database())
            {
                DbCommand    dBCommand  = db.GetSqlStringCommand(sqlQurey);
                DbDataReader drSessions = db.ExecuteReader(dBCommand, CommandBehavior.CloseConnection);
                while (drSessions.Read())
                {
                    osaSessionId = drSessions["MFP_UI_SESSION"].ToString();
                    aspSession   = drSessions["MFP_ASP_SESSION"].ToString();
                }

                if (drSessions != null && drSessions.IsClosed == false)
                {
                    drSessions.Close();
                }
            }
            //PageLoadingID.Attributes.Add("style", "display:none");
            if (CreateWS())
            {
                SHOWSCREEN_TYPE screen_addr = new SHOWSCREEN_TYPE();
                screen_addr.Item = E_MFP_SHOWSCREEN_TYPE.TOP_LEVEL_SCREEN;
                string generic = "1.0.0.22";
                _ws.ShowScreen(osaSessionId, screen_addr, ref generic);
            }
        }
コード例 #2
0
        /// <summary>
        /// Handles the Click event of the LinkButtonNo control.
        /// </summary>
        /// <param name="sender">Source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/>Instance containing the event data.</param>
        /// <remarks>
        /// Sequence Diagram:<br/>
        ///     <img src="SequenceDiagrams/SD_PrintReleaseDevice.FirstTimeUse.LinkButtonFirstLogOnCancel_Click.jpg"/>
        /// </remarks>
        protected void LinkButtonFirstLogOnCancel_Click(object sender, EventArgs e)
        {
            string osaSessionId    = string.Empty;
            string aspSession      = string.Empty;
            string deviceIpAddress = Request.Params["REMOTE_ADDR"].ToString();
            string sqlQuery        = string.Format("select MFP_ASP_SESSION, MFP_UI_SESSION from M_MFPS where MFP_IP = N'{0}'", deviceIpAddress);

            using (DataManagerDevice.Database db = new DataManagerDevice.Database())
            {
                DbCommand    dBCommand  = db.GetSqlStringCommand(sqlQuery);
                DbDataReader drSessions = db.ExecuteReader(dBCommand, CommandBehavior.CloseConnection);
                while (drSessions.Read())
                {
                    osaSessionId = drSessions["MFP_UI_SESSION"].ToString();
                    aspSession   = drSessions["MFP_ASP_SESSION"].ToString();
                }

                if (drSessions != null && drSessions.IsClosed == false)
                {
                    drSessions.Close();
                }
            }
            if (osaICCard)
            {
                if (CreateWS())
                {
                    SHOWSCREEN_TYPE screen_addr = new SHOWSCREEN_TYPE();
                    screen_addr.Item = E_MFP_SHOWSCREEN_TYPE.TOP_LEVEL_SCREEN;
                    string generic = "1.0.0.22";
                    _ws.ShowScreen(osaSessionId, screen_addr, ref generic);
                }
            }
            else
            {
                Response.Redirect("LogOn.aspx");
            }
        }
コード例 #3
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">Source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/>Instance containing the event data.</param>
        /// <remarks>
        /// Sequence Diagram:<br/>
        ///     <img src="SequenceDiagrams/SD_PrintReleaseEA.Mfp.PinLogOn.Page_Load.jpg"/>
        /// </remarks>
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (Session["UserSource"] == null)
            //{
            //    Response.Redirect("AccountingLogOn.aspx");
            //}
            AppCode.ApplicationHelper.ClearSqlPools();
            deviceIPAddr1 = Request.Params["REMOTE_ADDR"].ToString();
            string reload = Request.Params["prl"] as string;

            if (reload == "true")
            {
                string sqlQuery = string.Format("update M_MFPS set MFP_LAST_UPDATE = {0}, MFP_STATUS = N'{1}' where MFP_IP = N'{2}'", "getdate()", "True", Request.Params["REMOTE_ADDR"] as string);
                using (DataManagerDevice.Database db = new DataManagerDevice.Database())
                {
                    DbCommand dBCommand = db.GetSqlStringCommand(sqlQuery);
                    db.ExecuteNonQuery(dBCommand);
                }
            }

            if (!IsPostBack)
            {
                //Check Auto Login Status
                CheckAutoLoginStatus();
            }

            // XGA Loading
            string OSAModel = string.Empty;

            if (Session["OSAModel"] != null)
            {
                OSAModel = Session["OSAModel"] as string;
            }
            else
            {
                OSAModel = Request.Headers["X-BC-Resolution"];
            }

            if (OSAModel == Constants.DEVICE_MODEL_WIDE_XGA)
            {
                TablePinLogOn.CssClass = "TopPandding_XGA";
            }

            string authSource = Request.Params["authSource"];

            deviceCulture = HttpContext.Current.Request.UserLanguages[0];
            bool isSupportedlangauge = DataManagerDevice.ProviderDevice.ApplicationSettings.IsSupportedLanguage(deviceCulture);

            if (!isSupportedlangauge)
            {
                deviceCulture = "en-US";
            }
            if (Session["UILanguage"] != null)
            {
                deviceCulture = Session["UILanguage"] as string;
            }
            else
            {
                Session["UILanguage"] = deviceCulture;
            }

            if (Session["UserSource"] != null)
            {
                hfAuthenticationSocurce.Value = Session["UserSource"] as string;
                hfLogOnMode.Value             = Session["LogOnMode"] as string;
                if (!string.IsNullOrEmpty(authSource))
                {
                    LogonToMFP();
                }
            }
            else if (!string.IsNullOrEmpty(authSource))
            {
                string logOnMode = Request.Params["logOnMode"];
                string pin       = Request.Params["pin"];

                userSource = authSource;
                //TextBoxUserPin.Text = pin;

                GetSessionDetails();
                LogonToMFP();
            }

            deviceModel = Session["OSAModel"] as string;
            userSource  = Session["UserSource"] as string;
            domainName  = Session["DomainName"] as string;
            if (!IsPostBack)
            {
                BuildUI();
            }
            LocalizeThisPage();
            if (!IsPostBack)
            {
                ApplyThemes();
            }
        }