public async Task <IActionResult> GetPayRollLedgerView(long payRollLedgerId) { PayRollLedgerModule invMod = new PayRollLedgerModule(); PayRollLedgerView view = await invMod.PayRollLedger.Query().GetViewById(payRollLedgerId); return(Ok(view)); }
public async Task <IActionResult> DeletePayRollLedger([FromBody] PayRollLedgerView view) { PayRollLedgerModule invMod = new PayRollLedgerModule(); PayRollLedger payRollLedger = await invMod.PayRollLedger.Query().MapToEntity(view); invMod.PayRollLedger.DeletePayRollLedger(payRollLedger).Apply(); return(Ok(view)); }
public async Task <IActionResult> UpdatePayRollLedger([FromBody] PayRollLedgerView view) { PayRollLedgerModule invMod = new PayRollLedgerModule(); PayRollLedger payRollLedger = await invMod.PayRollLedger.Query().MapToEntity(view); invMod.PayRollLedger.UpdatePayRollLedger(payRollLedger).Apply(); PayRollLedgerView retView = await invMod.PayRollLedger.Query().GetViewById(payRollLedger.PayRollLedgerId); return(Ok(retView)); }
public async Task <IActionResult> AddPayRollLedger([FromBody] PayRollLedgerView view) { PayRollLedgerModule invMod = new PayRollLedgerModule(); NextNumber nnPayRollLedger = await invMod.PayRollLedger.Query().GetNextNumber(); view.PayRollLedgerNumber = nnPayRollLedger.NextNumberValue; PayRollLedger payRollLedger = await invMod.PayRollLedger.Query().MapToEntity(view); invMod.PayRollLedger.AddPayRollLedger(payRollLedger).Apply(); PayRollLedgerView newView = await invMod.PayRollLedger.Query().GetViewByNumber(view.PayRollLedgerNumber); return(Ok(newView)); }