private async void SearchAsync() { var filter = Criteria.BuildCriteria(); if (filter != null) { using (IUnitOfWork unit = new UnitOfWork()) { var result = unit.Contracts.Query(filter) .OrderBy ( cont => cont.PropertyNo ) .ThenBy ( cont => cont.ContractNo ); await TransformContracts(result); } var sums = new ContractsReport( "الإجمالي", AgreedRentSum, RentDueSum, MaintDueSum, DepositDueSum, RentPaidSum, MaintPaidSum, DepositPaidSum, BalanceSum); Reports.Add(sums); } }
protected override void Print() { try { var template = Settings.Default.ContractReportExcelTemplate; DataTable report = ContractsReport.CreateReport(Reports, null); ExcelMail excel = new ExcelMail(); excel.Send(report, template, false, 3); } catch (Exception ex) { Helper.LogShowError(ex); } }
private void AddToReport(Contract contract) { ContractsReport report = new ContractsReport(contract.ContractNo, contract.CustomerId, contract.PropertyNo, contract.Customer.Name, contract.Property.Description, contract.Property.Location, contract.AgreedRent, contract.RentDue, contract.AgreedMaintenance, contract.AgreedDeposit, (contract.RentDue - contract.RentBalance), (contract.AgreedMaintenance - contract.MaintenanceBalance), (contract.AgreedDeposit - contract.DepositBalance) ); Reports.Add(report); }