Example #1
0
        public ActionResult Create(Lib.Customer customer)
        {
            try
            {
                // TODO: Add insert logic here
                var newCustomer = new Lib.Customer
                {
                    FirstName      = customer.FirstName,
                    LastName       = customer.LastName,
                    DefaultStoreId = customer.DefaultStoreId
                };

                CRepo.InsertCustomer(newCustomer);
                return(RedirectToAction(nameof(Index)));
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.ToString());
                return(RedirectToAction("Error", "Home"));
            }
        }