Exemplo n.º 1
0
        public async Task <IActionResult> GetJobCostLedgerView(long jobCostLedgerId)
        {
            JobCostLedgerModule invMod = new JobCostLedgerModule();

            JobCostLedgerView view = await invMod.JobCostLedger.Query().GetViewById(jobCostLedgerId);

            return(Ok(view));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> DeleteJobCostLedger([FromBody] JobCostLedgerView view)
        {
            JobCostLedgerModule invMod        = new JobCostLedgerModule();
            JobCostLedger       jobCostLedger = await invMod.JobCostLedger.Query().MapToEntity(view);

            invMod.JobCostLedger.DeleteJobCostLedger(jobCostLedger).Apply();

            return(Ok(view));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> UpdateJobCostLedger([FromBody] JobCostLedgerView view)
        {
            JobCostLedgerModule invMod = new JobCostLedgerModule();

            JobCostLedger jobCostLedger = await invMod.JobCostLedger.Query().MapToEntity(view);


            invMod.JobCostLedger.UpdateJobCostLedger(jobCostLedger).Apply();

            JobCostLedgerView retView = await invMod.JobCostLedger.Query().GetViewById(jobCostLedger.JobCostLedgerId);


            return(Ok(retView));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> AddJobCostLedger([FromBody] JobCostLedgerView view)
        {
            JobCostLedgerModule invMod = new JobCostLedgerModule();

            NextNumber nnJobCostLedger = await invMod.JobCostLedger.Query().GetNextNumber();

            view.JobCostLedgerNumber = nnJobCostLedger.NextNumberValue;

            JobCostLedger jobCostLedger = await invMod.JobCostLedger.Query().MapToEntity(view);

            invMod.JobCostLedger.AddJobCostLedger(jobCostLedger).Apply();

            JobCostLedgerView newView = await invMod.JobCostLedger.Query().GetViewByNumber(view.JobCostLedgerNumber);


            return(Ok(newView));
        }