Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }