Exemplo n.º 1
0
Arquivo: Port.cs Projeto: lpyqyc/swm
        // TODO 重命名
        public virtual void SetCurrentUat(IUnitloadAllocationTable uat)
        {
            if (uat == null)
            {
                throw new ArgumentNullException(nameof(uat));
            }

            if (this.CurrentUat == uat)
            {
                return;
            }

            if (this.CurrentUat != null)
            {
                throw new InvalidOperationException($"出口已被占用。【{this.CurrentUat}】");
            }

            this.CurrentUat = uat;
        }
Exemplo n.º 2
0
        /// <summary>
        /// 设置 <see cref="CurrentUat"/> 和 <see cref="CurrentUatTypeDescription"/> 属性。
        /// </summary>
        /// <param name="uat"></param>
        /// <param name="uatTypeDescription"></param>
        public virtual void SetCurrentUat(IUnitloadAllocationTable uat, string uatTypeDescription)
        {
            if (uat == null)
            {
                throw new ArgumentNullException(nameof(uat));
            }

            if (uatTypeDescription == null)
            {
                throw new ArgumentNullException(nameof(uatTypeDescription));
            }

            if (this.CurrentUat != null && this.CurrentUat != uat)
            {
                throw new InvalidOperationException("已分配给其他单据");
            }

            this.CurrentUat = uat;
            this.CurrentUatTypeDescription = uatTypeDescription;
        }