Beispiel #1
0
        /// <summary>
        /// Displays the add family form
        /// </summary>
        private void Add_Family()
        {
            AddFamilyForm Form   = new AddFamilyForm(null);
            DialogResult  Result = Form.ShowDialog();

            if (Result == DialogResult.OK)
            {
                // Get the new value.
                Database      db = Database.GetInstance();
                Models.Family Modified_Family = db.Get_Family_With_Id(Form.Inserted_Id);

                String[]     row = { "" + Modified_Family.Id, Modified_Family.Name };
                ListViewItem lvi = new ListViewItem(row);
                Family_List_View.Items.Add(lvi);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Displays the modify family form
        /// </summary>
        /// <param name="Family"></param>
        private void Modify_Family(Models.Family Family)
        {
            AddFamilyForm Form   = new AddFamilyForm(Family.Name);
            DialogResult  Result = Form.ShowDialog();

            if (Result == DialogResult.OK)
            {
                // Get the new value.
                Database      db = Database.GetInstance();
                Models.Family Modified_Family = db.Get_Family_With_Id(Family.Id);

                ListViewItem Lvi = Family_List_View.SelectedItems[0];
                Lvi.SubItems[0].Text = Modified_Family.Id.ToString();
                Lvi.SubItems[1].Text = Modified_Family.Name;
            }
        }
Beispiel #3
0
        /// <summary>
        /// Add family menu item event handler.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AjouterUneFamilleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddFamilyForm aff = new AddFamilyForm(null);

            aff.ShowDialog();
        }