public static double GetByMonth(ExpenditureBuilding eb)
        {
            List <tenant_tbl> tenants = TenantBL.GetAllTenantByBuilding(eb.buildingId);
            double            sum     = (ExpenditureDAL.GetByMonth(eb));

            return(sum / tenants.Count);
        }
Exemple #2
0
        public static List <TenantPayment> GetAllPaymentsFromAllTenants(int buildingId)
        {
            //var x= PaymentConverter.ListToDTOTenantPayment(PaymentDAL.GetPaymentsByBuilding(buildingId));
            List <TenantPayment> tenantPayment = new List <TenantPayment>();
            var y = TenantBL.GetAllTenantByBuildingId(buildingId);

            y.ForEach(z => {
                tenantPayment.AddRange(GetPaymentsByUser(buildingId, z.user_id));
            });
            return(tenantPayment);
        }
Exemple #3
0
        public static void AddPayment(Expenditure expenditure)
        {
            List <tenant_tbl> tenants = TenantBL.GetAllTenantByBuilding(expenditure.building_id);
            payment_tbl       p       = new payment_tbl
            {
                building_id  = expenditure.building_id,
                description  = expenditure.description,
                sum          = expenditure.sum / tenants.Count,
                pay_for_date = DateTime.Now,
            };

            PaymentDAL.Addpayment(p);
        }