Beispiel #1
0
        private void buttonShoe_Click(object sender, EventArgs e)
        {
            var addShoeShoe  = textBoxShoe.Text;
            var addShoePrice = textBoxPriceShoe.Text;
            var addShoeDate  = dateTimePickerDateShoe.Text;
            var brandShoeId  = textBoxBrandShoeId.Text;

            AddShoes newShoe = new AddShoes
            {
                Shoe    = addShoeShoe,
                Price   = Int32.Parse(addShoePrice),
                Date    = Convert.ToDateTime(addShoeDate),
                BrandId = Int32.Parse(brandShoeId)
            };

            _shoes.Create(newShoe);
            _shoes.Save();

            LoadShoes();
            var selectedShoeIndex = Int32.Parse(dataGridViewShoes.SelectedRows[0].Cells[0].Value.ToString());


            _shoes.DeleteById(selectedShoeIndex);
            _shoes.Save();
            LoadShoes();
        }
Beispiel #2
0
        private void buttonAddShoe_Click(object sender, EventArgs e)
        {
            var addShoeShoe  = textBoxShoe.Text;
            var addShoePrice = textBoxPriceShoe.Text;
            var addShoeDate  = dateTimePickerDateShoe.Text;
            var brandShoeId  = textBoxBrandShoeId.Text;

            AddShoes newShoe = new AddShoes
            {
                Shoe    = addShoeShoe,
                Price   = Int32.Parse(addShoePrice),
                Date    = Convert.ToDateTime(addShoeDate),
                BrandId = Int32.Parse(brandShoeId)
            };

            _shoes.Create(newShoe);
            _shoes.Save();

            LoadShoes();
        }