예제 #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());
 }