public bool Delete(string ID) { IQueryable <InBillDetail> inBillDetailQuery = InBillDetailRepository.GetQueryable(); int intID = Convert.ToInt32(ID); var ibd = inBillDetailQuery.FirstOrDefault(i => i.ID == intID); InBillDetailRepository.Delete(ibd); InBillDetailRepository.SaveChanges(); return(true); }
public bool Delete(string ID, out string strResult) { strResult = string.Empty; bool result = false; try { IQueryable <InBillDetail> inBillDetailQuery = InBillDetailRepository.GetQueryable(); int intID = Convert.ToInt32(ID); var ibd = inBillDetailQuery.FirstOrDefault(i => i.ID == intID); InBillDetailRepository.Delete(ibd); InBillDetailRepository.SaveChanges(); result = true; } catch (Exception ex) { strResult = "删除失败,原因:" + ex.Message; } return(result); }