Пример #1
0
 public ActionResult Create([Bind] Customer objModel)
 {
     if (ModelState.IsValid)
     {
         objModel.UserId = Convert.ToInt32(TempData["SessionUserId"]);
         _customerService.AddUpdateCustomer(objModel);
         TempData["Success"] = "Information added successfully!";
         return(RedirectToAction("Index"));
     }
     return(View(objModel));
 }
Пример #2
0
 public IActionResult AddCustomer([FromBody] Customer model)
 {
     if (ModelState.IsValid)
     {
         var Customers = _customerService.AddUpdateCustomer(model);
         return(Ok(Customers));
     }
     return(BadRequest());
 }