示例#1
0
        public async Task <bool> Delete(Discount_CustomerGrouping Discount_CustomerGrouping)
        {
            Discount_CustomerGroupingDAO Discount_CustomerGroupingDAO = await DataContext.Discount_CustomerGrouping.Where(x => x.DiscountId == Discount_CustomerGrouping.DiscountId && x.CustomerGroupingId == Discount_CustomerGrouping.CustomerGroupingId).FirstOrDefaultAsync();

            DataContext.Discount_CustomerGrouping.Remove(Discount_CustomerGroupingDAO);
            await DataContext.SaveChangesAsync();

            return(true);
        }
示例#2
0
        public async Task <bool> Update(Discount_CustomerGrouping Discount_CustomerGrouping)
        {
            Discount_CustomerGroupingDAO Discount_CustomerGroupingDAO = DataContext.Discount_CustomerGrouping.Where(x => x.DiscountId == Discount_CustomerGrouping.DiscountId && x.CustomerGroupingId == Discount_CustomerGrouping.CustomerGroupingId).FirstOrDefault();

            Discount_CustomerGroupingDAO.DiscountId         = Discount_CustomerGrouping.DiscountId;
            Discount_CustomerGroupingDAO.CustomerGroupingId = Discount_CustomerGrouping.CustomerGroupingId;
            await DataContext.SaveChangesAsync();

            return(true);
        }
示例#3
0
        public async Task <bool> Create(Discount_CustomerGrouping Discount_CustomerGrouping)
        {
            Discount_CustomerGroupingDAO Discount_CustomerGroupingDAO = new Discount_CustomerGroupingDAO();

            Discount_CustomerGroupingDAO.DiscountId         = Discount_CustomerGrouping.DiscountId;
            Discount_CustomerGroupingDAO.CustomerGroupingId = Discount_CustomerGrouping.CustomerGroupingId;

            await DataContext.Discount_CustomerGrouping.AddAsync(Discount_CustomerGroupingDAO);

            await DataContext.SaveChangesAsync();

            return(true);
        }