コード例 #1
0
ファイル: FightersList.cs プロジェクト: manlok876/wpfxmltmp
        public FightersList()
        {
            _editableData = new FighterData();

            Fighters         = new ObservableCollection <FighterData>();
            FilteredFighters = new ObservableCollection <FighterData>();
            Fighters.Add(new FighterData());
            Fighters.Add(new FighterData());
            Fighters.Add(new FighterData());

            SelectedCity = SelectedClub = "*";
            ApplyFilter();

            _addCmd  = new AddCmd(this);
            _delCmd  = new DeleteCmd(this);
            _saveCmd = new SaveCmd(this);
            _loadCmd = new LoadCmd(this);

            Clubs  = new ObservableCollection <string> {
            };
            Cities = new ObservableCollection <string> {
            };
            Fighters.CollectionChanged += UpdateClubs;
            Fighters.CollectionChanged += UpdateCities;

            UpdateCities(this, null);
            UpdateClubs(this, null);
        }
コード例 #2
0
        public LecturerPageVM(string dbcontextName, ISystemUser loggedInLectuer) : base(dbcontextName)
        {
            try
            {
                rowsToReturn   = 20;
                IsConfirmed    = false;
                SubgridContext = SubgridContext.Groups;
                //commands
                NewModeCmd         = new NewModeCmd(this);
                SaveFormCmd        = new SaveCmd(this);
                DeleteCmd          = new DeleteCmd(this);
                CancelCmd          = new CancelCmd(this);
                NewPassHashCmd     = new NewPassHashCmd(this);
                ToggleAdminRoleCmd = new ToggleAdminRoleCmd(this);
                //TODO: will likely need to attach lecturer to the DbContext..
                User             = UnitOfWork.LecturerRepo.Get(loggedInLectuer.Id);
                SearchTxt        = "";
                SelectedLecturer = new Lecturer();
                //TODO: figure out Async with EF and Pagination/ limit the results (limit probably best)
                List <Lecturer> results = UnitOfWork.LecturerRepo.GetTopXFromSearch(null, rowsToReturn).ToList();
                Lecturers = new ObservableCollection <Lecturer>(results);

                Mediator.Register(MediatorChannels.PoolingUpdate.ToString(), PoolingUpdate);
            }
            catch (Exception ex)
            {
                ShowFeedback(ex.Message, FeedbackType.Error);
            }
        }
コード例 #3
0
        public BaseQandAPageVM(string dbcontextName) : base(dbcontextName)
        {
            //Commands
            SaveFormCmd      = new SaveCmd(this);
            DeleteCmd        = new DeleteCmd(this);
            UploadImageCmd   = new UploadImageCmd(this);
            ToggleMarkQCmd   = new ToggleMarkQCmd(this);
            ToggleMarkACmd   = new ToggleMarkACmd(this);
            CancelCmd        = new CancelCmd(this);
            NewModeCmd       = new NewModeCmd(this);
            PostCmd          = new PostCmd(this);
            DeleteCommentCmd = new DeleteCommentCmd(this);
            EditCommentCmd   = new EditCommentCmd(this);

            //setup
            QVisConDTO            = new QuestionStateConverterDTO();
            AVisConDTO            = new AnswerStateConverterDTO();
            AnswerSearchTxt       = "";
            QuestionSearchTxt     = "";
            rowLimit              = 20;
            openFileDialog        = new OpenFileDialog();
            openFileDialog.Title  = "Select a picture";
            openFileDialog.Filter = "All supported graphics|*.jpg;*.jpeg;*.png|" +
                                    "JPEG (*.jpg;*.jpeg)|*.jpg;*.jpeg|" +
                                    "Portable Network Graphic (*.png)|*.png";

            Mediator.Register(MediatorChannels.PoolingUpdate.ToString(), PoolingUpdate);
        }
コード例 #4
0
 protected BaseMyAccountPageVM(string dbcontextName) : base(dbcontextName)
 {
     ProposedPassword     = "";
     ProposedPasswordConf = "";
     SaveFormCmd          = new SaveCmd(this);
     NewPassHashCmd       = new NewPassHashCmd(this);
     CancelCmd            = new CancelCmd(this);
     //No need for pooling updates in MyAccount page as it only loads your single reccord
 }
コード例 #5
0
        protected async override Task LoadAction()
        {
            Item = await itemsRepo.Refresh(item);

            IsReadOnly = DateTime.Now.Date > item.Day.Day;
            SaveCmd.RaiseCanExecuteChanged();
            DeleteCmd.RaiseCanExecuteChanged();
            scope.Resolve <IMainVm>().GotoDayCanExecuteChanged();
        }
