Esempio n. 1
0
        /// <summary>
        /// Event handler when the create brand button is cliked
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Create_Brand_Button_Click(object sender, EventArgs e)
        {
            AddBrandForm Form   = new AddBrandForm(null);
            DialogResult Result = Form.ShowDialog();

            if (Result == DialogResult.OK)
            {
                Load_Brand();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Displays the modify brand form.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void On_Modify_Brand(object sender, EventArgs e)
        {
            AddBrandForm Form   = new AddBrandForm(getSelectedArticle().Brand_Name);
            DialogResult Result = Form.ShowDialog();

            if (Result == DialogResult.OK)
            {
                Load_Articles();
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Displays the add brand form
        /// </summary>
        private void Add_Brand()
        {
            AddBrandForm Form   = new AddBrandForm(null);
            DialogResult Result = Form.ShowDialog();

            if (Result == DialogResult.OK)
            {
                // Get the new value.
                Database     db             = Database.GetInstance();
                Models.Brand Modified_Brand = db.Get_Brand_With_Id(Form.Inserted_Id);

                String[]     row = { "" + Modified_Brand.Id, Modified_Brand.Name };
                ListViewItem lvi = new ListViewItem(row);
                Brand_List_View.Items.Add(lvi);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Displays the modify brand form
        /// </summary>
        /// <param name="Brand"></param>
        private void Modify_Brand(Models.Brand Brand)
        {
            AddBrandForm Form   = new AddBrandForm(Brand.Name);
            DialogResult Result = Form.ShowDialog();

            if (Result == DialogResult.OK)
            {
                // Get the new value.
                Database     db             = Database.GetInstance();
                Models.Brand Modified_Brand = db.Get_Brand_With_Id(Brand.Id);

                ListViewItem Lvi = Brand_List_View.SelectedItems[0];
                Lvi.SubItems[0].Text = Modified_Brand.Id.ToString();
                Lvi.SubItems[1].Text = Modified_Brand.Name;
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Launches the add brand form.
        /// </summary>
        public void Add_Brand()
        {
            AddBrandForm abf = new AddBrandForm(null);

            abf.ShowDialog();
        }