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); } }
public bool CanPrint(EmployeeReportType reportType) { if (Entity == null || IsNew()) { return(false); } EmployeeCollectionViewModel collectionViewModel = ViewModelHelper.GetParentViewModel <EmployeeCollectionViewModel>(this); return((collectionViewModel != null) && collectionViewModel.CanPrintProfileCore(Entity)); }
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; }
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); }
void BindPrintItem(DevExpress.XtraBars.BarButtonItem printItem, EmployeeReportType parameter) { printItem.BindCommand(() => ViewModel.Print(parameter), ViewModel, () => parameter); }
protected internal void PrintCore(Employee employee, EmployeeReportType reportType) { RaisePrint(reportType); }
public bool CanShowPrint(EmployeeReportType employeeReportType) { return(employeeReportType != EmployeeReportType.Profile || SelectedEntity != null); }
public void ShowPrint(EmployeeReportType employeeReportType) { DocumentManagerService.CreateDocument("ReportPreview", ReportPreviewViewModel.Create(GetReport(employeeReportType)), null, this).Show(); }
public bool CanPrint(EmployeeReportType reportType) { if(Entity == null || IsNew()) return false; EmployeeCollectionViewModel collectionViewModel = ViewModelHelper.GetParentViewModel<EmployeeCollectionViewModel>(this); return (collectionViewModel != null) && collectionViewModel.CanPrintProfileCore(Entity); }
public void Print(EmployeeReportType reportType) { EmployeeCollectionViewModel collectionViewModel = ViewModelHelper.GetParentViewModel<EmployeeCollectionViewModel>(this); if(collectionViewModel != null) collectionViewModel.PrintCore(Entity, reportType); }