示例#1
0
        public MainContragents(IViewManager viewManager, IContragentService contragentService)
        {
            InitializeComponent();

            MainContragentsViewModel vm = (MainContragentsViewModel)this.DataContext; // this creates an instance of the ViewModel

            if (vm.CloseAction == null)
            {
                vm.CloseAction = new Action(() => this.Close());
            }

            vm.ViewManager       = viewManager;
            vm.ContragentService = contragentService;
        }
        public InquireForm(IViewManager viewManager, IInquiryService inquiryService, IContragentService contragentService, IUserService userService)
        {
            InitializeComponent();

            OffersFormViewModel vm = (OffersFormViewModel)this.DataContext; // this creates an instance of the ViewModel

            if (vm.CloseAction == null)
            {
                vm.CloseAction = new Action(() => this.Close());
            }

            vm.ViewManager       = viewManager;
            vm.InquiryService    = inquiryService;
            vm.ContragentService = contragentService;
            vm.UserService       = userService;
        }
        public PaymentForm(IViewManager viewManager, IContragentService contragentService, IUserService userService, IProjectService projectService, IPaymentService paymentService)
        {
            this.InitializeComponent();

            PaymentViewModel vm = (PaymentViewModel)this.DataContext;

            if (vm.CloseAction == null)
            {
                vm.CloseAction = new Action(() => this.Close());
            }

            vm.ViewManager       = viewManager;
            vm.ContragentService = contragentService;
            vm.UserService       = userService;
            vm.ProjectService    = projectService;
            vm.PaymentService    = paymentService;
        }
        public InvoiceForm(IViewManager viewManager, IInvoiceService invoiceService, IContragentService contragentService, IProjectService projectService)
        {
            InitializeComponent();

            InvoiceFormViewModel vm = (InvoiceFormViewModel)this.DataContext; // this creates an instance of the ViewModel

            if (vm.CloseAction == null)
            {
                vm.CloseAction = new Action(() => this.Close());
            }
            if (vm.LockInvoiceNumAction == null)
            {
                vm.LockInvoiceNumAction = new Action(() => this.NumberTextBox.IsEnabled = false);
            }
            if (vm.UnlockInvoiceNumAction == null)
            {
                vm.UnlockInvoiceNumAction = new Action(() => this.NumberTextBox.IsEnabled = true);
            }

            vm.ViewManager       = viewManager;
            vm.InvoiceService    = invoiceService;
            vm.ContragentService = contragentService;
            vm.ProjectService    = projectService;
        }
示例#5
0
        public ProjectOverviewView(IViewManager viewManager, IInquiryService inquiryService, IContragentService contragentService, IUserService userService, IOfferService offerService, INoteService noteService, IProjectService projectService)
        {
            InitializeComponent();

            PFOverviewViewModel vm = (PFOverviewViewModel)this.DataContext; // this creates an instance of the ViewModel

            if (vm.HideNotesTab == null)
            {
                vm.HideNotesTab = new Action(() => this.NotesGrid.Visibility = Visibility.Hidden);
            }
            if (vm.HideNotesLabel == null)
            {
                vm.HideNotesLabel = new Action(() => this.NotesLabel.Visibility = Visibility.Hidden);
            }
            if (vm.HideIncomeBox == null)
            {
                vm.HideIncomeBox = new Action(() => this.IncomeBox.Visibility = Visibility.Hidden);
            }
            if (vm.HideExpensesBox == null)
            {
                vm.HideExpensesBox = new Action(() => this.ExpensesBox.Visibility = Visibility.Hidden);
            }
            if (vm.HideProfitBox == null)
            {
                vm.HideProfitBox = new Action(() => this.ProfitBox.Visibility = Visibility.Hidden);
            }
            if (vm.HideIncomeLabel == null)
            {
                vm.HideIncomeLabel = new Action(() => this.IncomeLabel.Visibility = Visibility.Hidden);
            }
            if (vm.HideExpensesLabel == null)
            {
                vm.HideExpensesLabel = new Action(() => this.ExpensesLabel.Visibility = Visibility.Hidden);
            }
            if (vm.HideProfitLabel == null)
            {
                vm.HideProfitLabel = new Action(() => this.ProfitLabel.Visibility = Visibility.Hidden);
            }

            vm.ViewManager       = viewManager;
            vm.InquiryService    = inquiryService;
            vm.ContragentService = contragentService;
            vm.UserService       = userService;
            vm.OfferService      = offerService;
            vm.NoteService       = noteService;
            vm.ProjectService    = projectService;
        }
示例#6
0
 public ContragentsController(IContragentService contragentService)
 {
     this.contragentService = contragentService;
 }