Example #1
0
        public void Print(EmployeeReportType reportType)
        {
            EmployeeCollectionViewModel collectionViewModel = ViewModelHelper.GetParentViewModel <EmployeeCollectionViewModel>(this);

            if (collectionViewModel != null)
            {
                collectionViewModel.PrintCore(Entity, reportType);
            }
        }
        void RaisePrint(EmployeeReportType reportType)
        {
            MainViewModel mainViewModel = ViewModelHelper.GetParentViewModel <MainViewModel>(this);

            if (mainViewModel != null)
            {
                mainViewModel.RaisePrint(reportType);
            }
        }
Example #3
0
        public bool CanPrint(EmployeeReportType reportType)
        {
            if (Entity == null || IsNew())
            {
                return(false);
            }
            EmployeeCollectionViewModel collectionViewModel = ViewModelHelper.GetParentViewModel <EmployeeCollectionViewModel>(this);

            return((collectionViewModel != null) && collectionViewModel.CanPrintProfileCore(Entity));
        }
Example #4
0
 Control GetSettingsEditor(EmployeeReportType reportType) {
     switch(reportType) {
         case EmployeeReportType.Profile:
             return new EvaluationsControl(value => SetParameter(ParamEvaluations, value), (bool)ParamEvaluations.Value);
         case EmployeeReportType.Directory:
         case EmployeeReportType.Summary:
             return new SortOrderControl(value => SetParameter(ParamAscending, value), (bool)ParamAscending.Value);
         case EmployeeReportType.TaskList:
             return new TasksSortControl(value => SetParameter(ParamDueDate, value), (bool)ParamDueDate.Value);
     }
     return null;
 }
 Control GetSettingsEditor(EmployeeReportType reportType) {
     switch(reportType) {
         case EmployeeReportType.Profile:
             return new EvaluationsControl(value => SetParameter(ParamEvaluations, value), (bool)ParamEvaluations.Value);
         case EmployeeReportType.Directory:
         case EmployeeReportType.Summary:
             return new SortOrderControl(value => SetParameter(ParamAscending, value), (bool)ParamAscending.Value);
         case EmployeeReportType.TaskList:
             return new TasksSortControl(value => SetParameter(ParamDueDate, value), (bool)ParamDueDate.Value);
     }
     return null;
 }
 XtraReport CreateAndInitializeReport(EmployeeReportType reportType) {
     var locator = GetService<Services.IReportLocator>();
     var report = locator.GetReport(reportType) as XtraReport;
     switch(reportType) {
         case EmployeeReportType.Profile:
             report.DataSource = new List<Employee> { CollectionViewModel.SelectedEntity };
             break;
         case EmployeeReportType.TaskList:
             report.DataSource = ViewModel.Tasks;
             break;
         case EmployeeReportType.Directory:
         case EmployeeReportType.Summary:
             report.DataSource = CollectionViewModel.Entities;
             break;
     }
     return report;
 }
Example #7
0
        IReportInfo GetReport(EmployeeReportType reportType)
        {
            Logger.Log(string.Format("HybridApp: Create Report : Employees: {0}", reportType.ToString()));
            switch (reportType)
            {
            case EmployeeReportType.TaskList:
                return(ReportInfoFactory.EmployeeTaskList(UnitOfWorkFactory.CreateUnitOfWork().Tasks.ToList()));

            case EmployeeReportType.Profile:
                return(ReportInfoFactory.EmployeeProfile(SelectedEntity));

            case EmployeeReportType.Summary:
                return(ReportInfoFactory.EmployeeSummary(Entities));

            case EmployeeReportType.Directory:
                return(ReportInfoFactory.EmployeeDirectory(Entities));
            }
            throw new ArgumentException("", "reportType");
        }
        private XtraReport CreateAndInitializeReport(EmployeeReportType reportType)
        {
            var locator = GetService <IReportLocator>();
            var report  = locator.GetReport(reportType) as XtraReport;

            if (reportType == EmployeeReportType.Profile)
            {
                report.Parameters["parameterId"].Value = ViewModel.ReportEntityKey;
                report.Parameters["ShowEvaluationsParameter"].Value = btnIncudeEvaluations.Checked;
            }
            if (CollectionViewModel != null)
            {
                report.DataSource = CollectionViewModel.Entities;
            }
            if (EmployeeViewModel != null)
            {
                var list = new List <Employee>();
                list.Add(EmployeeViewModel.Entity);
                report.DataSource = list;
            }
            CreateDocument(report);
            return(report);
        }
Example #9
0
 void BindPrintItem(DevExpress.XtraBars.BarButtonItem printItem, EmployeeReportType parameter) {
     printItem.BindCommand(() => ViewModel.Print(parameter), ViewModel, () => parameter);
 }
Example #10
0
 void BindPrintItem(DevExpress.XtraBars.BarButtonItem printItem, EmployeeReportType parameter)
 {
     printItem.BindCommand(() => ViewModel.Print(parameter), ViewModel, () => parameter);
 }
Example #11
0
 XtraReport CreateAndInitializeReport(EmployeeReportType reportType) {
     var locator = GetService<Services.IReportLocator>();
     var report = locator.GetReport(reportType) as XtraReport;
     switch(reportType) {
         case EmployeeReportType.Profile:
             report.DataSource = new List<Employee> { CollectionViewModel.SelectedEntity };
             break;
         case EmployeeReportType.TaskList:
             report.DataSource = ViewModel.Tasks;
             break;
         case EmployeeReportType.Directory:
         case EmployeeReportType.Summary:
             report.DataSource = CollectionViewModel.Entities;
             break;
     }
     return report;
 }
 protected internal void PrintCore(Employee employee, EmployeeReportType reportType)
 {
     RaisePrint(reportType);
 }
Example #13
0
 public bool CanShowPrint(EmployeeReportType employeeReportType)
 {
     return(employeeReportType != EmployeeReportType.Profile || SelectedEntity != null);
 }
Example #14
0
 public void ShowPrint(EmployeeReportType employeeReportType)
 {
     DocumentManagerService.CreateDocument("ReportPreview", ReportPreviewViewModel.Create(GetReport(employeeReportType)), null, this).Show();
 }
Example #15
0
 public bool CanPrint(EmployeeReportType reportType) {
     if(Entity == null || IsNew()) return false;
     EmployeeCollectionViewModel collectionViewModel = ViewModelHelper.GetParentViewModel<EmployeeCollectionViewModel>(this);
     return (collectionViewModel != null) && collectionViewModel.CanPrintProfileCore(Entity);
 }
Example #16
0
 public void Print(EmployeeReportType reportType) {
     EmployeeCollectionViewModel collectionViewModel = ViewModelHelper.GetParentViewModel<EmployeeCollectionViewModel>(this);
     if(collectionViewModel != null)
         collectionViewModel.PrintCore(Entity, reportType);
 }