public static Widget Create(PanelViewType type) { switch (type) { case PanelViewType.CounterpartyView: return(new CounterpartyPanelView(ServicesConfig.CommonServices)); case PanelViewType.DeliveryPointView: return(new DeliveryPointPanelView(ServicesConfig.CommonServices)); case PanelViewType.DeliveryPricePanelView: return(new DeliveryPricePanelView()); case PanelViewType.UndeliveredOrdersPanelView: return(new UndeliveredOrdersPanelView()); case PanelViewType.EmailsPanelView: return(new EmailsPanelView()); case PanelViewType.CallTaskPanelView: return(new CallTaskPanelView( new BaseParametersProvider(new ParametersProvider()), new EmployeeRepository(), ServicesConfig.CommonServices)); case PanelViewType.ComplaintPanelView: return(new ComplaintPanelView(new ComplaintsRepository(), new ComplaintResultsRepository())); case PanelViewType.SmsSendPanelView: return(new SmsSendPanelView( ServicesConfig.CommonServices, new SmsPaymentRepository(), new FastPaymentRepository(), new FastPaymentParametersProvider(new ParametersProvider()))); case PanelViewType.FixedPricesPanelView: var fixedPricesDialogOpener = new FixedPricesDialogOpener(); var fixedPricesPanelViewModel = new FixedPricesPanelViewModel(fixedPricesDialogOpener, ServicesConfig.CommonServices); return(new FixedPricesPanelView(fixedPricesPanelViewModel)); case PanelViewType.CashInfoPanelView: return(new CashInfoPanelView( UnitOfWorkFactory.GetDefaultFactory, new CashRepository(), new SubdivisionRepository(new ParametersProvider()), new UserRepository())); default: throw new NotSupportedException(); } }
public static Widget Create(PanelViewType type) { switch (type) { case PanelViewType.CounterpartyView: return(new CounterpartyPanelView()); case PanelViewType.DeliveryPointView: return(new DeliveryPointPanelView()); case PanelViewType.DeliveryPricePanelView: return(new DeliveryPricePanelView()); case PanelViewType.UndeliveredOrdersPanelView: return(new UndeliveredOrdersPanelView()); case PanelViewType.EmailsPanelView: return(new EmailsPanelView()); case PanelViewType.CallTaskPanelView: return(new CallTaskPanelView(new BaseParametersProvider(), EmployeeSingletonRepository.GetInstance())); case PanelViewType.ComplaintPanelView: return(new ComplaintPanelView(new ComplaintsRepository())); case PanelViewType.SmsSendPanelView: return(new SmsSendPanelView()); case PanelViewType.FixedPricesPanelView: var fixedPricesDialogOpener = new FixedPricesDialogOpener(); FixedPricesPanelViewModel fixedPricesPanelViewModel = new FixedPricesPanelViewModel(fixedPricesDialogOpener); return(new FixedPricesPanelView(fixedPricesPanelViewModel)); default: throw new NotSupportedException(); } }