private void Init()
 {
     label5.Text = k1.GetBenutzername();
     label7.Text = k1.GetAbteilung();
     label8.Text = k1.GetBeruf();
     Name_überschrift_Label.Text = k1.GetBenutzername() + "´s Profil";
     pictureBox1.Image           = k1.GetProfilbild();
 }
 public Registrierung(Konto k1_, KontoSpeicher k2_)
 {
     InitializeComponent();
     k1          = k1_;
     k2          = k2_;
     label4.Text = k1.GetBenutzername();
 }
 public Administration(Verwaltung_ verwaltung)
 {
     this.verwaltung = verwaltung;
     InitializeComponent();
     for (int i = 0; i < verwaltung.GetAnzahlKonten(); i++)
     {
         k1 = verwaltung.GetKonto(i);
         listBox1.Items.Add(k1.GetBenutzername());
     }
     listBox1.SelectedIndex = 0;
 }
 }       //Items für Combobox
 public Kalender(Konto k1_, Verwaltung_ verwaltung_)
 {
     InitializeComponent();
     TimeandDate_        = new TimeandDate();
     FehltageListe       = new List <DateTime>();
     KrankheitstageListe = new List <DateTime>();
     Feiertage           = new List <DateTime>();
     FeiertageNamen      = new List <string>();
     k1         = k1_;
     verwaltung = verwaltung_;
     Init();
     InitFehltage();
     Refresh_Form();
     if (k1.GetBenutzername() == "Admin")
     {
         Anfrage_an_Admin_Button.Visible = true;
     }
 } //Constructor
        } //Constructor

        private void Init()
        {
            label46.Text = DateTime.Now.ToShortDateString();
            TimeandDate_.SetMyValue(DateTime.Today);
            label35.Text = k1.GetBenutzername();
            comboBox1.Items.Add(new Item("Januar", 1));
            comboBox1.Items.Add(new Item("Februar", 2));
            comboBox1.Items.Add(new Item("März", 3));
            comboBox1.Items.Add(new Item("April", 4));
            comboBox1.Items.Add(new Item("Mai", 5));
            comboBox1.Items.Add(new Item("Juni", 6));
            comboBox1.Items.Add(new Item("Juli", 7));
            comboBox1.Items.Add(new Item("August", 8));
            comboBox1.Items.Add(new Item("September", 9));
            comboBox1.Items.Add(new Item("Oktober", 10));
            comboBox1.Items.Add(new Item("November", 11));
            comboBox1.Items.Add(new Item("Dezember", 12));
            comboBox1.SelectedIndex = DateTime.Today.Month - 1;
            comboBox2.Items.Add(new Item("2018", 2018));
            comboBox2.Items.Add(new Item("2019", 2019));
            comboBox2.Items.Add(new Item("2020", 2020));
            comboBox2.Items.Add(new Item("2021", 2021));
            comboBox2.SelectedIndex = DateTime.Today.Year - 2018;
            label1.Text             = "1"; _Panels[0] = panel1; LabelsKalender[0] = label1;
            label2.Text             = "2"; _Panels[1] = panel2; LabelsKalender[1] = label2;
            label3.Text             = "3"; _Panels[2] = panel3; LabelsKalender[2] = label3;
            label4.Text             = "4"; _Panels[3] = panel4; LabelsKalender[3] = label4;
            label5.Text             = "5"; _Panels[4] = panel5; LabelsKalender[4] = label5;
            label6.Text             = "6"; _Panels[5] = panel6; LabelsKalender[5] = label6;
            label7.Text             = "7"; _Panels[6] = panel7; LabelsKalender[6] = label7;
            label8.Text             = "8"; _Panels[7] = panel8; LabelsKalender[7] = label8;
            label9.Text             = "9"; _Panels[8] = panel9; LabelsKalender[8] = label9;
            label10.Text            = "10"; _Panels[9] = panel10; LabelsKalender[9] = label10;
            label11.Text            = "11"; _Panels[10] = panel11; LabelsKalender[10] = label11;
            label12.Text            = "12"; _Panels[11] = panel12; LabelsKalender[11] = label12;
            label13.Text            = "13"; _Panels[12] = panel13; LabelsKalender[12] = label13;
            label14.Text            = "14"; _Panels[13] = panel14; LabelsKalender[13] = label14;
            label15.Text            = "15"; _Panels[14] = panel15; LabelsKalender[14] = label15;
            label16.Text            = "16"; _Panels[15] = panel16; LabelsKalender[15] = label16;
            label17.Text            = "17"; _Panels[16] = panel17; LabelsKalender[16] = label17;
            label18.Text            = "18"; _Panels[17] = panel18; LabelsKalender[17] = label18;
            label19.Text            = "19"; _Panels[18] = panel19; LabelsKalender[18] = label19;
            label20.Text            = "20"; _Panels[19] = panel20; LabelsKalender[19] = label20;
            label21.Text            = "21"; _Panels[20] = panel21; LabelsKalender[20] = label21;
            label22.Text            = "22"; _Panels[21] = panel22; LabelsKalender[21] = label22;
            label23.Text            = "23"; _Panels[22] = panel23; LabelsKalender[22] = label23;
            label24.Text            = "24"; _Panels[23] = panel24; LabelsKalender[23] = label24;
            label25.Text            = "25"; _Panels[24] = panel25; LabelsKalender[24] = label25;
            label26.Text            = "26"; _Panels[25] = panel26; LabelsKalender[25] = label26;
            label27.Text            = "27"; _Panels[26] = panel27; LabelsKalender[26] = label27;
            label28.Text            = "28"; _Panels[27] = panel28; LabelsKalender[27] = label28;
            label29.Text            = "29"; _Panels[28] = panel29; LabelsKalender[28] = label29;
            label30.Text            = "30"; _Panels[29] = panel30; LabelsKalender[29] = label30;
            label31.Text            = "31"; _Panels[30] = panel31; LabelsKalender[30] = label31;
            label29.Visible         = false;
            label30.Visible         = false;
            label31.Visible         = false;
            label32.Text            = DateTime.Today.ToShortDateString();
            FehltageListe           = k1.GetUrlaubstage();
            KrankheitstageListe     = k1.GetKrankheitstage();
            FreieUrlaubstageRefresh();
            comboBox3.Items.Add(new Item("Urlaub", 0));
            comboBox3.Items.Add(new Item("Krankheit", 1));
            Profilbild_refresh();
            InitFehltage();
            SetKonten_Zaehler();
        }       //Initialisierung der Kalender Labels und des Gesamten Layouts
        }    //Ausgabe anzahl Tage im Monat

        private void Label_Click(object sender, EventArgs e)
        {
            Text_reset();
            int p = 10;

            if (k1.GetFreiUrlaubstage() > 0)
            {
                if (k1.GetFreiUrlaubstage() < 10)
                {
                    p = k1.GetFreiUrlaubstage();
                }
                DateTime t;
                Label    clickedLabel = sender as Label;
                string   tmp          = sender.ToString();
                s = tmp.Substring(tmp.Length - 2);
                t = Datum_anpassung();
                ListeUrlauber.Items.Clear();
                for (int i = 0; i < verwaltung.GetAnzahlKonten(); i++)
                {
                    Konto k3 = verwaltung.GetKonto(i);
                    if (k3.GetUrlaubstage().Contains(t) == true)
                    {
                        ListeUrlauber.Items.Add(k3.GetBenutzername());
                    }
                }
                if (t.Year > DateTime.Today.Year)
                {
                    return;
                }
                if (t.DayOfWeek.ToString() == "Sunday" || t.DayOfWeek.ToString() == "Saturday" || ListeUrlauber.Items.Count >= 3)
                {
                    return;
                }
                if (clickedLabel.BackColor == Color.Transparent && _Panels[t.Day - 1].BackColor == Color.Transparent)
                {
                    if (_Labels[counter].Text == "")
                    {
                        clickedLabel.BackColor       = Color.DodgerBlue;
                        _Panels[t.Day - 1].BackColor = Color.DodgerBlue;
                        _Labels[counter].Text        = t.ToShortDateString();
                        counter++;
                    }
                    if (counter == p)
                    {
                        DialogResult result = MessageBox.Show("Auswahl bestätigen [OK] oder Auswahl zurücksetzen [Cancel]",
                                                              "Auswahl Bestätigen", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                        if (result == DialogResult.OK)
                        {
                            Urlaub_akzeptieren();
                        }
                        else
                        {
                            InitFehltage();
                        }
                        return;
                    }
                }
                else
                {
                    if (clickedLabel.BackColor == Color.Red || _Panels[t.Day - 1].BackColor == Color.Red)
                    {
                    }
                    if (clickedLabel.BackColor == Color.Green || _Panels[t.Day - 1].BackColor == Color.Green)
                    {
                    }
                    if (clickedLabel.BackColor == Color.Yellow || _Panels[t.Day - 1].BackColor == Color.Yellow)
                    {
                        string[] text = new string[10];
                        for (int i = 0; i < 9; i++)
                        {
                            text[i] = textBox1.Lines[i];
                        }
                        for (int i = 0; i < Feiertage.Count; i++)
                        {
                            if (Feiertage[i] == t)
                            {
                                int index = Feiertage.IndexOf(t);
                                text[9] = "Feiertag: " + FeiertageNamen[index].ToString();
                            }
                        }
                        textBox1.Lines = text;
                    }
                    if (clickedLabel.BackColor == Color.DodgerBlue || _Panels[t.Day - 1].BackColor == Color.DodgerBlue)
                    {
                        clickedLabel.BackColor       = Color.Transparent;
                        _Panels[t.Day - 1].BackColor = Color.Transparent;
                        for (int i = 0; i <= 9; i++)
                        {
                            if (_Labels[i].Text == t.ToShortDateString())
                            {
                                _Labels[i].Text = "";
                                counter--;
                            }
                        }
                    }
                }
            }
            else
            {
                MessageBox.Show("Urlaubstage aufgebraucht schauen Sie in die Urlaubstage Liste!");
            }
            s = null;
        } // Event: Klick auf die KalenderLabels