Пример #1
0
        private void DoSale(object sender, EventArgs e)
        {
            DB_Element city   = new DB_Element();
            Client     client = new Client();
            Sale       sale;

            if (City_Changed)
            {
                city.Value = comBoxCities.Text;
                city.Id    = DB_Sale_Query.AddCity(city.Value);
            }
            else
            {
                city.Id = ((DB_Element)comBoxCities.SelectedItem).Id;
                Console.WriteLine("ID::" + city.Id);
            }

            if (comBoxClients.SelectedIndex < 0)
            {
                client    = new Client(comBoxClients.Text, clientPhone.Text, city);
                client.Id = DB_Sale_Query.AddClient(client);
            }
            else
            {
                client.Id = ((Client)comBoxClients.SelectedItem).Id;
            }

            sale = new Sale(client, new DB_Element(boxVINsale.Text), (DB_Element)comboxPayType.SelectedItem);

            DB_Sale_Query.AddSale(sale);

            Update();
        }
Пример #2
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();
        }
Пример #3
0
 private void SalesSearch_TextChanged(object sender, EventArgs e)
 {
     brandSaleGridView.DataSource = DB_Sale_Query.GetSales(SalesSearch.Text);
 }
Пример #4
0
 private void BrandSumSearch_TextChanged(object sender, EventArgs e)
 {
     TotalSumGridView.DataSource = DB_Sale_Query.GetTotalSum(BrandSumSearch.Text);
 }
Пример #5
0
        private void tabTotalSum_Click(object sender, EventArgs e)
        {
            TotalSumGridView.DataSource = DB_Sale_Query.GetTotalSum("");

            GridAutoSize(TotalSumGridView);
        }