Exemplo n.º 1
0
        public KPPShipments(DB.Shipment shipment)
        {
            IdShipment = shipment.IdShipment;
            FIO        = shipment.IdDriverNavigation?.Family + " " + shipment.IdDriverNavigation?.Name + " " + shipment.IdDriverNavigation?.Patronymic;
            Phone      = shipment.IdDriverNavigation?.Phone;
            if (shipment.IdTimeNavigation.DateTimeFactRegist.HasValue)
            {
                PlanDateFact       = shipment.IdTimeNavigation.DateTimeFactRegist.Value;
                PlanDateFactString = PlanDateFact.ToString();
            }

            if (shipment.IdDriverNavigation.AutoNumber != null)
            {
                NumAuto = shipment.IdDriverNavigation.AutoNumber;
            }

            if (shipment.IdTimeNavigation?.DateTimeLeft != null)
            {
                TextStatus = "Покинул склад";
                btn_arrive = "Collapsed";
                btn_left   = "Collapsed";
            }
            else if (shipment.IdTimeNavigation?.DateTimeLeft == null && shipment.IdTimeNavigation?.DateTimeEndLoad != null)
            {
                TextStatus = "Отгрузка завершена";
                btn_left   = "Visible";
                btn_arrive = "Collapsed";
            }
            else if (shipment.IdTimeNavigation?.DateTimeEndLoad == null && shipment.IdTimeNavigation?.DateTimeLoad != null)
            {
                TextStatus = "Отгрузка";
                btn_arrive = "Collapsed";
                btn_left   = "Collapsed";
            }
            else if (shipment.IdTimeNavigation?.DateTimeLoad == null && shipment.IdTimeNavigation?.DateTimeArrive != null)
            {
                TextStatus = "На территории склада";
                btn_left   = "Visible";
                btn_arrive = "Collapsed";
            }
            else if (shipment.IdTimeNavigation?.DateTimeArrive == null && shipment.IdTimeNavigation?.DateTimeFactRegist != null)
            {
                TextStatus = "Зарегистрирован";
                btn_arrive = "Visible";
                btn_left   = "Collapsed";
            }
            else if (shipment.IdTimeNavigation?.DateTimeFactRegist == null && shipment.IdTimeNavigation?.DateTimePlanRegist != null)
            {
                TextStatus = "";
                btn_arrive = "Collapsed";
                btn_left   = "Collapsed";
            }
            else if (shipment.IdTimeNavigation?.DateTimePlanRegist == null && shipment.IdTimeNavigation?.DateTimeFactRegist != null)
            {
                TextStatus = "Зарегистрирован";
                btn_arrive = "Visible";
                btn_left   = "Collapsed";
            }
        }
Exemplo n.º 2
0
        public KppShipments(DB.Shipment shipment)
        {
            IdShipment = shipment.IdShipment;
            Fio        = $"{shipment.IdDriverNavigation?.Family} {shipment.IdDriverNavigation?.Name} {shipment.IdDriverNavigation?.Patronymic}";
            Phone      = shipment.IdDriverNavigation?.Phone;
            if (shipment.IdTimeNavigation.DateTimeFactRegist.HasValue)
            {
                PlanDateFact       = shipment.IdTimeNavigation.DateTimeFactRegist.Value;
                PlanDateFactString = PlanDateFact.ToString(CultureInfo.GetCultureInfo("ru-ru"));
            }

            if (shipment.IdDriverNavigation.AutoNumber != null)
            {
                NumAuto = shipment.IdDriverNavigation.AutoNumber;
            }

            if (shipment.IdTimeNavigation?.DateTimeLeft != null)
            {
                TextStatus             = "Покинул склад";
                ArriveButtonVisibility = Visibility.Collapsed;
                LeftButtonVisibility   = Visibility.Collapsed;
            }
            else if (shipment.IdTimeNavigation?.DateTimeLeft == null && shipment.IdTimeNavigation?.DateTimeEndLoad != null)
            {
                TextStatus             = "Отгрузка завершена";
                LeftButtonVisibility   = Visibility.Visible;
                ArriveButtonVisibility = Visibility.Collapsed;
            }
            else if (shipment.IdTimeNavigation?.DateTimeEndLoad == null && shipment.IdTimeNavigation?.DateTimeLoad != null)
            {
                TextStatus             = "Отгрузка";
                ArriveButtonVisibility = Visibility.Collapsed;
                LeftButtonVisibility   = Visibility.Collapsed;
            }
            else if (shipment.IdTimeNavigation?.DateTimeLoad == null && shipment.IdTimeNavigation?.DateTimeArrive != null)
            {
                TextStatus             = "На территории склада";
                LeftButtonVisibility   = Visibility.Visible;
                ArriveButtonVisibility = Visibility.Collapsed;
            }
            else if (shipment.IdTimeNavigation?.DateTimeArrive == null && shipment.IdTimeNavigation?.DateTimeFactRegist != null)
            {
                TextStatus             = "Зарегистрирован";
                ArriveButtonVisibility = Visibility.Visible;
                LeftButtonVisibility   = Visibility.Collapsed;
            }
            else if (shipment.IdTimeNavigation?.DateTimeFactRegist == null && shipment.IdTimeNavigation?.DateTimePlanRegist != null)
            {
                TextStatus             = "";
                ArriveButtonVisibility = Visibility.Collapsed;
                LeftButtonVisibility   = Visibility.Collapsed;
            }
            else if (shipment.IdTimeNavigation?.DateTimePlanRegist == null && shipment.IdTimeNavigation?.DateTimeFactRegist != null)
            {
                TextStatus             = "Зарегистрирован";
                ArriveButtonVisibility = Visibility.Visible;
                LeftButtonVisibility   = Visibility.Collapsed;
            }
        }
