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); }
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); }
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); }