public async Task <IActionResult> GetProjectManagementWorkOrderView(long projectManagementWorkOrderId)
        {
            ProjectManagementWorkOrderModule invMod = new ProjectManagementWorkOrderModule();

            ProjectManagementWorkOrderView view = await invMod.ProjectManagementWorkOrder.Query().GetViewById(projectManagementWorkOrderId);

            return(Ok(view));
        }
        public async Task <IActionResult> DeleteProjectManagementWorkOrder([FromBody] ProjectManagementWorkOrderView view)
        {
            ProjectManagementWorkOrderModule invMod = new ProjectManagementWorkOrderModule();
            ProjectManagementWorkOrder       projectManagementWorkOrder = await invMod.ProjectManagementWorkOrder.Query().MapToEntity(view);

            invMod.ProjectManagementWorkOrder.DeleteProjectManagementWorkOrder(projectManagementWorkOrder).Apply();

            return(Ok(view));
        }
        public async Task <IActionResult> AddProjectManagementWorkOrder([FromBody] ProjectManagementWorkOrderView view)
        {
            ProjectManagementWorkOrderModule invMod = new ProjectManagementWorkOrderModule();

            NextNumber nnProjectManagementWorkOrder = await invMod.ProjectManagementWorkOrder.Query().GetNextNumber();

            view.WorkOrderNumber = nnProjectManagementWorkOrder.NextNumberValue;

            ProjectManagementWorkOrder projectManagementWorkOrder = await invMod.ProjectManagementWorkOrder.Query().MapToEntity(view);

            invMod.ProjectManagementWorkOrder.AddProjectManagementWorkOrder(projectManagementWorkOrder).Apply();

            ProjectManagementWorkOrderView newView = await invMod.ProjectManagementWorkOrder.Query().GetViewByNumber(view.WorkOrderNumber ?? 0);


            return(Ok(newView));
        }