Ejemplo n.º 1
0
        public override void UnmountView()
        {
            base.UnmountView();

            FileNameViewModel.UnmountView();
            FolderViewModel.UnmountView();
        }
Ejemplo n.º 2
0
 public override void MountView()
 {
     FileNameViewModel.MountView();
     FolderViewModel.MountView();
     RaisePropertyChanged(nameof(FileNameViewModel));
     RaisePropertyChanged(nameof(FolderViewModel));
     base.MountView();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Displays a list of the file names with full path
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void SearchFolderButton_Click(object sender, RoutedEventArgs e)
 {
     PathAndFileNameList = FileNameViewModel.SearchFolder();
     //DisplayPathAndfileName();
     DisplayFileName();
     regexViewModel.regexFileName();
     DiplayMovieList();
     getMovieViewModel.Call_GetMovie();
     getMovieDetails.Call_GetMovieDetails(GetMovieViewModel.Movie_id);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Populates the File name listbox with only the file names and NO path
        /// </summary>
        public void DisplayFileName()
        {
            var pathAndFileName = FileNameViewModel.PathAndFileName;
            var files           = FileNameViewModel.getFileName(pathAndFileName);

            foreach (string name in files)
            {
                fileNameListbox.Items.Add(name);
            }
        }
        public async Task <IEnumerable <FileNameViewModel> > Find(FileNameViewModel viewModel)
        {
            List <Expression <Func <FileNameCode, bool> > > filterPredicate = new List <Expression <Func <FileNameCode, bool> > >();

            if (viewModel != null)
            {
                filterPredicate.Add(p => (!string.IsNullOrWhiteSpace(p.LocationName) && p.LocationName.Contains(viewModel.LocationName)) ||
                                    (!string.IsNullOrWhiteSpace(p.FileNumberPrefix) && p.FileNumberPrefix.Contains(viewModel.FileNumberPrefix)));
            }
            return(EntityToViewModelMapper.Map(this.FileNameRepository.Find(filterPredicate)));
        }
Ejemplo n.º 6
0
        public async Task <FileNameViewModel> Find(int id)
        {
            try
            {
                FileNameViewModel fileNameCode = await this.BusinessLayer.Find(id);

                return(fileNameCode);
            }
            catch (Exception ex)
            {
                this.ExceptionLogger.Log(LogLevel.Error, ex);
                throw ex;
            }
        }
        public async Task <FileNameViewModel> Create(FileNameViewModel viewModel)
        {
            var fileNamingDetails = this.FileNameRepository.Add(ViewModelToEntityMapper.Map(viewModel));

            if (fileNamingDetails.Id > 0)
            {
                viewModel.FileNameId = fileNamingDetails.Id;
            }
            else
            {
                viewModel.HasError = true;
            }

            return(viewModel);
        }
Ejemplo n.º 8
0
        public async Task <FileNameViewModel> Update(FileNameViewModel fileNamingModel)
        {
            try
            {
                fileNamingModel.LastModifiedBy = User.Identity.GetUserId();
                fileNamingModel.LastModifiedOn = DateTime.Now;
                fileNamingModel.IsActive       = true;

                FileNameViewModel fileNameCode = await this.BusinessLayer.Update(fileNamingModel);

                return(fileNameCode);
            }
            catch (Exception ex)
            {
                this.ExceptionLogger.Log(LogLevel.Error, ex);
                throw ex;
            }
        }
Ejemplo n.º 9
0
        public static FileNameCode Map(FileNameViewModel viewModel, FileNameCode entity)
        {
            if (viewModel == null || entity == null)
            {
                return(null);
            }

            entity.Id               = viewModel.FileNameId;
            entity.LocationName     = viewModel.LocationName;
            entity.FileNumberPrefix = viewModel.FileNumberPrefix;
            entity.CreatedBy        = viewModel.CreatedBy;
            entity.CreatedOn        = viewModel.CreatedOn;
            entity.LastModifiedBy   = viewModel.LastModifiedBy;
            entity.LastModifiedOn   = viewModel.LastModifiedOn;
            entity.IsActive         = viewModel.IsActive;

            return(entity);
        }
Ejemplo n.º 10
0
        public static FileNameCode Map(FileNameViewModel viewModel)
        {
            if (viewModel == null)
            {
                return(null);
            }

            return(new FileNameCode
            {
                Id = viewModel.FileNameId,
                LocationName = viewModel.LocationName,
                FileNumberPrefix = viewModel.FileNumberPrefix,
                CreatedBy = viewModel.CreatedBy,
                CreatedOn = viewModel.CreatedOn,
                LastModifiedBy = viewModel.LastModifiedBy,
                LastModifiedOn = viewModel.LastModifiedOn,
                IsActive = viewModel.IsActive
            });
        }
Ejemplo n.º 11
0
        public async Task <FileNameViewModel> Update(FileNameViewModel viewModel)
        {
            var fileNameInfo = this.FileNameRepository.Find(viewModel.FileNameId);

            if (fileNameInfo != null)
            {
                var lastModifiedDate = fileNameInfo.LastModifiedOn;
                fileNameInfo = this.FileNameRepository.Update(ViewModelToEntityMapper.Map(viewModel, fileNameInfo));

                if (lastModifiedDate < fileNameInfo.LastModifiedOn)
                {
                    return(viewModel);
                }
                else
                {
                    viewModel.HasError = true;
                }
            }

            return(viewModel);
        }
Ejemplo n.º 12
0
 protected override void HandleCurrentProfileChanged()
 {
     FileNameViewModel.RaiseTextChanged();
     FolderViewModel.RaiseTextChanged();
 }