Beispiel #1
0
        public Contractor(Enums.WindowType windowType, [Optional] int contractorId)
        {
            InitializeComponent();

            if (windowType == Enums.WindowType.Show || windowType == Enums.WindowType.Edit)
            {
                contractorController = new ContractorController(windowType, contractorId);
            }
            else
            {
                contractorController = new ContractorController(windowType);
            }

            DataContext = contractorController;

            if (windowType == Enums.WindowType.Show)
            {
                buttonSave.Visibility                 = Visibility.Hidden;
                textBoxCompanyName.IsEnabled          = false;
                textBoxNip.IsEnabled                  = false;
                textBoxOthersInfo.IsEnabled           = false;
                DatePickerDateOfAppointment.IsEnabled = false;
                DatePickerDateOfContract.IsEnabled    = false;
                textBoxTelNumber.IsEnabled            = false;
                textBoxVoivodeship.IsEnabled          = false;
                textBoxTariff.IsEnabled               = false;
                textBoxAdress.IsEnabled               = false;
                DatePickerContact.IsEnabled           = false;
                DatePickerLaunchDate.IsEnabled        = false;
            }
        }
Beispiel #2
0
        public User(Enums.WindowType windowType)
        {
            InitializeComponent();

            userController = new UserController(windowType);

            DataContext = userController;
        }
Beispiel #3
0
        public ContractorController(Enums.WindowType windowType, [Optional] int contractorId)
        {
            this.windowType = windowType;

            contractorService = new ContractorService();

            if (windowType == Enums.WindowType.Create)
            {
                Contractor.DateOfAppointment = DateTime.Now;
                Contractor.DateOfContract    = DateTime.Now;
                Contractor.Contact           = DateTime.Now;
                Contractor.LaunchDate        = DateTime.Now;
            }
            else if (windowType == Enums.WindowType.Edit || windowType == Enums.WindowType.Show)
            {
                Contractor = contractorService.GetContractor(contractorId).Result;
            }
        }
Beispiel #4
0
 public UserController([Optional] Enums.WindowType windowType)
 {
     this.windowType = windowType;
     userService     = new UserService();
 }