Example #1
0
 public AdministratorPresenter(IAdminForm form, IDataBaseModel dataBase, DatabaseParser parser)
 {
     this.form                  = form;
     this.dataBase              = dataBase;
     this.parser                = parser;
     this.form.materialChanged += TableChanged;
     this.form.changeAdd       += ChangeAddCycle;
     this.form.delete          += DataDeleted;
     this.form.submit          += DataSubmitted;
     this.form.changeUser      += ChangeUser;
 }
Example #2
0
        /// <summary>
        /// Close the app and run the selected one
        /// </summary>
        public static void RunAsAdmin(IAdminForm app, string arguments)
        {
            // Do nothing
            if (HasAdminPrivileges())
            {
                return;
            }

            //Vista or higher check
            if (Environment.OSVersion.Version.Major >= 6)
            {
                // Get path
                string path = app.GetAppPath();
                Console.WriteLine(path);

                Process          p   = new Process();
                ProcessStartInfo psi = new ProcessStartInfo(path, arguments);
                p.StartInfo = psi;

                if (p.StartInfo.Verb == string.Empty)
                {
                    p.StartInfo.Verb = "runas";
                }
                else
                {
                    p.StartInfo.Verb += "runas";
                }

                p.Start();
                Application.Exit();
            }
            else
            {
                throw new SystemException("OS version not supported");
            }
        }
Example #3
0
 /// <summary>
 /// Close the app and run the selected one
 /// </summary>
 public static void RunAsAdmin(IAdminForm app)
 {
     RunAsAdmin(app, default);
 }
Example #4
0
 public UserPresenter(IAdminForm adminFormView)
 {
     this.adminFormView = adminFormView;
 }
 public void ButtonEventClick(IAdminForm AdminFormView)
 {
     AdminFormView.OpenEventForm();
 }
 public void ButtonLokacijaClick(IAdminForm AdminFormView)
 {
     AdminFormView.OpenLocationForm();
 }
 public void ButtonCategoryClick(IAdminForm AdminFormView)
 {
     AdminFormView.OpenCategoryForm();
 }