Exemplo n.º 1
0
        /// <summary>
        /// Event handler when the create sub-family button is cliked
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Create_SubFamily_Button_Click(object sender, EventArgs e)
        {
            AddSubFamilyForm Form   = new AddSubFamilyForm(null);
            DialogResult     Result = Form.ShowDialog();

            if (Result == DialogResult.OK)
            {
                Load_Sub_Familly();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Displays the modify sub-family form.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void On_Modify_Sub_Family(object sender, EventArgs e)
        {
            AddSubFamilyForm Form   = new AddSubFamilyForm(getSelectedArticle().Sub_Familly_Name);
            DialogResult     Result = Form.ShowDialog();

            if (Result == DialogResult.OK)
            {
                Load_Articles();
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Displays the add sub-family form
        /// </summary>
        private void Add_SubFamily()
        {
            AddSubFamilyForm Form   = new AddSubFamilyForm(null);
            DialogResult     Result = Form.ShowDialog();

            if (Result == DialogResult.OK)
            {
                // Get the new value.
                Database         db = Database.GetInstance();
                Models.SubFamily Modified_SubFamily = db.Get_Sub_Family_With_Id(Form.Inserted_Id);

                String[]     row = { "" + Modified_SubFamily.Id, "" + Modified_SubFamily.Family_Id, Modified_SubFamily.Name };
                ListViewItem lvi = new ListViewItem(row);
                SubFamily_List_View.Items.Add(lvi);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Displays the modify sub-family form
        /// </summary>
        /// <param name="SubFamily"></param>
        private void Modify_SubFamily(Models.SubFamily SubFamily)
        {
            AddSubFamilyForm Form   = new AddSubFamilyForm(SubFamily.Name);
            DialogResult     Result = Form.ShowDialog();

            if (Result == DialogResult.OK)
            {
                // Get the new value.
                Database         db = Database.GetInstance();
                Models.SubFamily Modified_SubFamily = db.Get_Sub_Family_With_Id(SubFamily.Id);

                ListViewItem Lvi = SubFamily_List_View.SelectedItems[0];
                Lvi.SubItems[0].Text = Modified_SubFamily.Id.ToString();
                Lvi.SubItems[1].Text = Modified_SubFamily.Family_Id.ToString();
                Lvi.SubItems[2].Text = Modified_SubFamily.Name;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Displays the add family form.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void On_Add_Sub_Family(object sender, EventArgs e)
        {
            AddSubFamilyForm Form = new AddSubFamilyForm(null);

            Form.ShowDialog();
        }