public IHttpActionResult Delete(int ItemCode, int FamilyCode)
        {
            try
            {
                int val = ItemDB.DeleteItem(ItemCode, FamilyCode);

                if (val > 0)
                {
                    return(Ok($"Item with ItemCode {ItemCode} and FamilyCode {FamilyCode} Successfully deleted!"));
                }
                else
                {
                    return(Content(HttpStatusCode.NotFound, $"Item with ItemCode {ItemCode} of {FamilyCode} was not found to delete!"));
                }
            }
            catch (Exception ex)
            {
                return(Content(HttpStatusCode.BadRequest, ex));
            }
        }
示例#2
0
 public void DeleteItem(Item item)
 {
     _itemdb.DeleteItem(item);
     // throw new NotImplementedException();
 }