Пример #1
0
 public KeyListPage(Models.Event tatEvent)
 {
     InitializeComponent();
     tatEvent1             = tatEvent;
     KeyListDG.ItemsSource = TatarCulturDbEntities.GetContext().Keys.Where(p => p.IdEvent == tatEvent.IdEvent).OrderBy(p => p.KeyEvent).ToList();
     DataContext           = _currentKey;
 }
Пример #2
0
        public PageObject(Models.Object tatObject)
        {
            InitializeComponent();
            if (tatObject != null)
            {
                _currentObject = tatObject;
                object1        = tatObject;
            }

            this.DataContext           = _currentObject;
            ListBoxComment.ItemsSource = TatarCulturDbEntities.GetContext().Comments.Where(p => p.IdObject == tatObject.IdObject).OrderBy(p => p.IdComment).ToList();
            List <Comment> comments = TatarCulturDbEntities.GetContext().Comments.ToList();

            Manager.idObject = _currentObject.IdObject;


            if (Manager.idUser == 0)
            {
                BtnComment.IsEnabled      = false;
                labelAttention.Visibility = Visibility.Visible;
            }
            else
            {
                BtnComment.IsEnabled      = true;
                labelAttention.Visibility = Visibility.Collapsed;
            }
        }
Пример #3
0
        private void LoadData()
        {
            var event1 = TatarCulturDbEntities.GetContext().Events.ToList();

            LViewEvent.ItemsSource = TatarCulturDbEntities.GetContext().Events.ToList();
            _itemcount             = LViewEvent.Items.Count;
        }
Пример #4
0
        private void BtnSaveClick(object sender, RoutedEventArgs e)
        {
            StringBuilder _error = CheckFields();

            if (_error.Length > 0)
            {
                MessageBox.Show(_error.ToString());
                return;
            }
            if (_currentType.IdType == 0)
            {
                TatarCulturDbEntities.GetContext().Types.Add(_currentType);
            }

            try
            {
                TatarCulturDbEntities.GetContext().SaveChanges();
                MessageBox.Show("Запись Изменена");
                Manager.MainFrame.GoBack();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
            Manager.MainFrame.GoBack();
        }
Пример #5
0
        private void LViewEventSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (LViewEvent.SelectedIndex >= 0)
            {
                MessageBoxResult x = MessageBox.Show("Вы действительно купить?",
                                                     "Выйти", MessageBoxButton.YesNo, MessageBoxImage.Question);
                if (x == MessageBoxResult.Yes)
                {
                    var   user = Manager.idUser;
                    Event eve  = (LViewEvent.SelectedItem as Event);

                    List <User> users = TatarCulturDbEntities.GetContext().Users.ToList();
                    _currentUser = users.FirstOrDefault(p => p.IdUser == user);
                    var keys = TatarCulturDbEntities.GetContext().Keys.Where(p => p.IdEvent == eve.IdEvent).ToList();
                    var key  = keys.FirstOrDefault(p => p.Active == false);

                    var coin = eve.Coin - _currentUser.Coin;

                    StringBuilder s = new StringBuilder();
                    if (_currentUser.Coin == null)
                    {
                        s.AppendLine("У вас не хватает монет");
                    }
                    if (_currentUser.Coin < eve.Coin)
                    {
                        s.AppendLine("У вас не хватает монет");
                    }
                    if (_currentUser.Coin == 0)
                    {
                        s.AppendLine("У вас нет монет");
                    }

                    if (s.Length > 0)
                    {
                        MessageBox.Show(s.ToString());
                        return;
                    }
                    if (_currentSale.IdSale == 0)
                    {
                        _currentSale.SaleDate = DateTime.Now;
                        _currentUser.Coin     = _currentUser.Coin - coin;
                        _currentSale.IdKey    = key.IdKey;
                        _currentSale.IdUser   = user;
                        TatarCulturDbEntities.GetContext().Sales.Add(_currentSale);

                        _currentKey        = key;
                        _currentKey.Active = true;
                    }
                    try
                    {
                        TatarCulturDbEntities.GetContext().SaveChanges();
                        MessageBox.Show($"Куплено!");
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message.ToString());
                    }
                }
            }
        }
