示例#1
0
        //public void AddMilkRates(List<MilkRate> milkRates)
        //{
        //    if (milkRates != null)
        //    {
        //        _repository.MilkRates.AddRange(milkRates);
        //        // _repository.SaveChanges();

        //    }
        //}

        public void Delete()
        {
            var milkRates = _repository.MilkRates.ToList <Sql.MilkRate>();

            _repository.MilkRates.RemoveRange(milkRates);
            _repository.SaveChanges();
        }
        public void Delete(int salesId)
        {
            var sale = _repository.ProductSales.Where(x => x.SalesId == salesId).FirstOrDefault();

            if (sale != null)
            {
                _repository.ProductSales.Remove(sale);
            }

            _repository.SaveChanges();
        }
示例#3
0
        public void Delete(int productOrderId)
        {
            var productOrder = _repository.ProductOrders.Where(x => x.OrderId == productOrderId).FirstOrDefault();

            if (productOrder != null)
            {
                _repository.ProductOrders.Remove(productOrder);
            }

            _repository.SaveChanges();
        }
        public void Delete(int customerWallerId)
        {
            var customerWallet = _repository.CustomerWallets.Where(x => x.WalletId == customerWallerId).FirstOrDefault();

            if (customerWallet != null)
            {
                _repository.CustomerWallets.Remove(customerWallet);
            }

            _repository.SaveChanges();
        }