示例#1
0
        public bool Create(AssociateDto associateDto)
        {
            try
            {
                _context.Associate.Add(new Associate()
                {
                    Agreement = new Agreement()
                    {
                        Description        = associateDto.Agreement.Description,
                        DiscountAmount     = associateDto.Agreement.DiscountAmount,
                        DiscountPercentage = associateDto.Agreement.DiscountPercentage
                    },
                    Customer = new Customer()
                    {
                        Name        = associateDto.Customer.Name,
                        Document    = associateDto.Customer.Document,
                        LegalEntity = associateDto.Customer.LegalEntity
                    },
                    Quantity = associateDto.Quantity
                });

                _context.SaveChanges();
                return(true);
            }
            catch
            {
                return(false);
            }
        }
示例#2
0
 public bool Update(AssociateDto associateDto)
 {
     throw new NotImplementedException();
 }