示例#1
0
        //File Watchers: Remote/ Configuration/ Web Upload folders.
        private void FileSystemWatcher_RemoteDB_Changed(object sender, FileSystemEventArgs e)
        {
            Config_Load data_op = new Config_Load();

            data_op.ADDRemoteUsers();
            this.Refresh();
        }
示例#2
0
        // Add conditional if item is selected- then mesage box.
        private void button_Settings_RemoveUsers_Click(object sender, EventArgs e)
        {
            string EXTERNAL_DATABASE;
            string INTERNAL_CONFIG = AppDomain.CurrentDomain.BaseDirectory + "Calendar_Configuration/configuration";
            string SelectedName    = listBox_SettingUsers.SelectedItem.ToString();

            string[] LinesInternal = File.ReadAllLines(AppDomain.CurrentDomain.BaseDirectory + "Calendar_Configuration/" + SelectedName + ".cfg");
            string   FirstName     = LinesInternal[8];
            string   LastName      = LinesInternal[9];

            RemoveControl(FirstName, LastName);

            MonolithConsole(SelectedName);
            if (MessageBox.Show("Would you like to remove the selected user(s)? Note: ALL database information will be permanently deleted if user(s) is removed.", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                string[] lines = File.ReadAllLines(INTERNAL_CONFIG);

                EXTERNAL_DATABASE = lines[18] + lines[17] + ".db";
                RemoveMatchingUser(FirstName, LastName);

                /*using (var db = new LiteDatabase(EXTERNAL_DATABASE))
                 * {
                 *  File.Delete(AppDomain.CurrentDomain.BaseDirectory + "Calendar_Configuration/" + SelectedName + ".cfg");
                 *
                 *  db.DropCollection(SelectedName);
                 *
                 *  Form.ActiveForm.Refresh();
                 *
                 *  var EmployeeCollection = db.GetCollectionNames();
                 *
                 *  PersonnelList.Clear();
                 *  for (int x = 3; x < EmployeeCollection.Count(); x++)
                 *  {
                 *      PersonnelList.Add(EmployeeCollection.ElementAtOrDefault(x));
                 *  }
                 *
                 *  listBox_SettingUsers.Refresh();
                 *  for (int x = 0; x < PersonnelList.Count(); x++)
                 *  {
                 *      dialog_internalsettings.listBox_SettingUsers.Items.Add(PersonnelList[x]);
                 *      MonolithConsole(PersonnelList[x]);
                 *  }
                 * }*/
            }
            Config_Load cgLoad = new Config_Load();

            display_Panel1.pib_1.Visible  = false;
            display_Panel1.pib_2.Visible  = false;
            display_Panel1.pib_3.Visible  = false;
            display_Panel1.pib_4.Visible  = false;
            display_Panel1.pib_5.Visible  = false;
            display_Panel1.pib_6.Visible  = false;
            display_Panel1.pib_7.Visible  = false;
            display_Panel1.pib_8.Visible  = false;
            display_Panel1.pib_9.Visible  = false;
            display_Panel1.pib_10.Visible = false;
            display_Panel1.day_Control_1.Dispose();
            display_Panel1.day_Control_2.Dispose();
            display_Panel1.day_Control_3.Dispose();
            display_Panel1.day_Control_4.Dispose();
            display_Panel1.day_Control_5.Dispose();
            display_Panel1.day_Control_6.Dispose();
            display_Panel1.day_Control_7.Dispose();
            display_Panel1.day_Control_8.Dispose();
            display_Panel1.day_Control_9.Dispose();
            display_Panel1.day_Control_10.Dispose();
            cgLoad.ADDRemoteUsers();
        }