public async Task <ActionResult <Location> > DeleteLocation(int id)
        {
            await _location.Delete(id);

            await _log.CreateLog(HttpContext, User.FindFirst("UserName").Value);

            return(NoContent());
        }
Esempio n. 2
0
        public IActionResult Deletelocation(long Id)
        {
            if (Id.Equals(0))
            {
                ViewBag.ErrorMessage = $"The location Resource with Id = { Id } could not be found";
                return(View("NotFound"));
            }
            Location location = locationRepository.GetById(Id);

            if (location == null)
            {
                ViewBag.ErrorMessage = $"The location Resource with Id = { Id } could not be found";
                return(View("NotFound"));
            }
            string location_title = location.Title;

            locationRepository.Delete(location);
            locationRepository.Save();
            TempData["deleted"] = $"The Location { location_title }, was successfully deleted.";
            return(Json(new { success = true }));
        }
Esempio n. 3
0
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            await _location.Delete(id);

            return(RedirectToAction(nameof(Index)));
        }
Esempio n. 4
0
 public LocationBO Delete(long id)
 {
     return(_location.Delete(id));
 }
Esempio n. 5
0
 /// <summary>
 /// 删除一条数据
 /// </summary>
 public bool Delete(string CODE, string PRODUCT_CODE, string WAREHOUSE_CODE)
 {
     return(dal.Delete(CODE, PRODUCT_CODE, WAREHOUSE_CODE));
 }