Exemple #1
0
        public bool AddLineItem(QuoteLineItem qli)
        {
            bool flag;

            try
            {
                if (this.lineItems == null)
                {
                    this.lineItems = new List <QuoteLineItem>();
                }
                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);
        }
        public override bool Equals(object obj)
        {
            QuoteLineItem item = obj as QuoteLineItem;

            if (obj == null)
            {
                return(false);
            }
            return(obj.GetHashCode() == this.GetHashCode());
        }
Exemple #3
0
        public bool IsSameSerialStockLineItemExist(QuoteLineItem qli)
        {
            bool flag2;

            try
            {
                bool flag = false;
                foreach (QuoteLineItem item in this.lineItems)
                {
                    if ((qli.Item.ItemClass == ItemClass.SerializedStock) && (((((qli.Quantity == item.Quantity) && (qli.Item.ItemId == item.Item.ItemId)) && ((qli.Item.ItemClass == item.Item.ItemClass) && (qli.LineitemDescription == item.LineitemDescription))) && (((qli.LineitemAccount.AccountId == item.LineitemAccount.AccountId) && (qli.LineitemPrice == item.LineitemPrice)) && (qli.LineitemTax.Number == item.LineitemTax.Number))) && (qli.Job.Id == item.Job.Id)))
                    {
                        flag = true;
                    }
                }
                flag2 = flag;
            }
            catch (Exception)
            {
                throw;
            }
            return(flag2);
        }
Exemple #4
0
        public QuoteLineItem GetLineItem(QuoteLineItem qli)
        {
            QuoteLineItem item;

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

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