Пример #1
0
        public int GetIndex(HRobItem chr, List <HRobItem> chrs, Boolean BySalesAcc, Boolean ByInvAcc, Boolean ByCGSAcc)
        {
            if (chr != null)
            {
                for (int i = 0; i < chrs.Count; i++)
                {
                    if (BySalesAcc == true)
                    {
                        if (chrs[i].SalesAccount.AccountId == chr.SalesAccount.AccountId)
                        {
                            return(i);
                        }
                    }
                    else if (ByCGSAcc == true)
                    {
                        if (chrs[i].CGSAccount.AccountId == chr.CGSAccount.AccountId)
                        {
                            return(i);
                        }
                    }

                    else if (ByInvAcc == true)
                    {
                        if (chrs[i].InventoryAccount.AccountId == chr.InventoryAccount.AccountId)
                        {
                            return(i);
                        }
                    }
                }
            }
            return(-1);
        }
Пример #2
0
        public override bool Equals(object obj)
        {
            HRobItem item = obj as HRobItem;

            if (item == null)
            {
                return(false);
            }
            return(item.lineNo == this.lineNo);
        }