Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
 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);
     }
 }
Beispiel #3
0
        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);
        }