public async Task <IActionResult> GetContractItemView(long contractItemId) { ContractItemModule invMod = new ContractItemModule(); ContractItemView view = await invMod.ContractItem.Query().GetViewById(contractItemId); return(Ok(view)); }
public async Task <IActionResult> DeleteContractItem([FromBody] ContractItemView view) { ContractItemModule invMod = new ContractItemModule(); ContractItem contractItem = await invMod.ContractItem.Query().MapToEntity(view); invMod.ContractItem.DeleteContractItem(contractItem).Apply(); return(Ok(view)); }
public async Task <IActionResult> UpdateContractItem([FromBody] ContractItemView view) { ContractItemModule invMod = new ContractItemModule(); ContractItem contractItem = await invMod.ContractItem.Query().MapToEntity(view); invMod.ContractItem.UpdateContractItem(contractItem).Apply(); ContractItemView retView = await invMod.ContractItem.Query().GetViewById(contractItem.ContractItemId); return(Ok(retView)); }
public async Task <IActionResult> AddContractItem([FromBody] ContractItemView view) { ContractItemModule invMod = new ContractItemModule(); NextNumber nnContractItem = await invMod.ContractItem.Query().GetNextNumber(); view.ContractItemNumber = nnContractItem.NextNumberValue; ContractItem contractItem = await invMod.ContractItem.Query().MapToEntity(view); invMod.ContractItem.AddContractItem(contractItem).Apply(); ContractItemView newView = await invMod.ContractItem.Query().GetViewByNumber(view.ContractItemNumber); return(Ok(newView)); }