Пример #1
0
 public string AddContact(Contact contact)
 {
     try {
         return(_customerService.AddContact(contact));
     } catch (Exception ex) {
         Log.Write(ex);
         throw;
     }
 }
Пример #2
0
        public IActionResult CreateCustomerContact(Contact contact, int customerId)
        {
            HttpContext.Items["AllowCustomerRedirect"] = true;

            if (ModelState.IsValid)
            {
                var savingResult = _customerService.AddContact(customerId, contact);
                TempData["CustomerResult"] = savingResult ? "Contact was added successfully!" : "Error!";

                return(RedirectToAction("Index", "CustomerDetails", new { customerId = customerId }));
            }

            ViewBag.customerId = customerId;
            return(View("~/Views/Admin/CustomerDetails/CreateCustomerContact.cshtml", contact));
        }
Пример #3
0
 public async Task <IActionResult> AddContact(string accountNumber, string customerName)
 {
     return(View("Contact",
                 await customerService.AddContact(accountNumber, customerName)
                 ));
 }
Пример #4
0
        public async Task <ActionResult <long> > AddContact(AddCustomerContact model)
        {
            var data = await service.AddContact(model);

            return(Ok(data));
        }