Ejemplo n.º 1
0
        public SCexportViewModel(Manager exportManager, List <Autodesk.Revit.DB.ViewSheet> preSelectedViews)
        {
            printTypes = GetAvailablePrinters();
            if (printTypes.Count > 0)
            {
                selectedPrintType = printTypes[0];
            }
            else
            {
                printTypes.Add("No Valid Printers");
                selectedPrintType = printTypes[0];
            }
            this.exportManager = exportManager;
            isClosing          = false;
            closeMode          = CloseMode.Exit;
            sheets             = new ObservableCollection <ExportSheet>(exportManager.AllSheets);
            Sheets             = CollectionViewSource.GetDefaultView(sheets);
            Sheets.SortDescriptions.Add(new SortDescription("FullExportName", ListSortDirection.Ascending));
            ShowSearchHint   = true;
            sheetFilter      = null;
            recentExportSets = RecentExport.GetAllUserViewSets(exportManager.AllViewSheetSets);
            recentExportSets = recentExportSets.OrderByDescending(v => v.CreationDate).ToList();
            PreSelectedViews = preSelectedViews;

            foreach (var viewSheet in preSelectedViews)
            {
                SelectedSheets.Add(sheets.Where(s => s.SheetNumber == viewSheet.SheetNumber).First());
            }
        }
Ejemplo n.º 2
0
        public IEnumerable <ExamSheetModel> FindAll(SheetFilter filter, int page, int pageSize)
        {
            if (filter == null)
            {
                return(FindAll(page, pageSize));
            }

            return(Repository.FindAll(CreateFilter(filter), page, pageSize).Select(CreateModel));
        }
Ejemplo n.º 3
0
 public SCexportViewModel(Manager exportManager)
 {
     printTypes         = (new[] { "Print A3", "Print A2", "Print Full Size" }).ToList();
     selectedPrintType  = "Print A3";
     this.exportManager = exportManager;
     isClosing          = false;
     closeMode          = CloseMode.Exit;
     sheets             = new ObservableCollection <ExportSheet>(exportManager.AllSheets);
     Sheets             = CollectionViewSource.GetDefaultView(sheets);
     Sheets.SortDescriptions.Add(new SortDescription("FullExportName", ListSortDirection.Ascending));
     ShowSearchHint = true;
     sheetFilter    = null;
 }
Ejemplo n.º 4
0
        protected virtual Dictionary <string, object> CreateFilter(SheetFilter filter)
        {
            if (filter == null)
            {
                return(new Dictionary <string, object>());
            }
            var repositoryFilter = new Dictionary <string, object>();

            repositoryFilter.Add(nameof(SheetFilter.State), filter.State);
            repositoryFilter.Add(nameof(SheetFilter.FacultyId), filter.FacultyId);
            repositoryFilter.Add(nameof(SheetFilter.GroupId), filter.GroupId);
            repositoryFilter.Add(nameof(SheetFilter.SubjectId), filter.SubjectId);
            repositoryFilter.Add(nameof(SheetFilter.TeacherId), filter.TeacherId);
            return(repositoryFilter);
        }
Ejemplo n.º 5
0
 public virtual int GetTotal(SheetFilter filter)
 {
     return(Repository.GetTotal(CreateFilter(filter)));
 }