Ejemplo n.º 1
0
        public ConfiguringMms CreateConfiguringMms(ConfiguringMms configuringMms)
        {
            if (configuringMms.AssemblyMmsId != null)
            {
                var assemblyMms = _assemblyMmsRepository.
                                  GetAssemblyMms(configuringMms.AssemblyMmsId);
                if (assemblyMms.ConfiguringMms != null)
                {
                    throw new Exception();
                }
                configuringMms.AssemblyMms = assemblyMms;
            }
            else
            {
                throw new ArgumentException($"Please, enter ID Assembly Mms ");
            }
            if (configuringMms.AuthorId != null)
            {
                configuringMms.Author = _authorRepository
                                        .GetAuthor(configuringMms.AuthorId.Value);
            }

            return(_configuringMmsRepository.CreateConfiguringMms(configuringMms));
        }
Ejemplo n.º 2
0
        public MakeProduct CreateMakeProduct(MakeProduct makeProduct)
        {
            if (makeProduct.AssemblyMmsId != null)
            {
                makeProduct.AssemblyMms = _assemblyMmsRepository
                                          .GetAssemblyMms(makeProduct.AssemblyMmsId);
            }
            else
            {
                throw new ArgumentException($"Please, enter ID Assembly Mms ");
            }
            if (makeProduct.AuthorId != null)
            {
                makeProduct.Author = _authorRepository
                                     .GetAuthor(makeProduct.AuthorId.Value);
            }
            if (makeProduct.WarehouseId != null)
            {
                makeProduct.Warehouse = _warehouseRepository
                                        .GetWarehouse(makeProduct.WarehouseId.Value);
            }

            return(_makeProductRepository.CreateMakeProduct(makeProduct));
        }
Ejemplo n.º 3
0
 public AssemblyMms GetAssemblyMms(string id)
 {
     return(_assemblyMmsRepository.GetAssemblyMms(id));
 }