Example #1
0
        public async Task <IActionResult> LocationEdit(Bar.Models.Location model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    await _service.Update(model.Id, model);

                    return(Ok("Ok"));
                }
                return(PartialView("_LocationPartialView", model));
            }
            catch
            {
                return(BadRequest());
            }
        }
Example #2
0
 public async Task <IActionResult> GetLocation(int id = 0)
 {
     try
     {
         var model = new Bar.Models.Location {
             Id = id
         };
         if (id != 0)
         {
             model = await _service.Get(id);
         }
         return(PartialView("_LocationPartialView", model));
     }
     catch
     {
         return(BadRequest());
     }
 }