Exemplo n.º 3
0
        public PrintShipments(DB.Shipment shipment)
        {
            IdShipment = shipment.IdShipment;
            if (shipment.IdDriverNavigation != null)
            {
                FioTelephone = $"{shipment.IdDriverNavigation.Family} {shipment.IdDriverNavigation.Name} {shipment.IdDriverNavigation.Patronymic} {shipment.IdDriverNavigation.Phone}";
            }

            DatePlan    = shipment.IdTimeNavigation.DateTimePlanRegist.HasValue ? shipment.IdTimeNavigation.DateTimePlanRegist.Value.ToString(CultureInfo.CurrentCulture) : "";
            DateArrive  = shipment.IdTimeNavigation.DateTimeArrive.HasValue ? shipment.IdTimeNavigation.DateTimeArrive.Value.ToString(CultureInfo.CurrentCulture) : "";
            DateLoad    = shipment.IdTimeNavigation.DateTimeLoad.HasValue ? shipment.IdTimeNavigation.DateTimeLoad.Value.ToString(CultureInfo.CurrentCulture) : "";
            DateEndLoad = shipment.IdTimeNavigation.DateTimeEndLoad.HasValue ? shipment.IdTimeNavigation.DateTimeEndLoad.Value.ToString(CultureInfo.CurrentCulture) : "";

            Contragent = shipment.IdContragentNavigation?.Name;
            Attorney   = shipment.IdDriverNavigation?.Attorney;
            Auto       = shipment.IdDriverNavigation?.Auto + " " + shipment.IdDriverNavigation?.AutoNumber;

            PlanDate = DatePlan;
            //PlanTime = DatePlan.ToShortTimeString();

            DateFact = shipment.IdTimeNavigation.DateTimeFactRegist.ToString();
            DateLeft = shipment.IdTimeNavigation.DateTimeLeft.ToString();
            Sklad    = "МВП";

            NumRealese      = shipment.NumRealese;
            PacketDocuments = shipment.PacketDocuments;
            TochkaLoad      = shipment.TochkaLoad;
            ServiceInfo     = shipment.ServiceInfo;


            Destination  = shipment.Destination;
            Nomenclature = shipment.Nomenclature;
            Size         = shipment.Size;
            CountPodons  = shipment.CountPodons;
            Family       = shipment.IdDriverNavigation?.Family;
            NumAuto      = shipment.IdDriverNavigation?.AutoNumber;

            TimeLoad = shipment.IdTimeNavigation.DateTimeLoad?.ToShortTimeString();
            TimeEnd  = shipment.IdTimeNavigation.DateTimeEndLoad?.ToShortTimeString();

            if (shipment.IdTimeNavigation.DateTimeLoad != null && shipment.IdTimeNavigation.DateTimeEndLoad != null)
            {
                DateTime date1 = shipment.IdTimeNavigation.DateTimeLoad.Value;
                DateTime date2 = shipment.IdTimeNavigation.DateTimeEndLoad.Value;
                var      res   = date2 - date1;
                TimeTotal = res.ToString(@"hh\:mm");
            }

            StoreKeeper = shipment.StoreKeeper;
            TypeLoad    = shipment.TypeLoad;
            Description = shipment.Description;
        }
