コード例 #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));
        }
コード例 #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));
        }
コード例 #3
0
ファイル: AssemblyMmsService.cs プロジェクト: qKinDzaDza/MMD
 public AssemblyMms GetAssemblyMms(string id)
 {
     return(_assemblyMmsRepository.GetAssemblyMms(id));
 }