public ActionResult ExportToPDF(Department department) { DepartmentReport deptreport = new DepartmentReport(); byte[] abytes = deptreport.PrepareReport(GetDepartment()); return(File(abytes, "application/pdf")); }
public static StatisticsResponse Map(this DepartmentReport departmentReport) { return(new StatisticsResponse { Department = departmentReport.Department, Ratings = departmentReport.RatingSlices.Select(slice => slice.Map()) }); }
public ActionResult DepartmentReport() { DB51Entities1 db = new DB51Entities1(); var c = db.DepartmentViews.ToList(); DepartmentReport rept = new DepartmentReport(); rept.Load(); rept.SetDataSource(c); Stream s = rept.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); return(File(s, "application/pdf")); }
public decimal GenerateSetupScore(DepartmentReport report) { decimal score = 0; if (report.Groups >= 1) { score++; } if (report.Users >= 1) { score++; } if (report.Units >= 1) { score++; } if (report.Roles >= 1) { score++; } if (report.Notifications >= 1) { score++; } if (report.UnitTypes >= 1 || report.CallTypes >= 1 || report.CertTypes >= 1) { score++; } if (report.Settings >= 1) { score++; } if (report.Calls >= 1) { score++; } if (score == 0) { return(0); } decimal scorePrecent = score / 8m; return(scorePrecent * 100); }
public async Task <byte[]> GetAsync(int companyId, CancellationToken token = default(CancellationToken)) { var report = new DepartmentReport(); return((await report.BuildAsync("請求部門マスター一覧" + DateTime.Today.ToString("yyyyMMdd"), companyQueryProcessor.GetAsync(new CompanySearch { Id = companyId }, token), departmentNameByCodeQueryProcessor.GetAsync(new DepartmentSearch { CompanyId = companyId, }, token)))?.Convert()); }
public bool AddReport(DepartmentReport _report) { lock (this.items) { if (this.items.ContainsKey(_report.Time)) { this.items.Add(_report.Time, _report); return(true); } else { return(false); } } }
private void DoPrint() { try { DepartmentsResult result = null; DepartmentReport departmentReport = null; var path = string.Empty; var task = Task.Run(async() => { path = await LoadInitialDirectoryAsync(); await ServiceProxyFactory.LifeTime(async factory => { var service = factory.Create <DepartmentMasterClient>(); result = await service.GetDepartmentAndStaffAsync(SessionKey, CompanyId); }); if (result.ProcessResult.Result) { var departments = result.Departments; if (departments.Any()) { departmentReport = new DepartmentReport(); departmentReport.SetBasicPageSetting(Login.CompanyCode, Login.CompanyName); departmentReport.Name = "請求部門マスター一覧" + DateTime.Today.ToString("yyyyMMdd"); departmentReport.SetData(departments); departmentReport.Run(false); } } }); ProgressDialog.Start(ParentForm, task, false, SessionKey); if (departmentReport != null) { ShowDialogPreview(ParentForm, departmentReport, path); } else { ShowWarningDialog(MsgWngPrintDataNotExist); } } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); ShowWarningDialog(MsgErrCreateReportError); } }