Пример #6
0
        private void UpdateData()
        {
            var _currentObject = TatarCulturDbEntities.GetContext().Objects.OrderBy(p => p.Name).ToList();

            if (ComboType.SelectedIndex > 0)
            {
                _currentObject = _currentObject.Where(p => p.IdType == (ComboType.SelectedItem as Models.Type).IdType).ToList();
            }

            _currentObject = _currentObject.Where(p => p.Name.ToLower().Contains(TBoxSearch.Text.ToLower())).ToList();
            MapTat.Children.Clear();
            foreach (Models.Object obj in _currentObject)
            {
                Location pinLocation       = new Location((double)obj.Latitude, (double)obj.Longitude);
                Location pinLocationCenter = new Location(55.60307988301807, 49.586290315150926);
                var      pin = new Pushpin();
                pin.ToolTip  = $"{obj.Name}";
                pin.Location = pinLocation;

                MapTat.Children.Add(pin);
                MapTat.ZoomLevel = 8;
                MapTat.Center    = pinLocationCenter;
            }
            LViewObject.ItemsSource = _currentObject;
            TextBlockCount.Text     = $"Результат запроса: {_currentObject.Count} записей из {_itemcount}";
        }
Пример #7
0
        private void BtnSaveClick(object sender, RoutedEventArgs e)
        {
            StringBuilder s = new StringBuilder();

            if (string.IsNullOrWhiteSpace(tbComment.Text))
            {
                s.AppendLine("Поле название пустое");
            }

            _comment.IdObject = Manager.idObject;
            _comment.IdUser   = Manager.idUser;
            _comment.Star     = (int)ComboBoxRating.SelectedItem;

            if (_comment.IdComment == 0)
            {
                TatarCulturDbEntities.GetContext().Comments.Add(_comment);
            }

            try
            {
                TatarCulturDbEntities.GetContext().SaveChanges();
                MessageBox.Show("Запись Изменена");
                Manager.MainFrame.GoBack();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }

            Manager.MainFrame.GoBack();
        }
Пример #8
0
        private void BtnDeleteClick(object sender, RoutedEventArgs e)
        {
            var selectedEvent = EventListDG.SelectedItems.Cast <Models.Event>().ToList();
            MessageBoxResult messageBoxResult = MessageBox.Show($"Удалить {selectedEvent.Count()} записей???", "Удаление", MessageBoxButton.OKCancel, MessageBoxImage.Question);

            if (messageBoxResult == MessageBoxResult.OK)
            {
                try
                {
                    Event x = selectedEvent [0];
                    if (x.Keys.Count > 0)
                    {
                        throw new Exception("Есть связанные записи c ключами");
                    }
                    TatarCulturDbEntities.GetContext().Events.Remove(x);
                    TatarCulturDbEntities.GetContext().SaveChanges();
                    MessageBox.Show("Записи удалены");

                    List <Event> events =
                        TatarCulturDbEntities.GetContext().Events.OrderBy(p =>
                                                                          p.Name).ToList();
                    EventListDG.ItemsSource = null;
                    EventListDG.ItemsSource = events;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message.ToString(), "Ошибка удаления", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
Пример #9
0
 private void PageIsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     if (Visibility == Visibility.Visible)
     {
         TatarCulturDbEntities.GetContext().ChangeTracker.Entries().ToList().ForEach(p => p.Reload());
     }
 }
Пример #10
0
        private void BtnSaveClick(object sender, RoutedEventArgs e)
        {
            StringBuilder _error = CheckFields();

            if (_error.Length > 0)
            {
                MessageBox.Show(_error.ToString());
                return;
            }
            if (_currentKey.IdKey == 0)
            {
                _currentKey.IdEvent = tatEvent1.IdEvent;
                _currentKey.Active  = false;
                TatarCulturDbEntities.GetContext().Keys.Add(_currentKey);
            }

            try
            {
                TatarCulturDbEntities.GetContext().SaveChanges();
                MessageBox.Show($"Ключь {_currentKey.KeyEvent} сохранен!");
            }
            catch (Exception ex)
            {
                MessageBox.Show($"{_currentKey.IdKey} {_currentKey.IdEvent} {_currentKey.Active} {_currentKey.KeyEvent}");
                MessageBox.Show(ex.Message.ToString());
            }
            Manager.MainFrame.GoBack();
        }
Пример #11
0
        private void BtnSaveClick(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(tbCode.Text))
            {
                MessageBox.Show("Поле пустое");
            }
            if (Convert.ToInt32(tbCode.Text) == code)
            {
                if (_currentUser.IdUser == 0)
                {
                    _currentUser.IdRols = 3;
                    string photo = ChangePhotoName();
                    string dest  = _currentDirectory + photo;
                    File.Copy(_filePath, dest);
                    _currentUser.UserPhoto = photo;
                    TatarCulturDbEntities.GetContext().Users.Add(_currentUser);
                }
            }
            else
            {
                MessageBox.Show("Код не верный", "Ошибка");
            }
            try
            {
                TatarCulturDbEntities.GetContext().SaveChanges();
                MessageBox.Show("Информация сохранена");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }

            Owner.Show();
            Close();
        }
Пример #12
0
        private void PageIsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            TatarCulturDbEntities.GetContext().ChangeTracker.Entries().ToList().ForEach(p => p.Reload());
            List <Models.Key> tatKey = TatarCulturDbEntities.GetContext().Keys.Where(p => p.IdEvent == tatEvent1.IdEvent).OrderBy(p => p.KeyEvent).ToList();

            KeyListDG.ItemsSource = tatKey;
        }
Пример #13
0
 public PageUser(User user)
 {
     InitializeComponent();
     DataContext                = user;
     ListBoxKey.Visibility      = Visibility.Collapsed;
     ListBoxComment.ItemsSource = TatarCulturDbEntities.GetContext().Comments.Where(p => p.IdUser == user.IdUser).OrderBy(p => p.IdComment).ToList();
     ListBoxKey.ItemsSource     = TatarCulturDbEntities.GetContext().Sales.Where(p => p.IdUser == user.IdUser).OrderBy(p => p.IdSale).ToList();
 }
Пример #14
0
        private void BtnDeleteClick(object sender, RoutedEventArgs e)
        {
            var  selectedUser = UserListDG.SelectedItems.Cast <User>().ToList();
            User info         = selectedUser[0];

            StringBuilder s = new StringBuilder();

            if (info.Sales.Count > 0)
            {
                s.AppendLine($"Есть связанные записи c истории");
            }
            if (info.Comments.Count > 0)
            {
                s.AppendLine($"Есть связанные записи c комментариями");
            }

            if (s.Length > 0)
            {
                MessageBox.Show(s.ToString());
            }

            MessageBoxResult messageBoxResult = MessageBox.Show($"Удалить запись???", "Удаление", MessageBoxButton.OKCancel, MessageBoxImage.Question);


            if (messageBoxResult == MessageBoxResult.OK)
            {
                try
                {
                    User x = selectedUser[0];
                    if (x.Sales.Count > 0)
                    {
                        var  saleUser = TatarCulturDbEntities.GetContext().Sales.Where(p => p.IdUser == x.IdUser).ToList();
                        Sale sale     = saleUser[0];
                        TatarCulturDbEntities.GetContext().Sales.Remove(sale);
                    }
                    if (x.Comments.Count > 0)
                    {
                        var     commentUser = TatarCulturDbEntities.GetContext().Comments.Where(p => p.IdUser == x.IdUser).ToList();
                        Comment com         = commentUser[0];
                        TatarCulturDbEntities.GetContext().Comments.Remove(com);
                    }



                    TatarCulturDbEntities.GetContext().Users.Remove(x);
                    TatarCulturDbEntities.GetContext().SaveChanges();
                    MessageBox.Show("Записи удалены");

                    List <User> users = TatarCulturDbEntities.GetContext().Users.OrderBy(p => p.Login).ToList();
                    UserListDG.ItemsSource = null;
                    UserListDG.ItemsSource = users;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message.ToString(), "Ошибка удаления", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
Пример #15
0
 private void PageIsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     if (Visibility == Visibility.Visible)
     {
         TatarCulturDbEntities.GetContext().ChangeTracker.Entries().ToList().ForEach(p => p.Reload());
         List <Models.Event> tatEvent = TatarCulturDbEntities.GetContext().Events.OrderBy(p => p.Name).ToList();
         EventListDG.ItemsSource = tatEvent;
     }
 }
Пример #16
0
        private void UpdateData()
        {
            var _currentComment = TatarCulturDbEntities.GetContext().Comments.OrderBy(p => p.IdComment).ToList();

            _currentComment = _currentComment.Where(p => p.User.Login.ToLower().Contains(TBoxSearch.Text.ToLower())).ToList();


            CommentListDG.ItemsSource = _currentComment;
            TextBlockCount.Text       = $"Результат запроса: {_currentComment.Count} записей из {_itemcount-1}";
        }
Пример #17
0
 private void btnSaveClick(object sender, RoutedEventArgs e)
 {
     try
     {
         TatarCulturDbEntities.GetContext().SaveChanges();
         MessageBox.Show("Изменения сохранены");
     }
     catch (Exception ex)
     {
         MessageBox.Show("Ошибка");
     }
 }
Пример #18
0
        private void UpdateData()
        {
            var _currentEvent = TatarCulturDbEntities.GetContext().Events.OrderBy(p => p.Name).ToList();

            if (ComboType.SelectedIndex > 0)
            {
                _currentEvent = _currentEvent.Where(p => p.Object.IdType == (ComboType.SelectedItem as Models.Type).IdType).ToList();
            }
            _currentEvent = _currentEvent.Where(p => p.Name.ToLower().Contains(TBoxSearch.Text.ToLower())).ToList();


            EventListDG.ItemsSource = _currentEvent;
            TextBlockCount.Text     = $"Результат запроса: {_currentEvent.Count} записей из {_itemcount}";
        }
Пример #19
0
        private void UpdateData()
        {
            var _currentUser = TatarCulturDbEntities.GetContext().Users.OrderBy(p => p.IdRols).ToList();

            if (ComboType.SelectedIndex > 0)
            {
                _currentUser = _currentUser.Where(p => p.IdRols == (ComboType.SelectedItem as UserRol).IdRols).ToList();
            }
            _currentUser = _currentUser.Where(p => p.Login.ToLower().Contains(TBoxSearch.Text.ToLower())).ToList();


            UserListDG.ItemsSource = _currentUser;
            TextBlockCount.Text    = $"Результат запроса: {_currentUser.Count} записей из {_itemcount-1}";
        }
Пример #20
0
 public AddObjectPage(Models.Object tatObject)
 {
     InitializeComponent();
     if (tatObject != null)
     {
         _currentObject = tatObject;
         _filePath      = _currentDirectory + _currentObject.ObjectPhoto;
         _fileCompare   = _filePath;
         Title          = "Редактироване информации об объекте";
     }
     _filePath           = _currentDirectory + _currentObject.ObjectPhoto;
     DataContext         = _currentObject;
     _photoName          = _currentObject.ObjectPhoto;
     cmbType.ItemsSource = TatarCulturDbEntities.GetContext().Types.ToList();
 }
Пример #21
0
        public EventListPage()
        {
            InitializeComponent();

            var type = TatarCulturDbEntities.GetContext().Types.OrderBy(p => p.Name).ToList();

            type.Insert(0, new Models.Type
            {
                Name = "Все типы"
            });
            ComboType.ItemsSource   = type;
            ComboType.SelectedIndex = 0;
            EventListDG.ItemsSource = TatarCulturDbEntities.GetContext().Events.OrderBy(p => p.Name).ToList();
            _itemcount          = EventListDG.Items.Count;
            TextBlockCount.Text = $"Результат запроса: {_itemcount - 1} записей из {_itemcount - 1}";
        }
Пример #22
0
        public AddEventPage(Models.Event eventTat)
        {
            InitializeComponent();

            if (eventTat != null)
            {
                _currentEvent = eventTat;
                _filePath     = _currentDirectory + _currentEvent.EventPhoto;
                _fileCompare  = _filePath;
                Title         = "Редактироване информации об акции";
            }
            _filePath             = _currentDirectory + _currentEvent.EventPhoto;
            DataContext           = _currentEvent;
            _photoName            = _currentEvent.EventPhoto;
            cmbObject.ItemsSource = TatarCulturDbEntities.GetContext().Objects.ToList();
        }
Пример #23
0
        public AddUserPage(User selecetUser, int idUser)
        {
            InitializeComponent();

            if (selecetUser != null)
            {
                _currentUser = selecetUser;
                _filePath    = _currentDirectory + _currentUser.UserPhoto;
                _fileCompare = _filePath;
                Title        = "Редактирование данных пользователя";
            }
            cmbRol.Visibility   = Visibility.Collapsed;
            RolLabel.Visibility = Visibility.Collapsed;
            _currentUser.IdRols = idUser;
            idUser1             = idUser;
            _photoName          = _currentUser.UserPhoto;
            DataContext         = _currentUser;
            cmbRol.ItemsSource  = TatarCulturDbEntities.GetContext().UserRols.ToList();
        }
Пример #24
0
        private void BtnSaveClick(object sender, RoutedEventArgs e)
        {
            StringBuilder _error = CheckFields();

            if (_error.Length > 0)
            {
                MessageBox.Show(_error.ToString());
                return;
            }

            if (_currentEvent.IdEvent == 0)
            {
                string photo = ChangePhotoName();
                string dest  = _currentDirectory + photo;
                File.Copy(_filePath, dest);
                _currentEvent.EventPhoto = photo;
                TatarCulturDbEntities.GetContext().Events.Add(_currentEvent);
            }
            try
            {
                if (_filePath != null)
                {
                    string photo = ChangePhotoName();
                    string dest  = _currentDirectory + photo;
                    if (_filePath != _fileCompare)
                    {
                        File.Copy(_filePath, dest);
                        _currentEvent.EventPhoto = photo;
                    }
                }
                _currentEvent.DateStarEvent = dtStart.SelectedDate;
                _currentEvent.DateEndEvent  = dtEnd.SelectedDate;
                TatarCulturDbEntities.GetContext().SaveChanges();
                MessageBox.Show("Запись Сохранена");
                Manager.MainFrame.GoBack();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
            Manager.MainFrame.GoBack();
        }
Пример #25
0
        private void BtnSaveClick(object sender, RoutedEventArgs e)
        {
            StringBuilder s = new StringBuilder();

            if (tbPassword.Text != tbPassword1.Text)
            {
                s.AppendLine("Пароль не совподают");
            }
            if (string.IsNullOrWhiteSpace(tbPassword.Text))
            {
                s.AppendLine("Поле пароль пустое");
            }
            else if (tbPassword.Text.Length <= 7)
            {
                s.AppendLine("Пароль меньше 8 символов");
            }
            if (string.IsNullOrWhiteSpace(tbPassword1.Text))
            {
                s.AppendLine("Повторите пароль");
            }

            if (s.Length > 0)
            {
                MessageBox.Show(s.ToString());
                return;
            }

            try
            {
                _currentUser.Password = tbPassword.Text;

                TatarCulturDbEntities.GetContext().SaveChanges();
                MessageBox.Show("Информация сохранена");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }

            Owner.Show();
            Close();
        }
Пример #26
0
        private void BtnEnterClick(object sender, RoutedEventArgs e)
        {
            List <User> users = TatarCulturDbEntities.GetContext().Users.ToList();
            User        user  = users.FirstOrDefault(p => p.Login == TbLogin.Text && p.Password == PbPassword.Password);

            StringBuilder error = new StringBuilder();

            if (string.IsNullOrWhiteSpace(TbLogin.Text))
            {
                error.AppendLine("Введите логин");
            }

            if (string.IsNullOrWhiteSpace(PbPassword.Password))
            {
                error.AppendLine("Введите пароль");
            }
            if (error.Length > 0)
            {
                MessageBox.Show(error.ToString(), "Ошибка авторизации", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }


            if (user != null)
            {
                int rols = (int)user.IdRols;
                Manager.idUser = user.IdUser;


                MainWindow mainWindow = new MainWindow(rols, user);
                mainWindow.Owner = this;
                this.Hide();
                mainWindow.Show();
            }

            else if (user == null)
            {
                MessageBox.Show("Неверный пароль или логин", "Неверный пароль или логин", MessageBoxButton.OK, MessageBoxImage.Error);
                PbPassword.Clear();
            }
        }
Пример #27
0
        private void LoadData()
        {
            Location pinLocation = new Location(55.7887, 49.1221);

            MapTat.Center = pinLocation;

            var type = TatarCulturDbEntities.GetContext().Types.OrderBy(p => p.Name).ToList();

            type.Insert(0, new Models.Type
            {
                Name = "Все типы"
            });
            ComboType.ItemsSource   = type;
            ComboType.SelectedIndex = 0;

            var obj = TatarCulturDbEntities.GetContext().Objects.ToList();

            LViewObject.ItemsSource = obj;
            _itemcount          = LViewObject.Items.Count;
            TextBlockCount.Text = $"Результат запроса: {_itemcount} записей из {_itemcount}";
        }
Пример #28
0
        private StringBuilder CheckFields()
        {
            StringBuilder s = new StringBuilder();

            if (string.IsNullOrWhiteSpace(_currentType.Name))
            {
                s.AppendLine("Название типа невведено!");
            }
            List <Models.Type> types = TatarCulturDbEntities.GetContext().Types.ToList();

            Models.Type type = types.FirstOrDefault(p => p.Name == _currentType.Name);
            if (type != null)
            {
                string name = type.Name;
                if (name == _currentType.Name)
                {
                    s.AppendLine("Такой тип уже есть!");
                }
            }
            return(s);
        }
Пример #29
0
        private void btnDeleteClick(object sender, RoutedEventArgs e)
        {
            var selectedKey = KeyListDG.SelectedItems.Cast <Models.Key>().ToList();
            MessageBoxResult messageBoxResult = MessageBox.Show($"Удалить {selectedKey.Count()} записей???", "Удаление", MessageBoxButton.OKCancel, MessageBoxImage.Question);

            if (messageBoxResult == MessageBoxResult.OK)
            {
                try
                {
                    TatarCulturDbEntities.GetContext().Keys.RemoveRange(selectedKey);
                    TatarCulturDbEntities.GetContext().SaveChanges();
                    MessageBox.Show("Записи удалены");
                    List <Models.Key> key = TatarCulturDbEntities.GetContext().Keys.OrderBy(p => p.KeyEvent).ToList();
                    KeyListDG.ItemsSource = key;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message.ToString());
                }
            }
        }
Пример #30
0
        private void LViewObjectSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (LViewObject.SelectedIndex >= 0)
            {
                MapTat.Children.Clear();
                StackInfo.Visibility = Visibility.Visible;
                Models.Object obj         = (LViewObject.SelectedItem as Models.Object);
                var           i           = TatarCulturDbEntities.GetContext().Objects.Where(x => x.IdObject == obj.IdObject).ToList();
                Location      pinLocation = new Location((double)obj.Latitude, (double)obj.Longitude);
                Pushpin       pin         = new Pushpin();
                pin.Location = pinLocation;

                MapTat.Children.Add(pin);
                MapTat.ZoomLevel = 15;
                MapTat.Center    = pinLocation;
                this.DataContext = obj;
                if (obj.Description == null)
                {
                    textblockInfo.Text = "Нет информации";
                }
                else if (obj.Description.Length > 250)
                {
                    int text = obj.Description.Length - 250;
                    var des  = obj.Description;
                    des = des.Substring(0, des.Length - text);
                    des = des.Insert(des.Length, " ...");
                    textblockInfo.Text = des;
                }
                else
                {
                    textblockInfo.Text = obj.Description;
                }
            }
            else
            {
                StackInfo.Visibility = Visibility.Collapsed;
            }
        }