Пример #1
0
        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            if (bodyFeatureId == 0)
            {
                MessageBox.Show("Lütfen Gövde Seçiniz");
                return;
            }
            else if (engineFeatureId == 0)
            {
                MessageBox.Show("Lütfen Motor Seçiniz");
                return;
            }
            else if (gearboxFeatureId == 0)
            {
                MessageBox.Show("Lütfen Vites Kutusu Seçiniz");
                return;
            }
            else if (colorFeatureId == 0)
            {
                MessageBox.Show("Lütfen Renk Seçiniz");
                return;
            }
            else if (floorFeatureId == 0)
            {
                MessageBox.Show("Lütfen Döşeme Seçiniz");
                return;
            }

            gridSecond.Visibility  = Visibility.Visible;
            gridSection.Visibility = Visibility.Collapsed;

            Cars car = generalOperation.GetCarById(StaticOrder.GetCarId());

            lblCarName.Content = car.CarName;
            lblYear.Content    = car.CarModel;
            string startupPath = System.IO.Directory.GetCurrentDirectory();

            imgCar.Source          = new BitmapImage(new Uri(startupPath + "/image/" + car.CarImagePath));
            lblTotalPrice.Content  = (totalPrice += car.Price).ToString() + "₺";
            lblPackageType.Content = StaticOrder.GetPackageTypeId() == 1 ? "Special Paket" : "Standart Paket";

            List <VehicleFeatures> optionFeatureList = generalOperation.GetAllVehicleFeaturesByPackageTypeAndVehicleFeaturesType(StaticOrder.GetPackageTypeId(), Helper.VehicleFeaturesTypeList.OptionList);

            foreach (var item in optionFeatureList.Where(s => optionList.Contains(s.VehicleFeaturesId)))
            {
                Label lblOption = new Label()
                {
                    Content = item.FeaturesName + " Fiyat: " + item.FeaturesPrice + "₺"
                };
                stackOption.Children.Add(lblOption);
            }
        }
        public ChoosePackage()
        {
            InitializeComponent();

            generalOperation        = new GeneralOperation();
            btnChoosePackage.Click += BtnChoosePackage_Click;
            imgNormal.Source        = new BitmapImage(new Uri("pack://application:,,,/image/standart.png"));
            imgSpecial.Source       = new BitmapImage(new Uri("pack://application:,,,/image/special.png"));

            int carId = StaticOrder.GetCarId();

            Cars car = generalOperation.GetCarById(carId);

            lblModelName.Content = car.CarName;
        }