Beispiel #1
0
        private void DGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            DataGrid datagrid = (DataGrid)sender;

            OrderGridModel gridModel = (OrderGridModel)datagrid.SelectedItem;

            if (gridModel != null)
            {
                orderId = gridModel.OrderId;

                OrderFeatureModel orderFeatureModel = generalOperation.GetOrdersById(orderId);

                string strMsg = String.Format(" Gövde \t: {0}\n Motor \t: {1} \n Vites Kutusu \t: {2}\n Döşeme \t: {3} \n Opsiyonlar \t: {4}", orderFeatureModel.Body, orderFeatureModel.Engine, orderFeatureModel.GearBox, orderFeatureModel.Floor, orderFeatureModel.Option);

                MessageBox.Show(strMsg, "Araç Detayları");

                if (StaticUser.GetUser().IsAdmin)
                {
                    if (gridModel.StatusType == (int)OrderStatus.Draft)
                    {
                        btnRemove.Visibility = Visibility.Visible;

                        btnSuccess.Visibility = Visibility.Visible;
                    }
                    else
                    {
                        btnRemove.Visibility = Visibility.Collapsed;

                        btnSuccess.Visibility = Visibility.Collapsed;
                    }
                }
            }
        }
Beispiel #2
0
        public Home()
        {
            InitializeComponent();
            btnNewOrder.Click   += BtnNewOrder_Click;
            btnDraftOrder.Click += BtnDraftOrder_Click;
            btnRegister.Click   += BtnRegister_Click;
            btnLogout.Click     += BtnLogout_Click;

            if (StaticUser.GetUser().IsAdmin)
            {
                btnRegister.Visibility = Visibility.Visible;
            }
        }
Beispiel #3
0
        private void BtnOrder_Click(object sender, RoutedEventArgs e)
        {
            if (deallerId == 0)
            {
                MessageBox.Show("Lütfen Bayi Seçiniz");
                return;
            }
            else if (string.IsNullOrEmpty(tbxemail.Text))
            {
                MessageBox.Show("Lütfen Mail Giriniz");
                return;
            }
            else if (string.IsNullOrEmpty(tbxFullName.Text))
            {
                MessageBox.Show("Lütfen Ad Soyad Giriniz");
                return;
            }
            else if (string.IsNullOrEmpty(tbxPhone.Text))
            {
                MessageBox.Show("Lütfen Telefon Giriniz");
                return;
            }
            Dealer dealer = generalOperation.GetDealerById(deallerId);

            Orders orders = new Orders()
            {
                AppUserId         = StaticUser.GetUser().AppUserId,
                CarsId            = StaticOrder.GetCarId(),
                IsActive          = true,
                CreateDate        = DateTime.Now,
                IsDeleted         = false,
                IsStandartPackage = StaticOrder.GetPackageTypeId() == 1?true:false,
                StatusType        = (int)OrderStatus.Draft,
                DealerId          = deallerId
            };

            orders.OrderDetails.Add(new OrderDetails
            {
                IsActive          = true,
                CreateDate        = DateTime.Now,
                IsDeleted         = false,
                VehicleFeaturesId = bodyFeatureId
            });
            orders.OrderDetails.Add(new OrderDetails
            {
                IsActive          = true,
                CreateDate        = DateTime.Now,
                IsDeleted         = false,
                VehicleFeaturesId = colorFeatureId
            });
            orders.OrderDetails.Add(new OrderDetails
            {
                IsActive          = true,
                CreateDate        = DateTime.Now,
                IsDeleted         = false,
                VehicleFeaturesId = engineFeatureId
            });
            orders.OrderDetails.Add(new OrderDetails
            {
                IsActive          = true,
                CreateDate        = DateTime.Now,
                IsDeleted         = false,
                VehicleFeaturesId = floorFeatureId
            });
            orders.OrderDetails.Add(new OrderDetails
            {
                IsActive          = true,
                CreateDate        = DateTime.Now,
                IsDeleted         = false,
                VehicleFeaturesId = gearboxFeatureId
            });
            string optionTextList = string.Empty;

            foreach (var item in optionList)
            {
                orders.OrderDetails.Add(new OrderDetails
                {
                    IsActive          = true,
                    CreateDate        = DateTime.Now,
                    IsDeleted         = false,
                    VehicleFeaturesId = item
                });

                VehicleFeatures vehicleFeatures = generalOperation.GetByIdVehicleFeatures(item);

                if (string.IsNullOrEmpty(optionTextList))
                {
                    optionTextList = vehicleFeatures.FeaturesName;
                }
                else
                {
                    optionTextList += "</br>" + vehicleFeatures.FeaturesName;
                }
            }
            generalOperation.InsertOrders(orders);

            AppUser appUser = generalOperation.GetAppUserById(orders.AppUserId);

            EmailHelper.Mail(tbxemail.Text, "Talebini Aldık", "Merhaba, " + appUser.Username + "<br>" + "Araç Sipariş Talebini Aldık Yakında Sana Geri Dönüş Yapacağız");

            EmailHelper.Mail(dealer.DealerEmail, "Yeni Sipariş Talebi", "Merhaba , <br>" +
                             "Müşteri Adı:" + appUser.Username + "<br>" +
                             "Telefon Numarası:" + tbxPhone.Text + "<br>" +
                             "Email:" + tbxemail.Text + "<br>" +
                             "</hr>" +
                             "<h1>Araç Bilgileri </h1>" +
                             "<br>" +
                             "Araç Modeli:" + lblCarName.Content + "<br>" +
                             "Araç Paketi:" + lblPackageType.Content + "<br>" +
                             "Araç Gövde Seçimi:" + lblBody.Content + "<br>" +
                             "Araç Motor Seçimi:" + lblEngine.Content + "<br>" +
                             "Araç Şanzıman Seçimi:" + lblGearbox.Content + "<br>" +
                             "Araç Döşeme Seçimi:" + lblFloor.Content + "<br>" +
                             "Araç Opsiyon Seçimleri:" + optionTextList + "<br>" +
                             "İyi Çalışmalar Teklif Olarak Müşteriye Dönüş Yapınız");

            Home home = new Home();

            this.Close();
            home.Show();
        }