示例#1
0
        public bool AddLineItem(SaleOrderlineItem qli)
        {
            bool flag;

            try
            {
                if (this.lineItems == null)
                {
                    this.lineItems = new List <SaleOrderlineItem>();
                }
                if (!this.lineItems.Contains(qli))
                {
                    this.lineItems.Add(qli);
                }
                else
                {
                    this.lineItems[this.lineItems.IndexOf(qli)] = qli;
                }
                flag = true;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(flag);
        }
示例#2
0
        public override bool Equals(object obj)
        {
            SaleOrderlineItem item = obj as SaleOrderlineItem;

            if (obj == null)
            {
                return(false);
            }
            return(obj.GetHashCode() == this.GetHashCode());
        }
示例#3
0
        public SaleOrderlineItem GetLineItem(SaleOrderlineItem qli)
        {
            SaleOrderlineItem item;

            try
            {
                if (this.lineItems == null)
                {
                    this.lineItems = new List <SaleOrderlineItem>();
                }
                if (this.lineItems.Contains(qli))
                {
                    return(this.lineItems[this.lineItems.IndexOf(qli)]);
                }
                item = null;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(item);
        }
示例#4
0
        public bool DelLineItem(SaleOrderlineItem sli)
        {
            bool flag;

            try
            {
                if (this.lineItems == null)
                {
                    this.lineItems = new List <SaleOrderlineItem>();
                }
                if (this.lineItems.Contains(sli))
                {
                    this.lineItems.RemoveAt(this.lineItems.IndexOf(sli));
                    return(true);
                }
                flag = false;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(flag);
        }