private void btn_update_Click(object sender, EventArgs e)
        {
            try {
                Items items = new Items()
                {
                    Id            = _item_id,
                    CategoryId    = int.Parse(metroComboBox1.SelectedValue.ToString()),
                    SubCategoryId = int.Parse(metroComboBox2.SelectedValue.ToString()),
                    Model         = txt_model.Text,
                    Brand         = txt_brand.Text
                };
                ItemRepository itemRepository = new ItemRepository(items);
                itemRepository.UpdateItem();

                MessageBox.Show("Changes Has Been Saved");
                _item_list.Items();
                this.Close();
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #2
0
 private void button4_Click(object sender, EventArgs e)
 {
     this.Visible = false;
     this._item_list.ViewControls();
     _item_list.Items();
 }