Ejemplo n.º 1
0
        private void LoadData(Obj SelecterObj_)
        {
            switch (SelecterObj_)
            {
            case Obj.Worker:
                ObservableCollection <WorkerDG> workerDGs = new ObservableCollection <WorkerDG>();
                foreach (var item in BLL_.GetAllWorkers())
                {
                    workerDGs.Add(WorkerDG.Convert(item));
                }
                DG.ItemsSource = workerDGs;
                break;

            case Obj.Product:
                ObservableCollection <ProductDG> productDGs = new ObservableCollection <ProductDG>();
                foreach (var item in BLL_.GetAllProducts())
                {
                    productDGs.Add(ProductDG.Convert(item));
                }
                DG.ItemsSource = productDGs;
                break;

            case Obj.Director:
                ObservableCollection <DirectorDG> directorDGs = new ObservableCollection <DirectorDG>();
                foreach (var item in BLL_.GetAllDirectors())
                {
                    directorDGs.Add(DirectorDG.Convert(item));
                }
                DG.ItemsSource = directorDGs;
                break;

            case Obj.Shop:
                ObservableCollection <ShopDG> shopDGs = new ObservableCollection <ShopDG>();
                foreach (var item in BLL_.GetAllShops())
                {
                    shopDGs.Add(ShopDG.Convert(item));
                }
                DG.ItemsSource = shopDGs;
                break;

            case Obj.NONE:
                MessageBox.Show("NoNe");
                return;

            default:
                break;
            }
        }
Ejemplo n.º 2
0
 public static ShopsDTO ConvertToDTO(ShopDG shopsDTO)
 {
     return(new ShopsDTO(shopsDTO.Name, shopsDTO.Address, shopsDTO.ParkingArea, shopsDTO.CityId, shopsDTO.DirectorId));
 }