public async Task <IActionResult> GetTimeAndAttendanceScheduledToWorkView(long timeAndAttendanceScheduledToWorkId)
        {
            TimeAndAttendanceScheduledToWorkModule invMod = new TimeAndAttendanceScheduledToWorkModule();

            TimeAndAttendanceScheduledToWorkView view = await invMod.ScheduledToWork.Query().GetViewById(timeAndAttendanceScheduledToWorkId);

            return(Ok(view));
        }
        public async Task <IActionResult> DeleteTimeAndAttendanceScheduledToWork([FromBody] TimeAndAttendanceScheduledToWorkView view)
        {
            TimeAndAttendanceScheduledToWorkModule invMod = new TimeAndAttendanceScheduledToWorkModule();
            TimeAndAttendanceScheduledToWork       timeAndAttendanceScheduledToWork = await invMod.ScheduledToWork.Query().MapToEntity(view);

            invMod.ScheduledToWork.DeleteTimeAndAttendanceScheduledToWork(timeAndAttendanceScheduledToWork).Apply();

            return(Ok(view));
        }
        public async Task <IActionResult> AddTimeAndAttendanceScheduledToWork([FromBody] TimeAndAttendanceScheduledToWorkView view)
        {
            TimeAndAttendanceScheduledToWorkModule invMod = new TimeAndAttendanceScheduledToWorkModule();

            NextNumber nnTimeAndAttendanceScheduledToWork = await invMod.ScheduledToWork.Query().GetNextNumber();

            view.ScheduledToWorkNumber = nnTimeAndAttendanceScheduledToWork.NextNumberValue;

            TimeAndAttendanceScheduledToWork timeAndAttendanceScheduledToWork = await invMod.ScheduledToWork.Query().MapToEntity(view);

            invMod.ScheduledToWork.AddTimeAndAttendanceScheduledToWork(timeAndAttendanceScheduledToWork).Apply();

            TimeAndAttendanceScheduledToWorkView newView = await invMod.ScheduledToWork.Query().GetViewByNumber(view.ScheduledToWorkNumber);


            return(Ok(newView));
        }