Example #1
0
        public async Task <IActionResult> GetJobPhaseView(long jobPhaseId)
        {
            JobPhaseModule invMod = new JobPhaseModule();

            JobPhaseView view = await invMod.JobPhase.Query().GetViewById(jobPhaseId);

            return(Ok(view));
        }
Example #2
0
        public async Task <IActionResult> DeleteJobPhase([FromBody] JobPhaseView view)
        {
            JobPhaseModule invMod   = new JobPhaseModule();
            JobPhase       jobPhase = await invMod.JobPhase.Query().MapToEntity(view);

            invMod.JobPhase.DeleteJobPhase(jobPhase).Apply();

            return(Ok(view));
        }
Example #3
0
        public async Task <IActionResult> UpdateJobPhase([FromBody] JobPhaseView view)
        {
            JobPhaseModule invMod = new JobPhaseModule();

            JobPhase jobPhase = await invMod.JobPhase.Query().MapToEntity(view);


            invMod.JobPhase.UpdateJobPhase(jobPhase).Apply();

            JobPhaseView retView = await invMod.JobPhase.Query().GetViewById(jobPhase.JobPhaseId);


            return(Ok(retView));
        }
Example #4
0
        public async Task <IActionResult> AddJobPhase([FromBody] JobPhaseView view)
        {
            JobPhaseModule invMod = new JobPhaseModule();

            NextNumber nnJobPhase = await invMod.JobPhase.Query().GetNextNumber();

            view.JobPhaseNumber = nnJobPhase.NextNumberValue;

            JobPhase jobPhase = await invMod.JobPhase.Query().MapToEntity(view);

            invMod.JobPhase.AddJobPhase(jobPhase).Apply();

            JobPhaseView newView = await invMod.JobPhase.Query().GetViewByNumber(view.JobPhaseNumber);


            return(Ok(newView));
        }