コード例 #6
0
        //向仓库保存一个文件
        static bool _response_Save(string response, string file, byte[] data)
        {
            if (responses.Contains(response) == false)
            {
                return(false);
            }

            SaveCmd cmd = new SaveCmd();

            cmd.response = response;
            cmd.file     = file;
            cmd.data     = data;
            cmds.Enqueue(cmd);
            return(true);
        }
コード例 #7
0
 public StudentsPageVM(string dbcontextName, Student selectedStudent, ISystemUser loggedInLectuer) : base(dbcontextName)
 {
     try
     {
         studentRowsToReturn = 50;
         IsConfirmed         = false;
         SubgridContext      = SubgridContext.Groups;
         //commands
         RemoveEntityCmd         = new RemoveEntityCmd(this);
         NewModeCmd              = new NewModeCmd(this);
         SaveFormCmd             = new SaveCmd(this);
         NewPassHashCmd          = new NewPassHashCmd(this);
         MoveEntityOutOfListCmd  = new MoveEntityOutOfListCmd(this);
         MoveEntityInToListCmd   = new MoveEntityInToListCmd(this);
         ChangeSubgridContextCmd = new ChangeSubgridContextCmd(this);
         DeleteCmd        = new DeleteCmd(this);
         CancelCmd        = new CancelCmd(this);
         GoToEntityCmd    = new GoToEntityCmd(this);
         AnalyseEntityCmd = new AnalyseEntityCmd(this);
         CSVCmd           = new CSVCmd(this);
         //TODO: will likely need to attach lecturer to the DbContext..
         Lecturer         = (Lecturer)loggedInLectuer;
         SearchStudentTxt = "";
         if (selectedStudent.Id == 0)
         {
             SelectedStudent = new Student();
         }
         else
         {
             SelectedStudent = UnitOfWork.StudentRepo.Get(selectedStudent.Id);
         }
         //TODO: figure out Async with EF and Pagination/ limit the results (limit probably best)
         RefreshAvailableGroups(SelectedStudent);
         List <Student> results = UnitOfWork.StudentRepo.GetAll().ToList();
         Students = new ObservableCollection <Student>(results);
     }
     catch (Exception ex)
     {
         ShowFeedback(ex.Message, FeedbackType.Error);
     }
 }
コード例 #8
0
 public BaseMyGroupsPageVM(string dbcontextName) : base(dbcontextName)
 {
     //Commands
     SaveFormCmd             = new SaveCmd(this);
     NewModeCmd              = new NewModeCmd(this);
     ChangeSubgridContextCmd = new ChangeSubgridContextCmd(this);
     DeleteCmd              = new DeleteCmd(this);
     RemoveEntityCmd        = new RemoveEntityCmd(this);
     MoveEntityOutOfListCmd = new MoveEntityOutOfListCmd(this);
     MoveEntityInToListCmd  = new MoveEntityInToListCmd(this);
     GoToEntityCmd          = new GoToEntityCmd(this);
     AnalyseEntityCmd       = new AnalyseEntityCmd(this);
     CancelCmd              = new CancelCmd(this);
     try
     {
         Mediator.Register(MediatorChannels.PoolingUpdate.ToString(), PoolingUpdate);
     }
     catch (Exception ex)
     {
         ShowFeedback(ex.Message, FeedbackType.Error);
     }
 }
コード例 #9
0
 public BaseMySessionsPageVM(string dbcontextName) : base(dbcontextName)
 {
     //register commands
     NewModeCmd              = new NewModeCmd(this);
     SaveFormCmd             = new SaveCmd(this);
     AddLecturerCmd          = new AddLecturerCmd(this);
     RemoveEntityCmd         = new RemoveEntityCmd(this);
     DeleteCmd               = new DeleteCmd(this);
     ChangeSubgridContextCmd = new ChangeSubgridContextCmd(this);
     GoToEntityCmd           = new GoToEntityCmd(this);
     AnalyseEntityCmd        = new AnalyseEntityCmd(this);
     CancelCmd               = new CancelCmd(this);
     //initial setup
     try
     {
         Mediator.Register(MediatorChannels.PoolingUpdate.ToString(), PoolingUpdate);
     }
     catch (Exception ex)
     {
         ShowFeedback(ex.Message, FeedbackType.Error);
     }
 }