Пример #1
0
        public Words_ViewModel(WordsModel model, WordType?wtype, int tt, IUnitOfWork uw)
        {
            _uow = uw;
            Contract.Requires(model != null);
            WordsInfo = model;
            word      = new WordsService(_uow);
            option    = new OptionService(_uow);
            language  = new LanguageServise(_uow);
            listitem  = new ListItems();

            chatmodel = new MSChartVM();
            //chatmodel.BarChart();
            charttest    = chatmodel.BarSeriesCollection;
            TT           = tt;
            AllLanguages = GetAllLanguages();
            allWordTypes = listitem.GetWordType();
            app          = option.GetAll();

            wt = wtype;

            RefreshProducts();

            ConfigureValidationRules();
            Validator.ResultChanged += OnValidationResultChanged;
        }
Пример #2
0
        public LanguageViewModel(LanguageModel model, IUnitOfWork uw)
        {
            Contract.Requires(model != null);
            _uow         = uw;
            LanguageInfo = model;
            language     = new LanguageServise(_uow);
            word         = new WordsService(_uow);
            option       = new OptionService(_uow);
            listitem     = new ListItems();
            app          = option.GetAll();

            RefreshProducts();

            ConfigureValidationRules();
            Validator.ResultChanged += OnValidationResultChanged;
        }
Пример #3
0
        public User_ViewModel(UserModel model, IUnitOfWork uw)
        {
            Contract.Requires(model != null);
            _uow     = uw;
            UserInfo = model;
            user     = new UserService(_uow);
            word     = new WordsService(_uow);
            video    = new VideoService(_uow);
            option   = new OptionService(_uow);
            listitem = new ListItems();
            app      = option.GetAll();

            RefreshProducts();

            ConfigureValidationRules();
            Validator.ResultChanged += OnValidationResultChanged;
        }
Пример #4
0
        public WordVideoVM(VideoModel model, int videostyp, int?word_id, LeapKinnectType thisleaporkin, IUnitOfWork uw)
        {
            Contract.Requires(model != null);
            _uow      = uw;
            videotype = videostyp;
            VideoInfo = model;
            video     = new VideoService(_uow);
            word      = new WordsService(_uow);
            option    = new OptionService(_uow);
            user      = new UserService(_uow);
            listitem  = new ListItems();

            wordid = word_id;
            //AllLanguages = GetAllLanguages();
            //allWordTypes = listitem.GetWordType();
            app = option.GetAll();

            lk = thisleaporkin;
            //app.FileUrl = "c:";


            RefreshProducts();

            chatmodel = new MSChartVM();
            //chatmodel.BarChart();
            charttest = chatmodel.BarSeriesCollection;// PerVideoPartCount();


            if (model != null /* && UtilityClass.CheckIntHasValue(model.video_id)*/)
            {
                //wordType = model.Words.WordType;
                //elang = model.Words.Languages;
                //Name = model.Words.Name;
                eword = model.Words;

                if (!string.IsNullOrEmpty(model.KinnectFilePath) && videotype == 1)
                {
                    //euser = model.User;
                    //if (model.User_id.HasValue)
                    //    User_id = model.User_id.Value;

                    _attachPicture = new Uri(app.FileUrl + @"\" + model.KinnectFilePath);//UtilityClass.ByteToStream(app.FileUrl + model.FilePath);
                    selectedpic    = model.KinnectFilePath;
                    prevpic        = model.KinnectFilePath;
                }
                else if (!string.IsNullOrEmpty(model.LeapFilePath) && videotype != 1)
                {
                    //euser = model.User;
                    //if (model.User_id.HasValue)
                    //    User_id = model.User_id.Value;

                    _attachPicture = new Uri(app.FileUrl + @"\" + model.LeapFilePath);//UtilityClass.ByteToStream(app.FileUrl + model.FilePath);
                    selectedpic    = model.LeapFilePath;
                    prevpic        = model.LeapFilePath;
                }
            }


            ConfigureValidationRules();
            Validator.ResultChanged += OnValidationResultChanged;
        }