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()); }
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); }
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); }
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); }