예제 #1
0
        public IActionResult RegisterDatacordinator([FromBody] DataCoordinator dataCoordinator)
        {
            var command = new RegisterNewDataCoordinator()
            {
                IsNewRegistration = true,
                RegisteredAt      = DateTimeOffset.UtcNow,
                Role =
                {
                    StaffUserId       = Guid.NewGuid(),
                    FullName          = dataCoordinator.FullName,
                    DisplayName       = dataCoordinator.DisplayName,
                    Email             = dataCoordinator.Email,
                    PhoneNumbers      = dataCoordinator.PhoneNumbers.Select(p => p.Value),
                    PreferredLanguage = dataCoordinator.PreferredLanguage,
                    NationalSociety   = dataCoordinator.NationalSociety,
                    Sex                       = dataCoordinator.Sex,
                    AssignedNationalSocieties = dataCoordinator.AssignedNationalSocieties,
                    BirthYear                 = dataCoordinator.BirthYear
                }
            };

            RegisterStaffUser <RegisterNewDataCoordinator, Domain.StaffUser.Roles.DataCoordinator>(command);

            return(Ok());
        }
        public FastTransferDialogViewModel(DataCoordinator dataCoordinator, int studentId, int CurrentGroup = 0)
        {
            _dataCoordinator = dataCoordinator;
            _studentId       = studentId;
            GroupIndex       = CurrentGroup;

            TransferCommand = new RelayCommand(Transfer);
            CancelCommand   = new RelayCommand(Cancel);
        }
예제 #3
0
        public GroupManagerViewModel(IDialogCoordinator dialogCoordinator, DataCoordinator dataCoordinator)
        {
            _dialogCoordinator = dialogCoordinator;
            _dataCoordinator   = dataCoordinator;

            SelectedSpecialty += 0;

            AddGroupCommand = new RelayCommand(AddGroup);
            Export          = new RelayCommand(ExportAll);
        }
        public NewGroupDialogViewModel(DataCoordinator dataCoordinator, int specialtyId)
        {
            _dataCoordinator = dataCoordinator;
            _specialtyId     = specialtyId;

            TempGroup             = new Group();
            TempGroup.SpecialtyId = _specialtyId;

            SubmitCommand = new RelayCommand(Submit, (obj) => TempGroup.No.HasValue && TempGroup.Number.HasValue &&
                                             !_dataCoordinator.GroupDataService.Items.Any(g => g.No == TempGroup.No && g.Number == TempGroup.Number && TempGroup.SpecialtyId == g.SpecialtyId));
            CancelCommand = new RelayCommand(Cancel);
        }
예제 #5
0
 static UserAccounts()
 {
     if (DataCoordinator.SaveExists(AccountsFile))
     {
         Accounts = DataCoordinator.LoadUserAccounts(AccountsFile).ToList();
     }
     else
     {
         Accounts = new List <UserAccount>();
         SaveAccounts();
     }
 }
예제 #6
0
 // Awake() - Sets initial values and initialized coordinators
 private void Awake()
 {
     MaxRenderDatapoints             = int.Parse(MaxDatapointsText.text);
     FocusNumber                     = -1;
     CheckForRenderAssociationUpdate = false;
     CheckForRenderDataUpdate        = false;
     ClusteringOn                    = false;
     GenePointsCoordinator           = new DataCoordinator();
     DataPointsCoordinator           = new DataCoordinator();
     AddedDataPointsCoordinator      = new DataCoordinator();
     DataCluster                     = new Cluster();
     Graphcontroller                 = GetComponent <GraphController>();
 }
예제 #7
0
        public StudentFormViewModel(Student selectedStudent, DataCoordinator dataCoordinator, IDialogCoordinator dialogCoordinator)
        {
            _dataCoordinator   = dataCoordinator;
            _dialogCoordinator = dialogCoordinator;

            SaveCommand   = new RelayCommand(SaveStudent, (obj) => !(string.IsNullOrEmpty(EditedStudent.LastName) || string.IsNullOrEmpty(EditedStudent.FirstName)));
            CancelCommand = new RelayCommand(Cancel);

            if (selectedStudent != null)
            {
                EditedStudent = selectedStudent.Clone() as Student;
                _isEditing    = true;
            }
            else
            {
                EditedStudent = new Student();
            }
        }
예제 #8
0
        public IActionResult UpdaterDataCordinator([FromBody] DataCoordinator dataCoordinator)
        {
            var command = new RegisterNewDataCoordinator
            {
                RegisteredAt = dataCoordinator.RegistrationDate,
                Role         =
                {
                    StaffUserId       = dataCoordinator.StaffUserId,
                    FullName          = dataCoordinator.FullName,
                    DisplayName       = dataCoordinator.DisplayName,
                    Email             = dataCoordinator.Email,
                    PhoneNumbers      = dataCoordinator.PhoneNumbers.Select(p => p.Value),
                    PreferredLanguage = dataCoordinator.PreferredLanguage,
                    NationalSociety   = dataCoordinator.NationalSociety,
                    Sex                       = dataCoordinator.Sex,
                    AssignedNationalSocieties = dataCoordinator.AssignedNationalSocieties,
                    BirthYear                 = dataCoordinator.BirthYear
                }
            };

            UpdateStaffUser <RegisterNewDataCoordinator, Domain.StaffUser.Roles.DataCoordinator>(command);

            return(Ok());
        }
        public FastTransferDialog(Student student, DataCoordinator dataCoordinator)
        {
            InitializeComponent();

            DataContext = new FastTransferDialogViewModel(dataCoordinator, student.Id, student.GroupIndex);
        }
 public GroupManager(DataCoordinator dataCoordinator)
 {
     InitializeComponent();
     DataContext = new GroupManagerViewModel(DialogCoordinator.Instance, dataCoordinator);
 }
예제 #11
0
        public NewGroupDialog(DataCoordinator dataCoordinator, int specialtyId)
        {
            InitializeComponent();

            DataContext = new NewGroupDialogViewModel(dataCoordinator, specialtyId);
        }
        public StudentListing(DataCoordinator dataCoordinator, Navigator navigator)
        {
            DataContext = new StudentListingViewModel(DialogCoordinator.Instance, dataCoordinator, navigator);

            InitializeComponent();
        }
예제 #13
0
        public StudentForm(Student SelectedStudent, DataCoordinator dataCoordinator, IDialogCoordinator dialogCoordinator)
        {
            InitializeComponent();

            DataContext = new StudentFormViewModel(SelectedStudent, dataCoordinator, dialogCoordinator);
        }
예제 #14
0
 public TaskController(DataCoordinator data)
 {
     _data = data;
 }
예제 #15
0
        public MainWindow(DataCoordinator dataCoordinator)
        {
            DataContext = new ApplicationViewModel(dataCoordinator);

            InitializeComponent();
        }
예제 #16
0
 public static void SaveAccounts()
 {
     DataCoordinator.SaveUserAccounts(Accounts, AccountsFile);
 }