示例#1
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            //update
            switch (SelecterObj)
            {
            case Obj.Worker:
                foreach (var item in DG.SelectedItems)
                {
                    WorkerWindow workerWindow = new WorkerWindow((WorkersDTO)item, BLL_);
                    workerWindow.Show();
                    workerWindow.Closing += Window_Closed;
                }
                break;

            case Obj.Product:
                foreach (var item in DG.SelectedItems)
                {
                    ProductWindow productWindow = new ProductWindow(ProductDG.ConvertToDTO((ProductDG)item), BLL_);
                    productWindow.Show();
                    productWindow.Closing += Window_Closed;
                }
                break;

            case Obj.Director:
                foreach (var item in DG.SelectedItems)
                {
                    DirectorWindow directorWindow = new DirectorWindow((DirectorsDTO)item, BLL_);
                    directorWindow.Show();
                    directorWindow.Closing += Window_Closed;
                }
                break;

            case Obj.Shop:
                foreach (var item in DG.SelectedItems)
                {
                    ShopWindow_ shopWindow = new ShopWindow_((ShopsDTO)item, BLL_);
                    shopWindow.Show();
                    shopWindow.Closing += Window_Closed;
                }
                break;

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

            default:
                break;
            }
        }
示例#2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            //create
            switch (SelecterObj)
            {
            case Obj.Worker:
                WorkerWindow workerWindow = new WorkerWindow(new WorkersDTO(), BLL_);
                workerWindow.Show();
                workerWindow.Closing += Window_Closed;
                break;

            case Obj.Product:
                ProductWindow productWindow = new ProductWindow(new ProductsDTO(), BLL_);
                productWindow.Show();
                productWindow.Closing += Window_Closed;
                break;

            case Obj.Director:
                DirectorWindow directorWindow = new DirectorWindow(new DirectorsDTO(), BLL_);
                directorWindow.Show();
                directorWindow.Closing += Window_Closed;
                break;

            case Obj.Shop:
                ShopWindow_ shopWindow = new ShopWindow_(new ShopsDTO(), BLL_);
                shopWindow.Show();
                shopWindow.Closing += Window_Closed;
                break;

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

            default:
                break;
            }
        }