Esempio n. 1
0
        public bool AddLineItem(SaleInvoiceLineItem sli)
        {
            bool flag;

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

            if (obj == null)
            {
                return(false);
            }
            return((item.GetHashCode() == this.GetHashCode()) && (item.saleInvoiceLineItemType == this.saleInvoiceLineItemType));
        }
 public int GetNextLineItemNo(SaleInvoiceLineItem li, int oldLno, List <SaleInvoiceLineItem> lis)
 {
     for (int i = 0; i < lis.Count; i++)
     {
         if (li.SaleInvoiceLineItemType == lis[i].SaleInvoiceLineItemType && oldLno == lis[i].LineitemNo && oldLno != -1)
         {
             if (lis.Count > i + 1)
             {
                 return(lis[i + 1].LineitemNo);
             }
         }
         else if (oldLno == -1 && li.SaleInvoiceLineItemType == lis[i].SaleInvoiceLineItemType)
         {
             return(lis[i].LineitemNo);
         }
     }
     return(-1);
 }
Esempio n. 4
0
        public bool IsSameSerialStockLineItemExist(SaleInvoiceLineItem qli)
        {
            bool flag2;

            try
            {
                bool flag = false;
                foreach (SaleInvoiceLineItem item in this.lineItems)
                {
                    if ((qli.Item.ItemClass == ItemClass.SerializedStock) && (((((qli.SaleInvoice.saleInvoiceNo == item.SaleInvoice.saleInvoiceNo) && (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);
        }
Esempio n. 5
0
        public SaleInvoiceLineItem GetLineItem(SaleInvoiceLineItem sli)
        {
            SaleInvoiceLineItem item;

            try
            {
                if (this.lineItems == null)
                {
                    this.lineItems = new List <SaleInvoiceLineItem>();
                }
                if (this.lineItems.Contains(sli))
                {
                    return(this.lineItems[this.lineItems.IndexOf(sli)]);
                }
                item = null;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(item);
        }
Esempio n. 6
0
        public bool DelLineItem(SaleInvoiceLineItem sli)
        {
            bool flag;

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