Example #1
0
        private void OnDeleteConfirmViewOKEventRaised(object sender, EventArgs e)
        {
            switch (((DeleteConfirmView)sender).GetUserControlName())
            {
            case "CategoriesUC":
                facade.DeleteCategoryById(deleteConfirmView.GetIdToDelete());
                SetupMainView(mainPanel, (UserControl)categoriesPresenter.GetCategoriesUC());
                break;

            case "GroupsUC":
                facade.DeleteGroupById(deleteConfirmView.GetIdToDelete());
                SetupMainView(mainPanel, (UserControl)groupsPresenter.GetGroupsUC());
                break;

            case "ImagesUC":
                facade.DeleteImageById(deleteConfirmView.GetIdToDelete());
                SetupMainView(mainPanel, (UserControl)imagesPresenter.GetImagesUC());
                break;

            case "ParametersUC":
                facade.DeleteParameterById(deleteConfirmView.GetIdToDelete());
                SetupMainView(mainPanel, (UserControl)parametersPresenter.GetParametersUC());
                break;

            case "ProductsUC":
                facade.DeleteProductById(deleteConfirmView.GetIdToDelete());
                SetupMainView(mainPanel, (UserControl)productsPresenter.GetProductsUC());
                break;

            case "SuppliersUC":
                facade.DeleteSupplierById(deleteConfirmView.GetIdToDelete());
                SetupMainView(mainPanel, (UserControl)suppliersPresenter.GetSuppliersUC());
                break;

            case "UnitsUC":
                facade.DeleteUnitById(deleteConfirmView.GetIdToDelete());
                SetupMainView(mainPanel, (UserControl)unitsPresenter.GetUnitsUC());
                break;

            default:
                break;
            }
        }