示例#1
0
        public async Task <IActionResult> GetJobMasterView(long jobMasterId)
        {
            JobMasterModule invMod = new JobMasterModule();

            JobMasterView view = await invMod.JobMaster.Query().GetViewById(jobMasterId);

            return(Ok(view));
        }
示例#2
0
        public async Task <IActionResult> DeleteJobMaster([FromBody] JobMasterView view)
        {
            JobMasterModule invMod    = new JobMasterModule();
            JobMaster       jobMaster = await invMod.JobMaster.Query().MapToEntity(view);

            invMod.JobMaster.DeleteJobMaster(jobMaster).Apply();

            return(Ok(view));
        }
示例#3
0
        public async Task <IActionResult> UpdateJobMaster([FromBody] JobMasterView view)
        {
            JobMasterModule invMod = new JobMasterModule();

            JobMaster jobMaster = await invMod.JobMaster.Query().MapToEntity(view);


            invMod.JobMaster.UpdateJobMaster(jobMaster).Apply();

            JobMasterView retView = await invMod.JobMaster.Query().GetViewById(jobMaster.JobMasterId);


            return(Ok(retView));
        }
示例#4
0
        public async Task <IActionResult> AddJobMaster([FromBody] JobMasterView view)
        {
            JobMasterModule invMod = new JobMasterModule();

            NextNumber nnJobMaster = await invMod.JobMaster.Query().GetNextNumber();

            view.JobMasterNumber = nnJobMaster.NextNumberValue;

            JobMaster jobMaster = await invMod.JobMaster.Query().MapToEntity(view);

            invMod.JobMaster.AddJobMaster(jobMaster).Apply();

            JobMasterView newView = await invMod.JobMaster.Query().GetViewByNumber(view.JobMasterNumber);


            return(Ok(newView));
        }