public void CheckReadOnlyAccess()
        {
            try
            {
                AZManager azManager = new AZManager();
                AZOperation[] azOP = azManager.CheckAccessById(_view.Username, _view.Domain, new Globals.Security.Operations[] { Globals.Security.Operations.AlterJob });

                if (!azOP[0].Result)
                    _view.ReadyOnlyJobRecords = true;
                else
                    _view.ReadyOnlyJobRecords = false;
            }
            catch (Exception ex)
            {
                Logger.Write(string.Format("There was an error while trying to verify user permissions to update Job Information!\n{0}\n{1}", ex.InnerException, ex.StackTrace));
                _view.DisplayMessage("There was an error while trying to verify user permissions to update Job Information.", false);
            }
        }
        /// <summary>
        /// Check user permissions to enable/disable buttons
        /// </summary>
        public void CheckPermissions()
        {
            try
            {
                AZManager azManager = new AZManager();
                AZOperation[] azOP = azManager.CheckAccessById(_view.Username, _view.Domain, new Globals.Security.Operations[] { Globals.Security.Operations.CreateJobRecord, Globals.Security.Operations.ManageCallCriteria, Globals.Security.Operations.FirstAlert, Globals.Security.Operations.Permiting, Globals.Security.Operations.Route });
                if (null != azOP && azOP.Length > 0)
                {
                    _view.EnableNewJobButton = azOP[0].Result;
                    _view.EnableNewCallCriteria = azOP[1].Result;
                    _view.EnableFirstAlertLink = azOP[2].Result;
                    _view.EnablePermitingNotification = azOP[3].Result;
                }

            }
            catch (Exception ex)
            {
                Logger.Write(string.Format("There was an error while trying to verify User Permissions to enable New Job Button!\n{0}\n{1}", ex.Message, ex.StackTrace));
                _view.DisplayMessage("There was an error while trying to verify User Permissions to enable New Job Button.", false);
            }
        }
        public void VerifyAccess()
        {
            try
            {
                AZManager azManager = new AZManager();
                AZOperation[] azOP = azManager.CheckAccessById(_view.UserName, _view.Domain, new Globals.Security.Operations[] { Globals.Security.Operations.Subcontractor });

                if (!azOP[0].Result)
                {
                    _view.ReadOnly = true;
                }
            }
            catch (Exception ex)
            {
                Logger.Write(string.Format("An error has ocurred while trying to verify Permissions!\n{0}\n{1}", ex.Message, ex.StackTrace));
                _view.DisplayMessage("An error ocurred while trying to verify Permissions.", false);
            }
        }
        public void VerifyDeletePermission()
        {
            if (_manager == null)
                _manager = new AZManager();

            AZOperation[] azOP = _manager.CheckAccessById(_view.UserName, _view.Domain, new Globals.Security.Operations[] { Globals.Security.Operations.FirstAlertDelete });
            if (azOP.Length > 0)
            {
                _view.DeletePermission = azOP[0].Result;
            }
        }
        /// <summary>
        /// Verify if user has access to the page
        /// </summary>
        public void VerifyAccess()
        {
            try
            {
                if (_manager == null)
                    _manager = new AZManager();

                AZOperation[] azOP = _manager.CheckAccessById(_view.UserName, _view.Domain, new Globals.Security.Operations[] { Globals.Security.Operations.FirstAlert });

                if (!azOP[0].Result)
                {
                    _view.DisplayMessage("The user does not have access to this functionality", true);
                    _view.ReadOnly = true;
                }
            }
            catch (Exception ex)
            {
                Logger.Write(string.Format("An error has ocurred while trying to verify Permissions!\n{0}\n{1}", ex.Message, ex.StackTrace));
                _view.DisplayMessage("An error ocurred while trying to verify Permissions.", false);
            }
        }
 public FirstAlertPresenter(IFirstAlertView view, AZManager manager)
 {
     _view = view;
     _viewModel = new FirstAlertViewModel(view);
     _manager = manager;
 }
        public void VerifyAccess()
        {
            try
            {
                AZManager azManager = new AZManager();
                AZOperation[] azOP = azManager.CheckAccessById(_view.UserName, _view.Domain, new Globals.Security.Operations[] { Globals.Security.Operations.Route });

                if (!azOP[0].Result)
                    _view.ReadOnly = true;
            }
            catch (Exception ex)
            {
                Logger.Write(string.Format("An Error has ocurred while trying to verify access to page.\n{0}\n{1}", ex.Message, ex.StackTrace));
                _view.DisplayMessage("An Error has ocurred while trying to verify access to page. Please try again.", false);
            }
        }