public static DAL.App.DTO.PaymentMethod MapFromBLL(BLL.App.DTO.PaymentMethod paymentMethod)
        {
            var res = paymentMethod == null ? null : new DAL.App.DTO.PaymentMethod
            {
                Id = paymentMethod.Id,
                PaymentMethodValue = paymentMethod.PaymentMethodValue
            };

            return(res);
        }
Exemple #2
0
        public async Task <IActionResult> Create([Bind("PaymentMethodValue,Id")] BLL.App.DTO.PaymentMethod paymentMethod)
        {
            if (ModelState.IsValid)
            {
                await _bll.PaymentMethods.AddAsync(paymentMethod);

                await _bll.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }

            return(View(paymentMethod));
        }
Exemple #3
0
        public async Task <IActionResult> Edit(int id, [Bind("PaymentMethodValue,Id")] BLL.App.DTO.PaymentMethod paymentMethod)
        {
            if (id != paymentMethod.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                _bll.PaymentMethods.Update(paymentMethod);
                await _bll.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }

            return(View(paymentMethod));
        }