Exemplo n.º 4
0
        public PlanShipment(DB.Shipment shipment)
        {
            IdShipment = shipment.IdShipment;
            FIO        = shipment.IdDriverNavigation?.Family + " " + shipment.IdDriverNavigation?.Name + " " + shipment.IdDriverNavigation?.Patronymic;
            Phone      = shipment.IdDriverNavigation?.Phone;
            if (shipment.IdTimeNavigation.DateTimePlanRegist.HasValue)
            {
                PlanDateTime       = shipment.IdTimeNavigation.DateTimePlanRegist.Value;
                PlanDateTimeString = PlanDateTime.ToString();
            }

            if (shipment.IdDriverNavigation.AutoNumber != null)
            {
                NumAuto = shipment.IdDriverNavigation.AutoNumber;
            }
        }
Exemplo n.º 5
0
        public PlanShipment(DB.Shipment shipment)
        {
            IdShipment = shipment.IdShipment;

            if (shipment.IdDriverNavigation != null)
            {
                Fio   = $"{shipment.IdDriverNavigation.Family} {shipment.IdDriverNavigation.Name} {shipment.IdDriverNavigation.Patronymic}";
                Phone = shipment.IdDriverNavigation.Phone;
            }

            if (shipment.IdTimeNavigation.DateTimePlanRegist.HasValue)
            {
                PlanDateTime       = shipment.IdTimeNavigation.DateTimePlanRegist.Value;
                PlanDateTimeString = PlanDateTime.ToString(CultureInfo.CurrentCulture);
            }

            if (shipment.IdDriverNavigation.AutoNumber != null)
            {
                NumAuto = shipment.IdDriverNavigation.AutoNumber;
            }
        }
        /// Добавить соответственно
        private void btn_add_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                using (DB.RegistrantCoreContext ef = new DB.RegistrantCoreContext())
                {
                    DB.Shipment shipment = new DB.Shipment();

                    if (cb_drivers.SelectedItem != null)
                    {
                        var test    = cb_drivers as ComboBox;
                        var current = test.SelectedItem as Models.Drivers;
                        shipment.IdDriver = current.IdDriver;
                    }

                    DB.Time time = new DB.Time();
                    shipment.IdTimeNavigation = time;

                    if (dt_plan.Value != null)
                    {
                        time.DateTimePlanRegist = dt_plan.Value;
                    }
                    if (dt_fact.Value != null)
                    {
                        time.DateTimeFactRegist = dt_fact.Value;
                    }
                    if (dt_arrive.Value != null)
                    {
                        time.DateTimeArrive = dt_arrive.Value;
                    }
                    if (dt_load.Value != null)
                    {
                        time.DateTimeLoad = dt_load.Value;
                    }
                    if (dt_endload.Value != null)
                    {
                        time.DateTimeEndLoad = dt_endload.Value;
                    }
                    if (dt_left.Value != null)
                    {
                        time.DateTimeLeft = dt_left.Value;
                    }

                    if (tb_numrealese.Text != null)
                    {
                        shipment.NumRealese = tb_numrealese.Text;
                    }
                    if (tb_packetdoc.Text != null)
                    {
                        shipment.PacketDocuments = tb_packetdoc.Text;
                    }
                    if (tb_tochkaload.Text != null)
                    {
                        shipment.TochkaLoad = tb_tochkaload.Text;
                    }
                    if (tb_CountPodons.Text != null)
                    {
                        shipment.CountPodons = tb_CountPodons.Text;
                    }
                    if (tb_nomencluture.Text != null)
                    {
                        shipment.Nomenclature = tb_nomencluture.Text;
                    }
                    if (tb_size.Text != null)
                    {
                        shipment.Size = tb_size.Text;
                    }
                    if (tb_Destination.Text != null)
                    {
                        shipment.Destination = tb_Destination.Text;
                    }
                    if (tb_typeload.Text != null)
                    {
                        shipment.TypeLoad = tb_typeload.Text;
                    }
                    if (tb_descript.Text != null)
                    {
                        shipment.Description = tb_descript.Text;
                    }
                    if (tb_storekeeper.Text != null)
                    {
                        shipment.StoreKeeper = tb_storekeeper.Text;
                    }

                    shipment.Active      = "1";
                    shipment.ServiceInfo = DateTime.Now + " " + App.ActiveUser + " добавил отгрузку";


                    ef.Add(shipment);
                    ef.SaveChanges();
                    Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Программное исключене", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Exemplo n.º 7
0
        public Shipments(DB.Shipment shipment)
        {
            IdShipment      = shipment.IdShipment;
            IdDriver        = shipment.IdDriver;
            NumRealese      = shipment.NumRealese;
            CountPodons     = shipment.CountPodons;
            PacketDocuments = shipment.PacketDocuments;
            TochkaLoad      = shipment.TochkaLoad;
            Nomenclature    = shipment.Nomenclature;
            Size            = shipment.Size;
            Destination     = shipment.Destination;
            TypeLoad        = shipment.TypeLoad;
            Description     = shipment.Description;
            StoreKeeper     = shipment.StoreKeeper;
            ServiceInfo     = shipment.ServiceInfo;
            Contragent      = shipment.IdContragentNavigation?.Name;

            Family     = shipment.IdDriverNavigation?.Family;
            Name       = shipment.IdDriverNavigation?.Name;
            Patronymic = shipment.IdDriverNavigation?.Patronymic;
            Fio        = $"{Family} {Name} {Patronymic}";
            Phone      = shipment.IdDriverNavigation?.Phone;

            if (shipment.IdTimeNavigation.DateTimePlanRegist.HasValue)
            {
                DateTimePlanRegist = shipment.IdTimeNavigation.DateTimePlanRegist.Value;
            }

            if (shipment.IdTimeNavigation.DateTimeFactRegist.HasValue)
            {
                DateTimeFactRegist = shipment.IdTimeNavigation.DateTimeFactRegist.Value;
            }

            if (shipment.IdTimeNavigation.DateTimeArrive.HasValue)
            {
                DateTimeArrive = shipment.IdTimeNavigation.DateTimeArrive.Value;
            }

            if (shipment.IdTimeNavigation.DateTimeArrive.HasValue)
            {
                DateTimeArrive = shipment.IdTimeNavigation.DateTimeArrive.Value;
            }
            if (shipment.IdTimeNavigation.DateTimeLoad.HasValue)
            {
                DateTimeLoad = shipment.IdTimeNavigation.DateTimeLoad.Value;
            }
            if (shipment.IdTimeNavigation.DateTimeEndLoad.HasValue)
            {
                DateTimeEndLoad = shipment.IdTimeNavigation.DateTimeEndLoad.Value;
            }
            if (shipment.IdTimeNavigation.DateTimeLeft.HasValue)
            {
                DateTimeLeft = shipment.IdTimeNavigation.DateTimeLeft.Value;
            }

            if (shipment.IdTimeNavigation.DateTimeLeft != null)
            {
                TextStatus = "Покинул склад (" + DateTimeLeft.ToString(CultureInfo.CurrentCulture) + ")";
            }
            else if (shipment.IdTimeNavigation?.DateTimeLeft == null && shipment.IdTimeNavigation?.DateTimeEndLoad != null)
            {
                TextStatus = "Отгрузка завершена (" + DateTimeEndLoad.ToString(CultureInfo.CurrentCulture) + ")";
            }
            else if (shipment.IdTimeNavigation?.DateTimeEndLoad == null && shipment.IdTimeNavigation?.DateTimeLoad != null)
            {
                TextStatus = "Отгрузка (" + DateTimeLoad.ToString(CultureInfo.CurrentCulture) + ")";
            }
            else if (shipment.IdTimeNavigation?.DateTimeLoad == null && shipment.IdTimeNavigation?.DateTimeArrive != null)
            {
                TextStatus = "На территории склада (" + DateTimeArrive.ToString(CultureInfo.CurrentCulture) + ")";
                Color      = "#FFF9C38B";
            }
            else if (shipment.IdTimeNavigation?.DateTimeArrive == null && shipment.IdTimeNavigation?.DateTimeFactRegist != null)
            {
                TextStatus = "Зарегистрирован (" + DateTimeFactRegist.ToString(CultureInfo.CurrentCulture) + ")";
                Color      = "#FFFFEEDC";
            }
            else if (shipment.IdTimeNavigation?.DateTimeFactRegist == null && shipment.IdTimeNavigation?.DateTimePlanRegist != null)
            {
                TextStatus = "";
            }
            else if (shipment.IdTimeNavigation?.DateTimePlanRegist == null && shipment.IdTimeNavigation?.DateTimeFactRegist != null)
            {
                TextStatus = "Зарегистрирован (" + DateTimeFactRegist.ToString(CultureInfo.CurrentCulture) + ")";
                Color      = "#FFFFEEDC";
            }
        }
Exemplo n.º 8
0
        /// Добавить соответственно
        private void btn_add_Click(object sender, RoutedEventArgs e)
        {
            if (cb_drivers.Text != "")
            {
                if (cb_contragent.Text != "")
                {
                    if (dt_plan.Value != null)
                    {
                        try
                        {
                            using (DB.RegistrantCoreContext ef = new DB.RegistrantCoreContext())
                            {
                                DB.Shipment shipment = new DB.Shipment();

                                if (cb_drivers.SelectedItem != null)
                                {
                                    var test    = cb_drivers as ComboBox;
                                    var current = test.SelectedItem as Models.Drivers;
                                    shipment.IdDriver = current.IdDriver;
                                }
                                else
                                {
                                    //Если водителя нет в списках
                                    DB.Driver driver = new DB.Driver();
                                    shipment.IdDriverNavigation = driver;
                                    var temp = SplitNames(cb_drivers.Text + " ");

                                    driver.Name        = temp.name.Replace(" ", "");
                                    driver.Family      = temp.family.Replace(" ", "");
                                    driver.Patronymic  = temp.patronomyc.Replace(" ", "");
                                    driver.AutoNumber  = tb_autonum.Text;
                                    driver.Attorney    = tb_attorney.Text;
                                    driver.Phone       = tb_phone.Text;
                                    driver.Auto        = tb_auto.Text;
                                    driver.Active      = "1";
                                    driver.ServiceInfo = DateTime.Now + " " + App.ActiveUser + " добавил водителя";
                                }

                                if (cb_contragent.SelectedItem != null)
                                {
                                    var test    = cb_contragent as ComboBox;
                                    var current = test.SelectedItem as DB.Contragent;
                                    shipment.IdContragent = current.IdContragent;
                                }
                                else
                                {
                                    DB.Contragent contragent = new DB.Contragent();
                                    contragent.Name                 = cb_contragent.Text;
                                    contragent.Active               = "1";
                                    contragent.ServiceInfo          = DateTime.Now + " " + App.ActiveUser + " добавил контрагента";
                                    shipment.IdContragentNavigation = contragent;
                                }


                                DB.Time time = new DB.Time();
                                shipment.IdTimeNavigation = time;

                                if (dt_plan.Value != null)
                                {
                                    time.DateTimePlanRegist = dt_plan.Value;
                                }
                                if (dt_fact.Value != null)
                                {
                                    time.DateTimeFactRegist = dt_fact.Value;
                                }
                                if (dt_arrive.Value != null)
                                {
                                    time.DateTimeArrive = dt_arrive.Value;
                                }
                                if (dt_load.Value != null)
                                {
                                    time.DateTimeLoad = dt_load.Value;
                                }
                                if (dt_endload.Value != null)
                                {
                                    time.DateTimeEndLoad = dt_endload.Value;
                                }
                                if (dt_left.Value != null)
                                {
                                    time.DateTimeLeft = dt_left.Value;
                                }

                                if (tb_numrealese.Text != null)
                                {
                                    shipment.NumRealese = tb_numrealese.Text;
                                }
                                if (tb_packetdoc.Text != null)
                                {
                                    shipment.PacketDocuments = tb_packetdoc.Text;
                                }
                                if (tb_tochkaload.Text != null)
                                {
                                    shipment.TochkaLoad = tb_tochkaload.Text;
                                }
                                if (tb_CountPodons.Text != null)
                                {
                                    shipment.CountPodons = tb_CountPodons.Text;
                                }
                                if (tb_nomencluture.Text != null)
                                {
                                    shipment.Nomenclature = tb_nomencluture.Text;
                                }
                                if (tb_size.Text != null)
                                {
                                    shipment.Size = tb_size.Text;
                                }
                                if (tb_Destination.Text != null)
                                {
                                    shipment.Destination = tb_Destination.Text;
                                }
                                if (tb_typeload.Text != null)
                                {
                                    shipment.TypeLoad = tb_typeload.Text;
                                }
                                if (tb_descript.Text != null)
                                {
                                    shipment.Description = tb_descript.Text;
                                }
                                if (tb_storekeeper.Text != null)
                                {
                                    shipment.StoreKeeper = tb_storekeeper.Text;
                                }

                                shipment.Active      = "1";
                                shipment.ServiceInfo = DateTime.Now + " " + App.ActiveUser + " добавил отгрузку";


                                ef.Add(shipment);
                                ef.SaveChanges();
                                Close();
                            }
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.ToString(), "Программное исключене", MessageBoxButton.OK, MessageBoxImage.Error);
                        }
                    }
                    else
                    {
                        MessageBox.Show("Дата плановой загрузки не заполнена!", "Внимание!", MessageBoxButton.OK, MessageBoxImage.Error);
                    }
                }
                else
                {
                    MessageBox.Show("Контрагент не выбран", "Внимание!", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
            else
            {
                MessageBox.Show("Водитель не выбран", "Внимание!", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Exemplo n.º 9
0
        private void btn_add_add_Click(object sender, RoutedEventArgs e)
        {
            if (cb_drivers.Text == "")
            {
                return;
            }

            try
            {
                using (DB.RegistrantCoreContext ef = new DB.RegistrantCoreContext())
                {
                    DB.Shipment shipment = new DB.Shipment();

                    if (cb_drivers.SelectedItem != null)
                    {
                        var test    = cb_drivers as ComboBox;
                        var current = test.SelectedItem as Models.Drivers;
                        shipment.IdDriver = current.IdDriver;
                    }
                    else
                    {
                        //Если водителя нет в списках
                        DB.Driver driver = new DB.Driver();
                        shipment.IdDriverNavigation = driver;
                        var temp = SplitNames(cb_drivers.Text + " ");

                        driver.Name        = temp.name.Replace(" ", "");
                        driver.Family      = temp.family.Replace(" ", "");
                        driver.Patronymic  = temp.patronomyc.Replace(" ", "");
                        driver.AutoNumber  = tb_autonum.Text;
                        driver.Attorney    = tb_attorney.Text;
                        driver.Phone       = tb_phone.Text;
                        driver.AutoNumber  = tb_autonum.Text;
                        driver.Passport    = tb_passport.Text;
                        driver.Active      = "1";
                        driver.ServiceInfo = DateTime.Now + " " + App.ActiveUser + " добавил водителя";
                    }

                    DB.Time time = new DB.Time();
                    time.DateTimeFactRegist = DateTime.Now;

                    shipment.IdTimeNavigation = time;

                    shipment.Description = tb_info.Text;
                    shipment.Active      = "1";
                    shipment.ServiceInfo = DateTime.Now + " " + App.ActiveUser + " добавил отгрузку";

                    ef.Add(shipment);
                    ef.SaveChanges();
                    ContentAdd.Hide();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Программное исключене", MessageBoxButton.OK, MessageBoxImage.Error);
            }

            /*
             * if (tb_family.Text != "")
             * {
             *  try
             *  {
             *      using (DB.RegistrantCoreContext ef = new DB.RegistrantCoreContext())
             *      {
             *          DB.Shipment shipment = new DB.Shipment();
             *          shipment.IdDriverNavigation = new DB.Driver();
             *          shipment.IdTimeNavigation = new DB.Time();
             *          shipment.IdDriverNavigation.Family = tb_family.Text;
             *          shipment.IdDriverNavigation.Name = tb_name.Text;
             *          shipment.IdDriverNavigation.Patronymic = tb_patronymic.Text;
             *          shipment.IdDriverNavigation.Phone = tb_phone.Text;
             *          shipment.IdDriverNavigation.AutoNumber = tb_autonum.Text;
             *          shipment.IdDriverNavigation.Passport = tb_passport.Text;
             *          shipment.IdDriverNavigation.Info = tb_info.Text;
             *          shipment.IdDriverNavigation.ServiceInfo = DateTime.Now + " " + App.ActiveUser + " добавил карточку водителя";
             *
             *          shipment.IdTimeNavigation.DateTimeFactRegist = DateTime.Now;
             *
             *          shipment.ServiceInfo = DateTime.Now + " " + App.ActiveUser + " каскадное добавление с карточкой водителя";
             *
             *          ef.Add(shipment);
             *          ef.SaveChanges();
             *          ContentAdd.Hide();
             *          btn_refresh_Click(sender, e);
             *      }
             *  }
             *  catch (Exception ex)
             *  {
             *      ((MainWindow)System.Windows.Application.Current.MainWindow).ContentErrorText.ShowAsync();
             *      ((MainWindow)System.Windows.Application.Current.MainWindow).text_debuger.Text = ex.ToString();
             *  }
             * }
             * else
             * {
             *  MessageBox.Show("Введите хотябы фамилию водителя!", "Внимание!", MessageBoxButton.OK, MessageBoxImage.Error);
             * }*/
        }