public async Task <PayRollTransactionControlView> MapToView(PayRollTransactionControl inputObject) { Mapper mapper = new Mapper(); PayRollTransactionControlView outObject = mapper.Map <PayRollTransactionControlView>(inputObject); await Task.Yield(); return(outObject); }
public async Task TestAddUpdatDelete() { PayRollTransactionControlModule PayRollTransactionControlMod = new PayRollTransactionControlModule(); PayRollTransactionControlView view = new PayRollTransactionControlView() { Description = "PayRollTransactionControl Test", PayRollTransactionCode = 99, CompanyCode = "1000", PayRollType = "DEDUCTION", RateAmount = 99.99M, RateType = "PERCENT", UpperLimit1 = 0.999M, UpperLimit2 = 0.999M }; NextNumber nnNextNumber = await PayRollTransactionControlMod.PayRollTransactionControl.Query().GetNextNumber(); view.PayRollTransactionControlNumber = nnNextNumber.NextNumberValue; PayRollTransactionControl payRollTransactionControl = await PayRollTransactionControlMod.PayRollTransactionControl.Query().MapToEntity(view); PayRollTransactionControlMod.PayRollTransactionControl.AddPayRollTransactionControl(payRollTransactionControl).Apply(); PayRollTransactionControl newPayRollTransactionControl = await PayRollTransactionControlMod.PayRollTransactionControl.Query().GetEntityByNumber(view.PayRollTransactionControlNumber); Assert.NotNull(newPayRollTransactionControl); newPayRollTransactionControl.Description = "PayRollTransactionControl Test Update"; PayRollTransactionControlMod.PayRollTransactionControl.UpdatePayRollTransactionControl(newPayRollTransactionControl).Apply(); PayRollTransactionControlView updateView = await PayRollTransactionControlMod.PayRollTransactionControl.Query().GetViewById(newPayRollTransactionControl.PayRollTransactionControlId); Assert.Same(updateView.Description, "PayRollTransactionControl Test Update"); PayRollTransactionControlMod.PayRollTransactionControl.DeletePayRollTransactionControl(newPayRollTransactionControl).Apply(); PayRollTransactionControl lookupPayRollTransactionControl = await PayRollTransactionControlMod.PayRollTransactionControl.Query().GetEntityById(view.PayRollTransactionControlId); Assert.Null(lookupPayRollTransactionControl); }