Ejemplo n.º 1
0
        /// <summary>
        /// Tworzy widok CarServicesCarList.
        /// </summary>
        /// <param name="parentView">Widok nadrzędny.</param>
        public CarServicesCarList(IBaseView parentView)
            : base(parentView)
        {
            InitializeComponent();
            AfterInitializeComponent();

            if (!VSDesignMode)
            {
                if (parentView != null)
                {
                    CarServiceDetails carServiceDetails = new CarServiceDetails();
                    if (parentView.GetType() == carServiceDetails.GetType())
                    {
                        this.CarService = (CarService)parentView.CurrentObject;
                    }
                }

                this.Presenter = new CarServicesCarListPresenter(this);

                this.SupportsShowDetails = false;
                this.SupportsDelete      = false;
                this.SupportsAddNew      = false;
                this.SupportsEdit        = false;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Wysyła do ParentView wybrany CarProduct.
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">GridViewCellEventArgs.</param>
        private void CarProductCollectionGrid_CellDoubleClick(object sender, GridViewCellEventArgs e)
        {
            CarServiceDetails carService = new CarServiceDetails();

            if (ParentView.GetType() == carService.GetType())
            {
                carService = (CarServiceDetails)ParentView;
                if (ParentView.CurrentObject != null)
                {
                    carService.CarProductList  = this;
                    carService.CarProductToAdd = this.CurrentCarProduct;
                    ParentView.ShowDialog();
                }
            }
        }