예제 #1
0
        //Wat gebeurt er als er op de knop naar een opdracht geklikt wordt
        void uco_OnButtonclick(object sender, EventArgs e)
        {
            ucOpdrachtMini control          = (ucOpdrachtMini)sender;
            opdracht       selectedOpdracht = control.opdracht;

            this.Controls.Clear();

            //Nieuwe control aanmaken voor aan panel toe te voegen
            ucOfferte uf = new ucOfferte();

            uf.fillData(selectedOpdracht);
            this.Controls.Add(uf);
        }
예제 #2
0
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            var      rowindex = dataGridView1.CurrentCell.RowIndex;
            var      value    = dataGridView1.Rows[rowindex].Cells["ID"].Value;
            int      valueInt = Convert.ToInt16(value);
            opdracht opdracht = OpdrachtManagement.getOpdracht(valueInt);

            this.Controls.Clear();

            ucOfferte uf = new ucOfferte();

            uf.fillData(opdracht);
            this.Controls.Add(uf);
        }
예제 #3
0
        private void DoubleClickRow(object sender, EventArgs e)
        {
            try
            {
                foreach (DataGridViewRow row in dataGridView1.SelectedRows)
                {
                    string[] value3 = row.Cells[11].Value.ToString().Split('-');
                    //...

                    Form newform = new Form();
                    newform.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
                    if (value3[0].Equals("O"))
                    {
                        int id = 0;
                        int.TryParse(value3[1], out id);
                        ucOpdracht EditObject = new ucOpdracht(OpdrachtManagement.getOpdracht(id));
                        newform.Controls.Add(EditObject);
                        newform.Text = "Edit Opdracht";

                        newform.Size = new Size(EditObject.Size.Width + 15, EditObject.Size.Height + 35);
                        newform.Show();
                    }

                    else if (value3[0].Equals("C"))
                    {
                        int id = 0;
                        int.TryParse(value3[1], out id);

                        rit_instantie instantie = OpdrachtManagement.GetRitinstantie(int.Parse(value3[1]));
                        int           ritnummer = int.Parse(value3[2]);

                        ucEditContractPerDay editObject = new ucEditContractPerDay(instantie, ritnummer);
                        newform.Controls.Add(editObject);
                        newform.Size = new Size(editObject.Size.Width + 15, editObject.Size.Height + 35);
                        newform.Show();
                    }
                    else if (value3[0].Equals("I"))
                    {
                        int id = 0;
                        int.TryParse(value3[1], out id);
                        ucOfferte editObject = new ucOfferte(OpdrachtManagement.getOpdracht(id));
                        newform.Controls.Add(editObject);
                        newform.Size = new Size(editObject.Size.Width + 15, editObject.Size.Height + 35);
                        newform.Show();
                    }
                }
            }
            catch { }
        }