Пример #1
0
        public async Task <IActionResult> GetServiceInformationView(long serviceInformationId)
        {
            ServiceInformationModule invMod = new ServiceInformationModule();

            ServiceInformationView view = await invMod.ServiceInformation.Query().GetViewById(serviceInformationId);

            return(Ok(view));
        }
Пример #2
0
        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));
        }
Пример #3
0
        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));
        }