public async Task <IActionResult> GetServiceInformationView(long serviceInformationId) { ServiceInformationModule invMod = new ServiceInformationModule(); ServiceInformationView view = await invMod.ServiceInformation.Query().GetViewById(serviceInformationId); return(Ok(view)); }
public async Task <IActionResult> DeleteServiceInformation([FromBody] ServiceInformationView view) { ServiceInformationModule invMod = new ServiceInformationModule(); ServiceInformation serviceInformation = await invMod.ServiceInformation.Query().MapToEntity(view); invMod.ServiceInformation.DeleteServiceInformation(serviceInformation).Apply(); return(Ok(view)); }
public async Task <IActionResult> AddServiceInformation([FromBody] ServiceInformationView view) { ServiceInformationModule invMod = new ServiceInformationModule(); NextNumber nnServiceInformation = await invMod.ServiceInformation.Query().GetNextNumber(); view.ServiceInformationNumber = nnServiceInformation.NextNumberValue; ServiceInformation serviceInformation = await invMod.ServiceInformation.Query().MapToEntity(view); invMod.ServiceInformation.AddServiceInformation(serviceInformation).Apply(); ServiceInformationView newView = await invMod.ServiceInformation.Query().GetViewByNumber(view.ServiceInformationNumber); return(Ok(newView)); }