Beispiel #1
0
        /// <summary>
        /// Добавление номенклатуры в каталог
        /// </summary>
        /// <param name="nomenclature">Добавляемая номеклатура</param>
        internal void AddNomenclature(Nomenclature nomenclature)
        {
            if (nomenclature == null)
            {
                throw new ArgumentNullException("nomenclature");
            }

            nomenclatures.Add(nomenclature);
        }
Beispiel #2
0
        /// <summary>
        /// Добавление номенклатуры
        /// </summary>
        /// <param name="nomenclature">Добавляемая номенклатура</param>
        public void AddNomenclature(Nomenclature nomenclature)
        {
            if (nomenclature == null)
            {
                throw new ArgumentNullException("nomenclature");
            }

            nomenclature.Name = catalog.GetNextAvailableNomenclatureName(nomenclature.Name);

            nomenclature.ParentId = this.Id;
            catalog.AddNomenclature(nomenclature);
        }
Beispiel #3
0
        /// <summary>
        /// Перемещение номенклатуры в другую папку
        /// </summary>
        /// <param name="nomenclature">Перемещаемая номенклатура</param>
        /// <param name="toFolder">Папка назначения</param>
        public void RelocateNomenclature(Nomenclature nomenclature, Folder toFolder)
        {
            if (nomenclature == null)
            {
                throw new ArgumentNullException("nomenclature");
            }

            if (toFolder == null)
            {
                throw new ArgumentNullException("toFolder");
            }

            nomenclature.ParentId = toFolder.Id;
        }
Beispiel #4
0
        /// <summary>
        /// Добавление номенклатуры
        /// </summary>
        /// <param name="name">Наименование добавляемой номенклатуры</param>
        /// <returns>Добавленная номенклатура</returns>
        public Nomenclature AddNomenclature(string name)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }

            name = catalog.GetNextAvailableNomenclatureName(name);

            var nomenclature = new Nomenclature(name)
            {
                ParentId = this.Id
            };

            catalog.AddNomenclature(nomenclature);
            return(nomenclature);
        }