Esempio n. 1
0
        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            StringBuilder errorstring = new StringBuilder();

            _currentWorkPlace.FK_Room = 15;

            if (errorstring.Length > 0)
            {
                MessageBox.Show(errorstring.ToString());
                return;
            }
            if (_currentWorkPlace.id == 0)
            {
                AccountingForConsumablesEntities.GetContext().WorkPlace.Add(_currentWorkPlace);
            }

            try
            {
                AccountingForConsumablesEntities.GetContext().SaveChanges();
                MessageBox.Show("Информация сохранена");
                ManagerOfFrame.MainFrame.GoBack();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Esempio n. 2
0
        public void loadWorker()
        {
            Worker Wrk = AccountingForConsumablesEntities.GetContext().Worker.Where(w => w.id == SenderMail.IntId).FirstOrDefault();

            if (Wrk.Position.PositionName == "Менеджер по персоналу")
            {
                WorkerBtn.Visibility     = Visibility.Visible;
                OrderBtn.Visibility      = Visibility.Collapsed;
                ConsumableBtn.Visibility = Visibility.Collapsed;
                RoomBtn.Visibility       = Visibility.Collapsed;
                ManagerOfFrame.MainFrame.Navigate(new WorkersS());
            }
            else if (Wrk.Position.PositionName.Contains("Администратор"))
            {
                WorkerBtn.Visibility     = Visibility.Visible;
                OrderBtn.Visibility      = Visibility.Visible;
                ConsumableBtn.Visibility = Visibility.Visible;
                RoomBtn.Visibility       = Visibility.Visible;
                FrameOfVision.Navigate(new ConsumPageAbout());
            }
            else
            {
                WorkerBtn.Visibility     = Visibility.Collapsed;
                OrderBtn.Visibility      = Visibility.Visible;
                ConsumableBtn.Visibility = Visibility.Visible;
                RoomBtn.Visibility       = Visibility.Visible;
                FrameOfVision.Navigate(new ConsumPageAbout());
            }
            if (Wrk.CheckFirstVisit == true)
            {
                PasswordWindow psd = new PasswordWindow();
                psd.ShowDialog();
            }
        }
Esempio n. 3
0
        private void BtnDel_Click(object sender, RoutedEventArgs e)
        {
            var EquipmentForRemoving = DGridConsumable.SelectedItems.Cast <MaterialCard>().ToList();

            if (CheckForDel(EquipmentForRemoving.Count) == true)
            {
                if (MessageBox.Show($"Вы точно хотите удалить следующие {EquipmentForRemoving.Count} элементов?", "Внимание",
                                    MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
                {
                    try
                    {
                        AccountingForConsumablesEntities.GetContext().MaterialCard.RemoveRange(EquipmentForRemoving);
                        AccountingForConsumablesEntities.GetContext().SaveChanges();
                        MessageBox.Show("Данные удалены");
                        DGridConsumable.ItemsSource = AccountingForConsumablesEntities.GetContext().MaterialCard.ToList();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message.ToString());
                    }
                }
            }
            else
            {
                return;
            }
        }
Esempio n. 4
0
        private void Manufacturer_DropDownClosed(object sender, EventArgs e)
        {
            var name1 = AccountingForConsumablesEntities.GetContext().OrderedMaterial.Distinct().ToList();
            var name  = AccountingForConsumablesEntities.GetContext().OrderedMaterial.Select(s => s.MaterialCard.id).Distinct().ToArray();

            for (int i = 0; i < name.Count(); i++)
            {
                int             stdasd = name[i];
                int             tbs    = AccountingForConsumablesEntities.GetContext().OrderedMaterial.Where(w => w.FK_MaterialCard == stdasd).Sum(s => s.OrderedQuantity);
                OrderedMaterial tasd   = name1.Where(s => s.FK_MaterialCard == stdasd).FirstOrDefault();
                OrderedMaterial card   = new OrderedMaterial()
                {
                    FK_MaterialCard = tasd.FK_MaterialCard, MaterialCard = tasd.MaterialCard, counter = tbs, FK_Order = 1
                };
                tbd.Add(card);
            }
            if (ManufacturerCmb.SelectedIndex == 0)
            {
                DGridConsumable.ItemsSource = tbd;
            }
            else if (NameTxt.Text == "")
            {
                DGridConsumable.ItemsSource = tbd.
                                              Where(w => w.MaterialCard.Materials.Manufacturer.ManufacturerName == ManufacturerCmb.Text).ToList();
            }
            else
            {
                DGridConsumable.ItemsSource = tbd.Where(w => w.MaterialCard.Materials.MaterialName.StartsWith(NameTxt.Text) && w.MaterialCard.Materials.Manufacturer.ManufacturerName == ManufacturerCmb.Text).ToList();
            }
        }
Esempio n. 5
0
        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            StringBuilder errors = new StringBuilder();

            if (errors.Length > 0)
            {
                MessageBox.Show(errors.ToString());
                return;
            }
            if (_currentMat.id == 0)
            {
                AccountingForConsumablesEntities.GetContext().ReplenishmentOfMaterials.Add(_currentMat);
            }

            try
            {
                AccountingForConsumablesEntities.GetContext().SaveChanges();
                MessageBox.Show("Информация сохранена");
                ManagerOfFrame.MainFrame.GoBack();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Esempio n. 6
0
        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            StringBuilder errorstring = new StringBuilder();

            _currentMaterialCard.DateOfDelivery = DateTime.Now;
            if (string.IsNullOrWhiteSpace(_currentMaterialCard.InventNumber))
            {
                errorstring.AppendLine("Укажите инвентаризационный номер");
            }


            if (errorstring.Length > 0)
            {
                MessageBox.Show(errorstring.ToString());
                return;
            }
            if (_currentMaterialCard.id == 0)
            {
                AccountingForConsumablesEntities.GetContext().MaterialCard.Add(_currentMaterialCard);
            }

            try
            {
                AccountingForConsumablesEntities.GetContext().SaveChanges();
                MessageBox.Show("Информация сохранена");
                ManagerOfFrame.MainFrame.GoBack();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Esempio n. 7
0
        /// <summary>
        /// Обработка нажатие на кнопку сохранить
        /// Производится проверка на пустые поля и выборы из списков
        /// После успешной проверки добавляется либо новая запись либо редактируется существующая
        /// </summary>

        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            string        Operations  = "Редкатирование данных";
            StringBuilder errorstring = new StringBuilder();

            _currentWorkPlace.FK_Room = 15;
            if (string.IsNullOrEmpty(_currentWorkPlace.NumberPlace.ToString()))
            {
                errorstring.AppendLine("Номер");
            }
            if (FIOBox.SelectedItem == null)
            {
                errorstring.AppendLine("ФИО");
            }
            if (errorstring.Length > 0)
            {
                if (errorstring.ToString().Contains("ФИО"))
                {
                    FIOFail.Visibility = Visibility.Visible;
                    FIOFail.Content    = "Выберите ФИО сотрудника";
                }
                else
                {
                    FIOFail.Visibility = Visibility.Collapsed;
                }
                if (errorstring.ToString().Contains("Номер"))
                {
                    WorkPlaceFail.Visibility = Visibility.Visible;
                    WorkPlaceFail.Content    = "Введите номер рабочего места";
                }
                else
                {
                    WorkPlaceFail.Visibility = Visibility.Collapsed;
                }
                return;
            }
            if (_currentWorkPlace.id == 0)
            {
                AccountingForConsumablesEntities.GetContext().WorkPlace.Add(_currentWorkPlace);

                Operations = "Добавление нового помещения";
            }
            try
            {
                AccountingForConsumablesEntities.GetContext().SaveChanges();
                MessageBox.Show("Информация сохранена");
                AccountingForConsumablesEntities.GetContext().OperationHystory.Add(new OperationHystory()
                {
                    FK_Worker = SenderMail.IntId, Operation = Operations, DateTimeOfOperation = DateTime.Now
                });
                AccountingForConsumablesEntities.GetContext().SaveChanges();
                ManagerOfFrame.MainFrame.GoBack();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Esempio n. 8
0
 public static AccountingForConsumablesEntities GetContext()
 {
     if (_context == null)
     {
         _context = new AccountingForConsumablesEntities();
     }
     return(_context);
 }
Esempio n. 9
0
 /// <summary>
 /// Инициализация компонентов
 /// </summary>
 public InventarizationPageAbout(Inventarization currentInventarization)
 {
     InitializeComponent();
     CmbFIO.Text                 = currentInventarization.Worker.FIO;
     CmbPlace.Text               = currentInventarization.Warehouse.id.ToString();
     CmbPosition.Text            = currentInventarization.Worker.Position.PositionName;
     DGridConsumable.ItemsSource = AccountingForConsumablesEntities.GetContext().MaterialInInventarization.Where(w => w.FK_Inventarization == currentInventarization.id).ToList();
 }
Esempio n. 10
0
 private void Page_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     if (Visibility == Visibility.Visible)
     {
         AccountingForConsumablesEntities.GetContext().ChangeTracker.Entries().ToList().ForEach(p => p.Reload());
         DGridConsumable.ItemsSource = AccountingForConsumablesEntities.GetContext().MaterialCard.ToList();
     }
 }
Esempio n. 11
0
 /// <summary>
 /// Инициализация компонентов
 /// </summary>
 public OrderMorePage(Order SelectedMat)
 {
     InitializeComponent();
     DGridConsumable.ItemsSource = AccountingForConsumablesEntities.GetContext().OrderedMaterial.Where(w => w.FK_Order == SelectedMat.id).ToList();
     _currentMat             = SelectedMat;
     DataContext             = _currentMat;
     CmbFIO.ItemsSource      = AccountingForConsumablesEntities.GetContext().Worker.ToList();
     CmbPlace.ItemsSource    = AccountingForConsumablesEntities.GetContext().WorkPlace.ToList();
     CmbPosition.ItemsSource = AccountingForConsumablesEntities.GetContext().Position.ToList();
 }
Esempio n. 12
0
 public OperationHistoryPage()
 {
     InitializeComponent();
     WorkerLst = AccountingForConsumablesEntities.GetContext().Worker.ToList();
     WorkerLst.Insert(0, new Worker {
         FirstName = "All"
     });
     FIOCmb.ItemsSource          = WorkerLst;
     DGridConsumable.ItemsSource = AccountingForConsumablesEntities.GetContext().OperationHystory.ToList();
 }
Esempio n. 13
0
 public ConsumablePage()
 {
     InitializeComponent();
     DGridConsumable.ItemsSource = AccountingForConsumablesEntities.GetContext().MaterialCard.ToList();
     ManufacturerLst             = AccountingForConsumablesEntities.GetContext().Manufacturer.ToList();
     ManufacturerLst.Insert(0, new Manufacturer {
         ManufacturerName = "All"
     });
     ManufacturerCmb.ItemsSource = ManufacturerLst;
 }
Esempio n. 14
0
 /// <summary>
 /// Инициализация компонентов
 /// </summary>
 public WorkersS()
 {
     InitializeComponent();
     DGridConsumable.ItemsSource = AccountingForConsumablesEntities.GetContext().Worker.ToList();
     GenderLst = AccountingForConsumablesEntities.GetContext().Gender.ToList();
     GenderLst.Insert(0, new Gender {
         GenderName = "All"
     });
     GenderCmb.ItemsSource = GenderLst;
 }
Esempio n. 15
0
 public InventarizationPageAbout(Inventarization currentInventarization)
 {
     InitializeComponent();
     if (currentInventarization != null)
     {
         _currentMat = AccountingForConsumablesEntities.GetContext().MaterialInInventarization.Where(w => w.FK_Inventarization == currentInventarization.id).FirstOrDefault();
     }
     DataContext = _currentMat;
     DGridConsumable.ItemsSource = AccountingForConsumablesEntities.GetContext().MaterialInInventarization.Where(w => w.FK_Inventarization == currentInventarization.id).ToList();
 }
Esempio n. 16
0
 /// <summary>
 /// Инициализация компонентов
 /// </summary>
 public OrderInWarehouse()
 {
     InitializeComponent();
     WorkerLst = AccountingForConsumablesEntities.GetContext().Worker.ToList();
     WorkerLst.Insert(0, new Worker {
         FirstName = "All"
     });
     FIOCmb.ItemsSource          = WorkerLst;
     DGridConsumable.ItemsSource = AccountingForConsumablesEntities.GetContext().ReplenishmentOfMaterials.ToList();
 }
Esempio n. 17
0
 /// <summary>
 /// Логика взаимодействия для WorkWithWorkersData.xaml
 /// </summary>
 public EditRoom(Room selectedRoom)
 {
     InitializeComponent();
     if (selectedRoom != null)
     {
         _currentRoom = selectedRoom;
     }
     DataContext = _currentRoom;
     TypeOfRoomCmb.ItemsSource = AccountingForConsumablesEntities.GetContext().TypeOfRoom.ToList();
 }
Esempio n. 18
0
 public EditOrderInWarehouse(ReplenishmentOfMaterials selectedMat)
 {
     InitializeComponent();
     if (selectedMat != null)
     {
         _currentMat = selectedMat;
     }
     DataContext       = _currentMat;
     Fasds.ItemsSource = AccountingForConsumablesEntities.GetContext().Worker.ToList();
 }
Esempio n. 19
0
        public void loadWorker()
        {
            Worker Wrk = AccountingForConsumablesEntities.GetContext().Worker.Where(w => w.id == SenderMail.IntId).FirstOrDefault();

            if (Wrk.CheckFirstVisit == true)
            {
                PasswordWindow psd = new PasswordWindow();
                psd.ShowDialog();
            }
        }
Esempio n. 20
0
 public WorkWithOrder(WorkPlace SelectedWork)
 {
     InitializeComponent();
     if (SelectedWork != null)
     {
         _currentWorkPlace = SelectedWork;
     }
     DataContext        = _currentWorkPlace;
     FIOBox.ItemsSource = AccountingForConsumablesEntities.GetContext().Worker.ToList();
 }
Esempio n. 21
0
 /// <summary>
 /// Инициализация компонентов
 /// </summary>
 public NewInventPAge(Inventarization SelectedInvent)
 {
     InitializeComponent();
     if (SelectedInvent != null)
     {
         _currentInventarization = SelectedInvent;
     }
     DataContext = _currentInventarization;
     WarehouseCmb.ItemsSource = AccountingForConsumablesEntities.GetContext().Warehouse.ToList();
     FIOCmb.ItemsSource       = AccountingForConsumablesEntities.GetContext().Worker.ToList();
 }
Esempio n. 22
0
 /// <summary>
 /// Блоки сортировки и поиска данных по тексту
 /// </summary>
 private void FIO_DropDownClosed(object sender, EventArgs e)
 {
     if (FIOCmb.SelectedIndex == 0)
     {
         DGridConsumable.ItemsSource = AccountingForConsumablesEntities.GetContext().ReplenishmentOfMaterials.ToList();
     }
     else
     {
         DGridConsumable.ItemsSource = AccountingForConsumablesEntities.GetContext().ReplenishmentOfMaterials.Where(w => w.Worker.FIO.StartsWith(FIOCmb.Text.Substring(0, FIOCmb.Text.Length - 4))).ToList();
     }
 }
Esempio n. 23
0
 private void FIOCmb_DropDownClosed(object sender, EventArgs e)
 {
     if (FIOCmb.SelectedIndex == 0)
     {
         DGridConsumable.ItemsSource = AccountingForConsumablesEntities.GetContext().OperationHystory.ToList();
     }
     else
     {
         DGridConsumable.ItemsSource = AccountingForConsumablesEntities.GetContext().OperationHystory.Where(w => w.Worker.FirstName.StartsWith(FIOCmb.Text.Substring(0, FIOCmb.Text.Length - 4))).ToList();
     }
 }
Esempio n. 24
0
 public WorkWithInvent(Inventarization SelectedWork)
 {
     InitializeComponent();
     if (SelectedWork != null)
     {
         _currentWorkPlace = SelectedWork;
     }
     DataContext              = _currentWorkPlace;
     FIOBox.ItemsSource       = AccountingForConsumablesEntities.GetContext().Worker.ToList();
     WarehouseCmb.ItemsSource = AccountingForConsumablesEntities.GetContext().Warehouse.ToList();
 }
Esempio n. 25
0
 /// <summary>
 /// Инициализация компонентов
 /// </summary>
 public WorkWithWorkersData(Worker SelectedWork)
 {
     InitializeComponent();
     if (SelectedWork != null)
     {
         _currentWorker = SelectedWork;
     }
     DataContext = _currentWorker;
     ComboPosition.ItemsSource = AccountingForConsumablesEntities.GetContext().Position.ToList();
     ComboStatus.ItemsSource   = AccountingForConsumablesEntities.GetContext().StatusOfWorker.ToList();
     GenderBox.ItemsSource     = AccountingForConsumablesEntities.GetContext().Gender.ToList();
 }
Esempio n. 26
0
        /// <summary>
        /// Обработка нажатие на кнопку сохранить
        /// Производится проверка на пустые поля и выборы из списков
        /// После успешной проверки добавляется либо новая запись либо редактируется существующая
        /// </summary>
        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            string        Operations = "Добавление новой инвентаризации";
            StringBuilder errors     = new StringBuilder();

            if (WarehouseCmb.SelectedItem == null)
            {
                errors.AppendLine("Хранилище");
            }
            if (FIOCmb.SelectedItem == null)
            {
                errors.AppendLine("ФИО");
            }
            if (errors.ToString().Length > 0)
            {
                if (errors.ToString().Contains("Хранилище"))
                {
                    WarehouseFail.Visibility = Visibility.Visible;
                    WarehouseFail.Content    = "Выберите номер хранилища";
                }
                else
                {
                    WarehouseFail.Visibility = Visibility.Collapsed;
                }
                if (errors.ToString().Contains("ФИО"))
                {
                    FIOFail.Visibility = Visibility.Visible;
                    FIOFail.Content    = "Выберите сотрудника";
                }
                else
                {
                    FIOFail.Visibility = Visibility.Collapsed;
                }
                return;
            }
            try
            {
                AccountingForConsumablesEntities.GetContext().Inventarization.Add(_currentInventarization);
                AccountingForConsumablesEntities.GetContext().SaveChanges();
                MessageBox.Show("Информация сохранена");
                AccountingForConsumablesEntities.GetContext().OperationHystory.Add(new OperationHystory()
                {
                    FK_Worker = SenderMail.IntId, Operation = Operations, DateTimeOfOperation = DateTime.Now
                });
                AccountingForConsumablesEntities.GetContext().SaveChanges();
                ManagerOfFrame.MainFrame.GoBack();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Esempio n. 27
0
        /// <summary>
        /// Обработка нажатие на кнопку сохранить
        /// Производится проверка на пустые поля и выборы из списков
        /// После успешной проверки добавляется либо новая запись либо редактируется существующая
        /// </summary>

        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            StringBuilder errorstring = new StringBuilder();

            if (TypeOfRoomCmb.SelectedItem == null)
            {
                errorstring.AppendLine("Тип");
            }
            if (string.IsNullOrEmpty(_currentRoom.NumberOfRoom.ToString()))
            {
                errorstring.AppendLine("Номер");
            }

            if (errorstring.Length > 0)
            {
                if (errorstring.ToString().Contains("Тип"))
                {
                    TypeOfRoomFail.Visibility = Visibility.Visible;
                    TypeOfRoomFail.Content    = "Выберите тип помещения";
                }
                else
                {
                    TypeOfRoomFail.Visibility = Visibility.Collapsed;
                }
                if (errorstring.ToString().Contains("Номер"))
                {
                    NumberFail.Visibility = Visibility.Visible;
                    NumberFail.Content    = "Введите номер";
                }
                else
                {
                    NumberFail.Visibility = Visibility.Collapsed;
                }
                return;
            }
            if (_currentRoom.id == 0)
            {
                AccountingForConsumablesEntities.GetContext().Room.Add(_currentRoom);
            }

            try
            {
                AccountingForConsumablesEntities.GetContext().SaveChanges();
                MessageBox.Show("Информация сохранена");
                ManagerOfFrame.MainFrame.GoBack();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Esempio n. 28
0
 public ConsumablePageWorkWithData(MaterialCard SelectedMCard)
 {
     InitializeComponent();
     if (SelectedMCard != null)
     {
         _currentMaterialCard = SelectedMCard;
     }
     DataContext                 = _currentMaterialCard;
     CmbGroup.ItemsSource        = AccountingForConsumablesEntities.GetContext().MaterialGroup.ToList();
     CmbManufacturer.ItemsSource = AccountingForConsumablesEntities.GetContext().Manufacturer.ToList();
     CmbUnit.ItemsSource         = AccountingForConsumablesEntities.GetContext().Unit.ToList();
     CmbNameMaterial.ItemsSource = AccountingForConsumablesEntities.GetContext().Materials.ToList();
 }
Esempio n. 29
0
        /// <summary>
        /// Блок проверки введеных данных
        /// После проверки данных данные необходимые грузятся в приложение
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var idCheck      = AccountingForConsumablesEntities.GetContext().Worker.Where(w => w.Login.Equals(LoginTextBX.Text) && w.Password.Equals(PasswordTextBX.Password)).Select(s => s.id).FirstOrDefault();
            var idChecklogin = AccountingForConsumablesEntities.GetContext().Worker.Where(w => w.Login.Equals(LoginTextBX.Text)).Select(s => s.id).FirstOrDefault();

            if (AuPage.LoginCheck(LoginTextBX.Text) && AuPage.PasswordCheck(PasswordTextBX.Password))
            {
                Fail1.Visibility = Visibility.Visible;
                Fail1.Content    = "Введите логин";
                Fail2.Visibility = Visibility.Visible;
                Fail2.Content    = "Введите пароль";
            }
            else if (AuPage.LoginCheck(LoginTextBX.Text))
            {
                Fail1.Visibility = Visibility.Visible;
                Fail1.Content    = "Введите логин";
            }
            else if (AuPage.PasswordCheck(PasswordTextBX.Password))
            {
                Fail2.Content    = "Введите пароль";
                Fail2.Visibility = Visibility.Visible;
            }
            else
            {
                if (idChecklogin == 0)
                {
                    GlobarFail.Visibility = Visibility.Visible;
                    GlobarFail.Content    = "Пользователь не найден";
                }
                else
                {
                    if (idCheck == 0)
                    {
                        GlobarFail.Visibility = Visibility.Visible;
                    }
                    else
                    {
                        string Code = Class.SenderCode();
                        Class.senderMAil(AccountingForConsumablesEntities.GetContext().Worker.Where(w => w.id == idCheck).Select(s => s.Email).FirstOrDefault(), Code);
                        SenderMail.IntId   = AccountingForConsumablesEntities.GetContext().Worker.Where(w => w.id == idCheck).Select(s => s.id).FirstOrDefault();
                        SenderMail.PosName = AccountingForConsumablesEntities.GetContext().Worker.Where(w => w.id == idCheck).Select(s => s.Position.PositionName).FirstOrDefault();
                        AccountingForConsumablesEntities.GetContext().OperationHystory.Add(new OperationHystory()
                        {
                            FK_Worker = SenderMail.IntId, Operation = "Авторизация в системе", DateTimeOfOperation = DateTime.Now
                        });
                        AccountingForConsumablesEntities.GetContext().SaveChanges();
                        ManagerOfFrame.LogFrame.Navigate(new AutherizationPage(Code));
                    }
                }
            }
        }
Esempio n. 30
0
        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                AccountingForConsumablesEntities.GetContext().SaveChanges();
                MessageBox.Show("Информация сохранена");
                ManagerOfFrame.MainFrame.GoBack();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }