예제 #1
0
        public void DisplayBoxesFromUser(int iduser)
        {
            //var boxes = database.Boxes
            //    .ToList()
            //    .Where(x => x.UserId == iduser)
            //    .Select(x => ViewModel.BoxViewModel.Create(x.Name, x.Number, x.Description, x.BoxID))
            //    .ToList();

            //List<ViewModel.BoxViewModel> boxes = new List<ViewModel.BoxViewModel>();

            DBAction.GetData getallboxes = new DBAction.GetData();
            //boxes=getallboxes.DispalyBoxes(iduser);
            datagridBoxes.ItemsSource = getallboxes.DispalyBoxes(iduser); //boxes;
        }
예제 #2
0
        private void datagridBoxes_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            //try
            //{
            var row_list = GetDataGridRows(datagridBoxes);

            foreach (DataGridRow single_row in row_list)
            {
                if (single_row.IsSelected == true)
                {
                    int currentboxID = GetSelectedItemId();

                    //ShowBoxPhoto(currentboxID);
                    DBAction.GetData getphoto = new DBAction.GetData();

                    byte[] photo = getphoto.GetAndShowBoxPhoto(currentboxID);

                    CheckIfPhotoExist(photo);
                }
            }
            //}
            //catch { }
        }