コード例 #1
0
        public async Task <IActionResult> GetContractItemView(long contractItemId)
        {
            ContractItemModule invMod = new ContractItemModule();

            ContractItemView view = await invMod.ContractItem.Query().GetViewById(contractItemId);

            return(Ok(view));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        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));
        }