Esempio n. 1
0
        public async Task <PayRollCurrentPaySequenceView> MapToView(PayRollCurrentPaySequence inputObject)
        {
            Mapper mapper = new Mapper();
            PayRollCurrentPaySequenceView outObject = mapper.Map <PayRollCurrentPaySequenceView>(inputObject);
            await Task.Yield();

            return(outObject);
        }
Esempio n. 2
0
        public async Task <IActionResult> DeletePayRollCurrentPaySequence([FromBody] PayRollCurrentPaySequenceView view)
        {
            PayRollCurrentPaySequenceModule invMod = new PayRollCurrentPaySequenceModule();
            PayRollCurrentPaySequence       payRollCurrentPaySequence = await invMod.PayRollCurrentPaySequence.Query().MapToEntity(view);

            invMod.PayRollCurrentPaySequence.DeletePayRollCurrentPaySequence(payRollCurrentPaySequence).Apply();

            return(Ok(view));
        }
Esempio n. 3
0
        public async Task <IList <PayRollCurrentPaySequence> > MapToEntity(IList <PayRollCurrentPaySequenceView> inputObjects)
        {
            IList <PayRollCurrentPaySequence> list = new List <PayRollCurrentPaySequence>();
            Mapper mapper = new Mapper();

            foreach (var item in inputObjects)
            {
                PayRollCurrentPaySequence outObject = mapper.Map <PayRollCurrentPaySequence>(item);
                list.Add(outObject);
            }
            await Task.Yield();

            return(list);
        }
Esempio n. 4
0
        public async Task <IActionResult> AddPayRollCurrentPaySequence([FromBody] PayRollCurrentPaySequenceView view)
        {
            PayRollCurrentPaySequenceModule invMod = new PayRollCurrentPaySequenceModule();

            NextNumber nnPayRollCurrentPaySequence = await invMod.PayRollCurrentPaySequence.Query().GetNextNumber();

            view.PayRollCurrentPaySequenceNumber = nnPayRollCurrentPaySequence.NextNumberValue;

            PayRollCurrentPaySequence payRollCurrentPaySequence = await invMod.PayRollCurrentPaySequence.Query().MapToEntity(view);

            invMod.PayRollCurrentPaySequence.AddPayRollCurrentPaySequence(payRollCurrentPaySequence).Apply();

            PayRollCurrentPaySequenceView newView = await invMod.PayRollCurrentPaySequence.Query().GetViewByNumber(view.PayRollCurrentPaySequenceNumber);


            return(Ok(newView));
        }
Esempio n. 5
0
        public async Task TestAddUpdatDelete()
        {
            PayRollCurrentPaySequenceModule PayRollCurrentPaySequenceMod = new PayRollCurrentPaySequenceModule();

            PayRollCurrentPaySequenceView view = new PayRollCurrentPaySequenceView()
            {
                PaySequence = 0,
                PayRollCurrentPaySequenceNumber = 0,
                PayRollCode      = 1,
                PayRollBeginDate = DateTime.Parse("10/7/2019"),
                PayRollEndDate   = DateTime.Parse("10/11/2019"),
                Frequency        = "Bi-Weekly",
                Active           = false
            };
            NextNumber nnNextNumber = await PayRollCurrentPaySequenceMod.PayRollCurrentPaySequence.Query().GetNextNumber();

            view.PayRollCurrentPaySequenceNumber = nnNextNumber.NextNumberValue;

            PayRollCurrentPaySequence payRollCurrentPaySequence = await PayRollCurrentPaySequenceMod.PayRollCurrentPaySequence.Query().MapToEntity(view);

            PayRollCurrentPaySequenceMod.PayRollCurrentPaySequence.AddPayRollCurrentPaySequence(payRollCurrentPaySequence).Apply();

            PayRollCurrentPaySequence newPayRollCurrentPaySequence = await PayRollCurrentPaySequenceMod.PayRollCurrentPaySequence.Query().GetEntityByNumber(view.PayRollCurrentPaySequenceNumber);

            Assert.NotNull(newPayRollCurrentPaySequence);

            newPayRollCurrentPaySequence.Frequency = "Bi-Weekly Update";

            PayRollCurrentPaySequenceMod.PayRollCurrentPaySequence.UpdatePayRollCurrentPaySequence(newPayRollCurrentPaySequence).Apply();

            PayRollCurrentPaySequenceView updateView = await PayRollCurrentPaySequenceMod.PayRollCurrentPaySequence.Query().GetViewById(newPayRollCurrentPaySequence.PayRollCurrentPaySequenceId);

            Assert.Same(updateView.Frequency, "Bi-Weekly Update");
            PayRollCurrentPaySequenceMod.PayRollCurrentPaySequence.DeletePayRollCurrentPaySequence(newPayRollCurrentPaySequence).Apply();
            PayRollCurrentPaySequence lookupPayRollCurrentPaySequence = await PayRollCurrentPaySequenceMod.PayRollCurrentPaySequence.Query().GetEntityById(view.PayRollCurrentPaySequenceId);

            Assert.Null(lookupPayRollCurrentPaySequence);
        }
Esempio n. 6
0
        public async Task <PayRollCurrentPaySequenceView> GetViewByNumber(long payRollCurrentPaySequenceNumber)
        {
            PayRollCurrentPaySequence detailItem = await _unitOfWork.payRollCurrentPaySequenceRepository.GetEntityByNumber(payRollCurrentPaySequenceNumber);

            return(await MapToView(detailItem));
        }
 public IFluentPayRollCurrentPaySequence DeletePayRollCurrentPaySequence(PayRollCurrentPaySequence deleteObject)
 {
     unitOfWork.payRollCurrentPaySequenceRepository.DeleteObject(deleteObject);
     this.processStatus = CreateProcessStatus.Delete;
     return(this as IFluentPayRollCurrentPaySequence);
 }
 public IFluentPayRollCurrentPaySequence AddPayRollCurrentPaySequence(PayRollCurrentPaySequence newObject)
 {
     unitOfWork.payRollCurrentPaySequenceRepository.AddObject(newObject);
     this.processStatus = CreateProcessStatus.Insert;
     return(this as IFluentPayRollCurrentPaySequence);
 }