Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            EditWorkplace editlocation = new EditWorkplace();

            editlocation.FormBorderStyle = FormBorderStyle.FixedDialog;
            editlocation.ShowDialog();
        }
Пример #2
0
        private void neuToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            EditWorkplace editlocation = new EditWorkplace();

            editlocation.FormBorderStyle = FormBorderStyle.FixedDialog;
            editlocation.FormClosing    += new FormClosingEventHandler(this.mainform_FormClosingEvent);
            editlocation.ShowDialog();
        }
Пример #3
0
        private void button4_Click(object sender, EventArgs e)
        {
            EditWorkplace editlocation = new EditWorkplace();

            editlocation.FormBorderStyle = FormBorderStyle.FixedDialog;
            editlocation.FormClosing    += new FormClosingEventHandler(this.form_FormClosing);
            editlocation.ShowDialog();
        }
Пример #4
0
        private void ShiftTemplates_Load(object sender, EventArgs e)
        {
            MinimizeBox             = false;
            MaximizeBox             = false;
            chBx_zuschlaege.Checked = true;
            tv_breaktime.Text       = "0,5";
            //Fill ComboBox

            List <Workplace> workplace_list = db_manager.getWorkplaceData("");

            cB_Workplace.DisplayMember = "Text";
            for (int i = 0; i < workplace_list.Count; i++)
            {
                ComboBoxItem ci = new ComboBoxItem();
                ci.Text  = workplace_list[i].name;
                ci.Value = workplace_list[i].id;
                cB_Workplace.Items.Add(ci);
            }
            if (workplace_list.Count > 0)
            {
                cB_Workplace.SelectedIndex = 0;
            }
            else
            {
                var message = "Keine Orte vordefiniert. Jetz Orte anlegen?";
                var title   = "Hinweis";
                var result  = MessageBox.Show(
                    message,
                    title,
                    MessageBoxButtons.YesNo,
                    MessageBoxIcon.Question);

                // the following can be handled as if/else statements as well
                switch (result)
                {
                case DialogResult.Yes:
                    EditWorkplace editworkplace = new EditWorkplace();
                    editworkplace.FormBorderStyle = FormBorderStyle.FixedDialog;
                    editworkplace.ShowDialog();
                    break;

                case DialogResult.No:
                    break;

                default:
                    break;
                }
            }
        }
Пример #5
0
        private void InitializeWorkplaceComboBox()
        {
            //Fill ComboBox for Workplaces

            cB_Workplace.Items.Clear();
            List <Workplace> workplace_list = db_manager.getWorkplaceData("");

            cB_Workplace.DisplayMember = "Text";
            for (int i = 0; i < workplace_list.Count; i++)
            {
                ComboBoxItem ci = new ComboBoxItem();
                ci.Text  = workplace_list[i].name;
                ci.Value = workplace_list[i].id;
                cB_Workplace.Items.Add(ci);
            }
            if (workplace_list.Count > 0)
            {
                // cB_Workplace.Text = "Bitte wählen";
                cB_Workplace.Text = "Bitte wählen";
                //cB_Workplace.SelectedIndex = 0;
            }
            else
            {
                var message = "Keine Orte vordefiniert. Jetz Orte anlegen?";
                var title   = "Hinweis";
                var result  = MessageBox.Show(
                    message,
                    title,
                    MessageBoxButtons.YesNo,
                    MessageBoxIcon.Question);

                // the following can be handled as if/else statements as well
                switch (result)
                {
                case DialogResult.Yes:
                    EditWorkplace editworkplace = new EditWorkplace();
                    editworkplace.FormBorderStyle = FormBorderStyle.FixedDialog;
                    editworkplace.ShowDialog();
                    break;

                case DialogResult.No:
                    break;

                default:
                    break;
                }
            }
        }