// GET: PayrollRemoteAllowances/Edit/5
        public ActionResult Edit(int id)
        {
            PayrollRemoteAllowancesDTO rAId = _payrollRemoteAllowanceService.GetPayrollRemoteAllowanceByID(id);

            rAId.RankList   = _payrollRemoteAllowanceService.GetRankList();
            rAId.RemoteList = _payrollRemoteAllowanceService.GetRemoteList();
            return(View(rAId));
        }
        // GET: PayrollRemoteAllowances/Create
        public ActionResult Create()
        {
            PayrollRemoteAllowancesDTO data = new PayrollRemoteAllowancesDTO();

            data.RankList   = _payrollRemoteAllowanceService.GetRankList();
            data.RemoteList = _payrollRemoteAllowanceService.GetRemoteList();
            return(View(data));
        }
        public ActionResult Edit(PayrollRemoteAllowancesDTO payrollRemoteAllowance)
        {
            int rA = _payrollRemoteAllowanceService.UpdatePayrollRemoteAllowance(payrollRemoteAllowance);

            payrollRemoteAllowance.RankList   = _payrollRemoteAllowanceService.GetRankList();
            payrollRemoteAllowance.RemoteList = _payrollRemoteAllowanceService.GetRemoteList();
            ViewBag.success = String.Format("New Payroll Remote Service Updated");
            ModelState.Clear();
            return(View(payrollRemoteAllowance));
        }
 public static PayrollRemoteAllowance ConvertRespondentInfoFromDTO(PayrollRemoteAllowancesDTO AttDTO)
 {
     Mapper.CreateMap <PayrollRemoteAllowancesDTO, PayrollRemoteAllowance>().ConvertUsing(
         m => {
         return(new PayrollRemoteAllowance
         {
             RAId = m.RAId,
             RARankId = m.RARankId,
             RARemoteId = m.RARemoteId,
             RAType = m.RAType,
             RemoteAllowance = m.RemoteAllowance
         });
     });
     return(Mapper.Map <PayrollRemoteAllowancesDTO, PayrollRemoteAllowance>(AttDTO));
 }
        public ActionResult Create(PayrollRemoteAllowancesDTO payrollRemoteAllowance)
        {
            PayrollRemoteAllowancesDTO data = new PayrollRemoteAllowancesDTO();

            try
            {
                data.RankList   = _payrollRemoteAllowanceService.GetRankList();
                data.RemoteList = _payrollRemoteAllowanceService.GetRemoteList();
                _payrollRemoteAllowanceService.InsertPayrollRemoteAllowance(payrollRemoteAllowance);
                ViewBag.success = String.Format("New Payroll Remote Service Added");
                ModelState.Clear();
                return(View(data));
            }
            catch (Exception Ex)
            {
                ViewBag.error = Ex.Message;
                return(View(data));
            }
        }
Beispiel #6
0
        public int UpdatePayrollRemoteAllowance(PayrollRemoteAllowancesDTO data)
        {
            PayrollRemoteAllowance rA = PayrollRemoteAllowancesRequestFormatter.ConvertRespondentInfoFromDTO(data);

            return(_unitOfWork.PayrollRemoteAllowanceRepository.Update(rA));
        }
Beispiel #7
0
        public PayrollRemoteAllowancesDTO InsertPayrollRemoteAllowance(PayrollRemoteAllowancesDTO data)
        {
            PayrollRemoteAllowance rA = PayrollRemoteAllowancesRequestFormatter.ConvertRespondentInfoFromDTO(data);

            return(PayrollRemoteAllowancesRequestFormatter.ConvertRespondentToDTO(_unitOfWork.PayrollRemoteAllowanceRepository.Create(rA)));
        }
Beispiel #8
0
        public PayrollRemoteAllowancesDTO GetPayrollRemoteAllowanceByID(int rAId)
        {
            PayrollRemoteAllowancesDTO rA = PayrollRemoteAllowancesRequestFormatter.ConvertRespondentToDTO(_unitOfWork.PayrollRemoteAllowanceRepository.GetById(rAId));

            return(rA);
        }