/// <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; } }
/// <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(); } } }