public static double GetByMonth(ExpenditureBuilding eb) { List <tenant_tbl> tenants = TenantBL.GetAllTenantByBuilding(eb.buildingId); double sum = (ExpenditureDAL.GetByMonth(eb)); return(sum / tenants.Count); }
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); }