Beispiel #1
0
 /// <summary>
 /// Executes the previous Open command
 /// </summary>
 internal void NavigateToPrevious()
 {
     try
     {
         if (CheckBeforeNavigate())
         {
             HistoryOfCommands.Instance().GoBack();
             IOpenCommand command = HistoryOfCommands.Instance().GetCurrentCommand();
             command.Execute();
         }
     }
     catch (AccessDeniedException)
     {
         XtraMessageBox.Show("Impossibile accedere alla funzionalità richiesta. Accesso negato", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     catch (Exception ex)
     {
         ErrorHandler.Show(ex);
     }
 }
Beispiel #2
0
        ///// <summary>
        ///// Sets the current control docking style
        ///// </summary>
        ///// <param name="control"></param>
        //internal void SetRenderedControlSize(BaseGUIControl control)
        //{
        //   control.Dock = DockStyle.Fill;
        //}

        internal void NavigateToControl(WIN.SCHEDULING_APP.GUI.Commands.CommandType type)
        {
            try
            {
                if (CheckBeforeNavigate())
                {
                    IOpenCommand cmd = OpenCommandFactory.GetCommand(type, _main);
                    cmd.Execute();
                    HistoryOfCommands.Instance().AddCommandToHistory(cmd);
                }
                MemoryHelper.ReduceMemory();
            }
            catch (AccessDeniedException)
            {
                XtraMessageBox.Show("Impossibile accedere alla funzionalità richiesta. Accesso negato", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Exception ex)
            {
                ErrorHandler.Show(ex);
            }
        }
Beispiel #3
0
 internal void NavigateToStartupControl(string command)
 {
     try
     {
         IOpenCommand cmd = OpenCommandFactory.GetCommand(command, _main);
         if (cmd == null)
         {
             cmd = OpenCommandFactory.GetCommand(WIN.SCHEDULING_APP.GUI.Commands.CommandType.Home, _main);
         }
         cmd.Execute();
         HistoryOfCommands.Instance().AddCommandToHistory(cmd);
     }
     catch (AccessDeniedException)
     {
         XtraMessageBox.Show("Impossibile accedere alla funzionalità richiesta. Accesso negato", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error);
         IOpenCommand cmd = OpenCommandFactory.GetCommand(WIN.SCHEDULING_APP.GUI.Commands.CommandType.Home, _main);
         cmd.Execute();
         HistoryOfCommands.Instance().AddCommandToHistory(cmd);
     }
     catch (Exception ex)
     {
         ErrorHandler.Show(ex);
     }
 }
Beispiel #4
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            NetworkCredentials.Instance().NetworkDomain   = Properties.Settings.Default.networkdomain;
            NetworkCredentials.Instance().NetworkUsername = Properties.Settings.Default.networkusername;
            NetworkCredentials.Instance().NetworkPassord  = Properties.Settings.Default.networkpassword;
            //NetworkFileSystemUtilsProxy p = new NetworkFileSystemUtilsProxy();
            //p.UncFileExist(@"\\DESKTOP-E9KNOCC\ciccio\ciccio.txt");

            //initialize skinning properties
            barManager.ForceInitialize();
            MyBarLocalizer.Active = new MyBarLocalizer();
            SkinHelper.InitSkinPopupMenu(mPaintStyle);


            //initialize navigator
            _navUtil = new NavigationUtils(splitContainerControl.Panel2, this);

            //renders startup controls
            if (_customerId == "")
            {
                _navUtil.NavigateToStartupControl(Properties.Settings.Default.Main_StartCommand);
            }
            else
            {
                try
                {
                    IOpenCommand cmd = new CustomerCommand(this);
                    Hashtable    h   = new Hashtable();
                    h.Add("Id", _customerId);
                    cmd.Execute(h);
                    HistoryOfCommands.Instance().AddCommandToHistory(cmd);
                    MemoryHelper.ReduceMemory();
                }
                catch (Exception ex)
                {
                    ErrorHandler.Show(ex);
                    _navUtil.NavigateToStartupControl(Properties.Settings.Default.Main_StartCommand);
                }
            }

            //sets the caption text
            this.Text = "Gestionale appuntamenti - " + Properties.Settings.Default.Main_AppName;

            //sets the name of the current logged user
            string nome = ((User)(SecurityManager.Instance.CurrentUser)).Username;

            sItem.Caption = string.Format("Benvenuto: {0}!", nome);

            if (DataAccessServices.Instance().PersistenceFacade.DBType == DB.DBType.Access)
            {
                // barRipristina.Visibility = BarItemVisibility.Always;ù
                barButtonbackup.Visibility = BarItemVisibility.Always;
                UpdateLastBackInfo();
                barBack.Visibility = BarItemVisibility.Always;
            }
            else
            {
                //barRipristina.Visibility = BarItemVisibility.Never;
                barButtonbackup.Visibility = BarItemVisibility.Never;
                barBack.Visibility         = BarItemVisibility.Never;
            }



            //sets initial view
            splitContainerControl.Collapsed = Properties.Settings.Default.Main_PanelCollapsed;
            administration.Visible          = !Properties.Settings.Default.Main_ShowOnlyAgendaFunctions;
        }