public ActionResult Add(Guid setUpId, InvoiceSetupScheduleInfoApiModel invoiceSetupScheduleApi) { try { InvoiceScheduleMapper invoiceSchedueMapper = new InvoiceScheduleMapper(); var invoiceSetupSchedule = invoiceSchedueMapper.Map(invoiceSetupScheduleApi); var childInvoiceSetupList = this._invoiceScheduleService.Create(setUpId, invoiceSetupSchedule); var mappedSchedule = invoiceSchedueMapper.Map(childInvoiceSetupList); var response = new ApiResponse(new { Id = setUpId, Schedule = mappedSchedule }, ApiStatus.Success); return(SendResponse(response, "InvoiceSchedule")); } catch (Exception ex) { return(new UnknownErrorResult(ex, base._errorEnabled)); } }
public ActionResult Get(Guid setUpId) { try { var invoiceSetupSchedules = this._invoiceScheduleService.Get(setUpId); InvoiceScheduleMapper invoiceSchedueMapper = new InvoiceScheduleMapper(); var response = invoiceSchedueMapper.Map(invoiceSetupSchedules); return(Ok(response)); } catch (Exception ex) { return(new UnknownErrorResult(ex, base._errorEnabled)); } }