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 <IActionResult> DeletePayRollTransactionControl([FromBody] PayRollTransactionControlView view) { PayRollTransactionControlModule invMod = new PayRollTransactionControlModule(); PayRollTransactionControl payRollTransactionControl = await invMod.PayRollTransactionControl.Query().MapToEntity(view); invMod.PayRollTransactionControl.DeletePayRollTransactionControl(payRollTransactionControl).Apply(); return(Ok(view)); }
public async Task <IList <PayRollTransactionControl> > MapToEntity(IList <PayRollTransactionControlView> inputObjects) { IList <PayRollTransactionControl> list = new List <PayRollTransactionControl>(); Mapper mapper = new Mapper(); foreach (var item in inputObjects) { PayRollTransactionControl outObject = mapper.Map <PayRollTransactionControl>(item); list.Add(outObject); } await Task.Yield(); return(list); }
public async Task <IActionResult> AddPayRollTransactionControl([FromBody] PayRollTransactionControlView view) { PayRollTransactionControlModule invMod = new PayRollTransactionControlModule(); NextNumber nnPayRollTransactionControl = await invMod.PayRollTransactionControl.Query().GetNextNumber(); view.PayRollTransactionControlNumber = nnPayRollTransactionControl.NextNumberValue; PayRollTransactionControl payRollTransactionControl = await invMod.PayRollTransactionControl.Query().MapToEntity(view); invMod.PayRollTransactionControl.AddPayRollTransactionControl(payRollTransactionControl).Apply(); PayRollTransactionControlView newView = await invMod.PayRollTransactionControl.Query().GetViewByNumber(view.PayRollTransactionControlNumber); return(Ok(newView)); }
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); }
public IFluentPayRollTransactionControl DeletePayRollTransactionControl(PayRollTransactionControl deleteObject) { unitOfWork.payRollTransactionControlRepository.DeleteObject(deleteObject); this.processStatus = CreateProcessStatus.Delete; return(this as IFluentPayRollTransactionControl); }
public IFluentPayRollTransactionControl AddPayRollTransactionControl(PayRollTransactionControl newObject) { unitOfWork.payRollTransactionControlRepository.AddObject(newObject); this.processStatus = CreateProcessStatus.Insert; return(this as IFluentPayRollTransactionControl); }
public async Task <PayRollTransactionControlView> GetViewByNumber(long payRollTransactionControlNumber) { PayRollTransactionControl detailItem = await _unitOfWork.payRollTransactionControlRepository.GetEntityByNumber(payRollTransactionControlNumber); return(await MapToView(detailItem)); }