public GetBillsForPrintingModel GetBillsForPrinting(int periodId, int controllerId, int areaId, string street) { var tables = NativeSql.ExecMultiple("billing_printBills", new { periodId, controllerId, areaId, street }); GetBillsForPrintingModel model = new GetBillsForPrintingModel() { PeriodId = periodId, ControllerId = controllerId, AreaId = areaId }; if (tables.Length <= 1) { return(null); } model.BillingPeriods = tables[1].Rows <OshBusinessModel.Da.SubagentsBillingPeriods.BillingPeriodDa>(); model.Controllers = tables[2].Rows <ControllerShortInfoDa>(); model.Areas = tables[3].Rows <AreasShortInfoDa>(); model.Bills = ComposeBills(tables, 5); return(model); }
public GetBillsForPrintingModel GetBillsForPrintingByAddress(int periodId, string street, bool allBuildings, ShortBuildingDa[] buildings, int userId) { var tables = NativeSql.ExecMultiple("billing_printBillsByAddress", new { periodId, street, allBuildings, buildings, userId }); var model = new GetBillsForPrintingModel { PeriodId = periodId, }; if (tables.Length <= 1) { return(null); } model.BillingPeriods = tables[1].Rows <OshBusinessModel.Da.SubagentsBillingPeriods.BillingPeriodDa>(); model.Streets = tables[2].Rows <ShortStreetDa>().Select(s => s.AddressStreet).ToArray(); if (tables.Length > 3) { model.Bills = ComposeBills(tables, 3); } return(model); }