예제 #1
0
        public ActionResult Delete(int id, CustomerViewModel customerViewModel)
        {
            try
            {
                //Email
                string UserEmail = User.Identity.Name;

                _buisnessLogicClass.DeleteUser(id, UserEmail);
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.Message);
                ModelState.AddModelError("Failure", ex.Message);
            }

            List <Customer>          customers          = _buisnessLogicClass.GetAllTheCustomers();
            List <CustomerViewModel> customerViewModels = new List <CustomerViewModel>();

            foreach (Customer c in customers)
            {
                customerViewModels.Add(_buisnessLogicClass.ConvertCustomerIntoVM(c));
            }

            return(View("Index", customerViewModels));
        }