예제 #1
0
 public Consignment UpdateConsignment(UpdateConsignment updateConsignment)
 {
     if (updateConsignment.AssemblyMmsIds != null)
     {
         var assemblyMmses = _assemblyMmsService
                             .GetAssemblyMmsByIds(updateConsignment.AssemblyMmsIds);
         if (assemblyMmses.Any(a => a.Consignment != null))
         {
             throw new Exception();
         }
         updateConsignment.AssemblyMms = assemblyMmses;
     }
     return(_consignmentRepository.UpdateConsignment(updateConsignment));
 }
예제 #2
0
        public Consignment UpdateConsignment(UpdateConsignment updateConsignment)
        {
            var consignment = _context.Consignments.Where(a => a.Id.Equals(updateConsignment.Id)).SingleOrDefault();

            if (consignment is null)
            {
                throw new Exception("");
            }

            if (updateConsignment.AssemblyMms != null)
            {
                consignment.AssemblyMms = updateConsignment.AssemblyMms;
            }


            _context.SaveChanges();

            return(consignment);
        }
예제 #3
0
 public Consignment UpdateConsignment(UpdateConsignment consignment)
 {
     return(_consignmentService.UpdateConsignment(consignment));
 }