Ejemplo n.º 1
0
 private void AddModelBtn_Click(object sender, EventArgs e)
 {
     if (DB_Storage.CheckModel(addModelText.Text))
     {
         DB_Product_Query.AddModel(new Model(addModelText.Text, ((DB_Element)addModelBrand.SelectedItem).Id));
     }
     Update();
 }
Ejemplo n.º 2
0
 private void AddBrandBtn_Click(object sender, EventArgs e)
 {
     if (DB_Storage.CheckBrand(addBrandText.Text))
     {
         DB_Product_Query.AddBrand(addBrandText.Text);
     }
     Update();
 }
Ejemplo n.º 3
0
        private void AddProduct_Click(object sender, EventArgs e)
        {
            Engine engine = new Engine((DB_Element)comboxTypeEngine.SelectedItem, ((DB_Element)comBoxPlace.SelectedItem),
                                       float.Parse(comboxEngineCapacity.SelectedItem.ToString()));

            engine.Id = DB_TechData_Query.AddEngine(engine);
            Tech_Data tech_Data = new Tech_Data((DB_Element)comboxCarcase.SelectedItem, engine, (int)comboxDoors.SelectedItem,
                                                (int)comboxSeats.SelectedItem);

            tech_Data.Id = DB_TechData_Query.AddTech_data(tech_Data);
            Product product = new Product(InputVIN.Text, (DB_Element)comboxCountry.SelectedItem,
                                          engine, (Model)comboxModel.SelectedItem, tech_Data, true, decimal.Parse(InputPrice.Text));

            DB_Product_Query.AddProduct(product);
            Update();
        }
Ejemplo n.º 4
0
        private new void Update()
        {
            DB_Storage = new DB_Storage();
            comboxEngineCapacity.DataSource = DB_Storage.GetCapacity();
            comboxDoors.DataSource          = DB_Storage.GetDoors();
            comboxSeats.DataSource          = DB_Storage.GetSeats();
            comboxModel.DataSource          = DB_Storage.Models;
            comboxCarcase.DataSource        = DB_Storage.Carcases;
            comboxCountry.DataSource        = DB_Storage.Countries;
            comboxBrand.DataSource          = DB_Storage.Brands;
            comboxTypeEngine.DataSource     = DB_Storage.Engine_types;
            comBoxPlace.DataSource          = DB_Storage.Engine_places;
            addModelBrand.DataSource        = DB_Storage.Brands;
            comboxPayType.DataSource        = DB_Storage.Payment_types;
            comBoxCities.DataSource         = DB_Storage.Cities;
            comBoxClients.DataSource        = DB_Storage.Clients;


            //BrandSaleSelect.DataSource = DB_Storage.Brands;
            TotalSumGridView.DataSource = DB_Sale_Query.GetTotalSum("");
            productsView.DataSource     = DB_Product_Query.GetAllProducts();
        }
Ejemplo n.º 5
0
        private void BtnSearchAuto_Click(object sender, EventArgs e)
        {
            productsView.DataSource = DB_Product_Query.SearchAuto(SearchWord.Text);

            GridAutoSize(productsView);
        }
Ejemplo n.º 6
0
        private void ViewProducts_Click(object sender, EventArgs e)
        {
            productsView.DataSource = DB_Product_Query.GetAllProducts();

            GridAutoSize(productsView);
        }
Ejemplo n.º 7
0
 private void addCountryBtn_Click(object sender, EventArgs e)
 {
     DB_Product_Query.AddCountry(addCountryText.Text);
     Update();
 }