Пример #1
0
        public LoanInfo Get(long id)
        {
            if (indexerForPrimaryKeys == null || innerListChanged)
            {
                innerListChanged = false;

                indexerForPrimaryKeys = new Dictionary <string, int>();

                for (int i = 0, count = this.List.Count; i < count; i++)
                {
                    LoanInfo loanInfo = this.List[i] as LoanInfo;

                    indexerForPrimaryKeys.Add(string.Concat(loanInfo.Id.ToString()), i);
                }
            }

            int index;

            if (indexerForPrimaryKeys.TryGetValue(string.Concat(id.ToString()), out index))
            {
                return(this.List[index] as LoanInfo);
            }
            else
            {
                return(null);
            }
        }
Пример #2
0
        public bool Contains(LoanInfo value)
        {
            if (IndexOf(value) > -1)
            {
                return(true);
            }

            return(false);
        }
Пример #3
0
        public int IndexOf(LoanInfo value)
        {
            for (int i = 0, count = this.List.Count; i < count; i++)
            {
                if (value.Equals(this.List[i] as LoanInfo))
                {
                    return(i);
                }
            }

            return(-1);
        }
Пример #4
0
 public LoanInfo(LoanInfo loanInfo)
 {
     this.id = loanInfo.Id;
     this.loanType = loanInfo.LoanType;
     this.loanAccount = loanInfo.LoanAccount;
     this.lender = loanInfo.Lender;
     this.borrower = loanInfo.Borrower;
     this.borrowType = loanInfo.BorrowType;
     this.borrowAccount = loanInfo.BorrowAccount;
     this.loanAmount = loanInfo.LoanAmount;
     this.loanDate = loanInfo.LoanDate;
     this.returnDate = loanInfo.ReturnDate;
     this.content = loanInfo.Content;
 }
Пример #5
0
 public LoanInfo(LoanInfo loanInfo)
 {
     this.id            = loanInfo.Id;
     this.loanType      = loanInfo.LoanType;
     this.loanAccount   = loanInfo.LoanAccount;
     this.lender        = loanInfo.Lender;
     this.borrower      = loanInfo.Borrower;
     this.borrowType    = loanInfo.BorrowType;
     this.borrowAccount = loanInfo.BorrowAccount;
     this.loanAmount    = loanInfo.LoanAmount;
     this.loanDate      = loanInfo.LoanDate;
     this.returnDate    = loanInfo.ReturnDate;
     this.content       = loanInfo.Content;
 }
Пример #6
0
        public static void AddTableRow(DataTable table, LoanInfo loanInfo)
        {
            System.Data.DataRow dr = table.NewRow();

            dr["Id"]            = loanInfo.id;
            dr["LoanType"]      = loanInfo.loanType;
            dr["LoanAccount"]   = loanInfo.loanAccount;
            dr["Lender"]        = loanInfo.lender;
            dr["BorrowType"]    = loanInfo.loanType;
            dr["BorrowAccount"] = loanInfo.borrowAccount;
            dr["Borrower"]      = loanInfo.borrower;
            dr["LoanAmount"]    = loanInfo.loanAmount;
            dr["LoanDate"]      = loanInfo.loanDate;
            dr["ReturnDate"]    = loanInfo.returnDate;
            dr["Content"]       = loanInfo.content;
            table.Rows.Add(dr);
        }
Пример #7
0
        public override bool Equals(object obj)
        {
            if (!base.Equals(obj))
            {
                return(false);
            }
            if (obj == null)
            {
                return(false);
            }
            if (this.GetType() != obj.GetType())
            {
                return(false);
            }

            LoanInfo loanInfo = obj as LoanInfo;

            return(this.id.Equals(loanInfo.Id));
        }
Пример #8
0
        public void Remove(LoanInfo value)
        {
            List.Remove(value);

            innerListChanged = true;
        }
Пример #9
0
        public void Remove(LoanInfo value)
        {
            List.Remove(value);

            innerListChanged = true;
        }
Пример #10
0
 public int Add(LoanInfo value)
 {
     return this.List.Add(value);
 }
Пример #11
0
 public void AddRange(LoanInfo[] value)
 {
     for (int i = 0; (i < value.Length); i++)
     {
         this.Add(value[i]);
     }
 }
Пример #12
0
        public void Insert(int index, LoanInfo value)
        {
            List.Insert(index, value);

            innerListChanged = true;
        }
Пример #13
0
        public bool Contains(LoanInfo value)
        {
            if (IndexOf(value) > -1)
                return true;

            return false;
        }
Пример #14
0
 public int Add(LoanInfo value)
 {
     return(this.List.Add(value));
 }
Пример #15
0
 public void CopyTo(LoanInfo[] array, int index)
 {
     this.List.CopyTo(array, index);
 }
Пример #16
0
        public int IndexOf(LoanInfo value)
        {
            for (int i = 0, count = this.List.Count; i < count; i++)
            {
                if (value.Equals(this.List[i] as LoanInfo))
                    return i;
            }

            return -1;
        }
Пример #17
0
        public void Insert(int index, LoanInfo value)
        {
            List.Insert(index, value);

            innerListChanged = true;
        }
Пример #18
0
 /// <summary>
 /// Constructor using CcZlCzBillInfo array.
 /// </summary>
 /// <param name="value" />
 public LoanCollection(LoanInfo[] value)
 {
     this.AddRange(value);
 }
Пример #19
0
        public static void AddTableRow(DataTable table, LoanInfo loanInfo)
        {
            System.Data.DataRow dr = table.NewRow();

            dr["Id"] = loanInfo.id;
            dr["LoanType"] = loanInfo.loanType;
            dr["LoanAccount"] = loanInfo.loanAccount;
            dr["Lender"] = loanInfo.lender;
            dr["BorrowType"] = loanInfo.loanType;
            dr["BorrowAccount"] = loanInfo.borrowAccount;
            dr["Borrower"] = loanInfo.borrower;
            dr["LoanAmount"] = loanInfo.loanAmount;
            dr["LoanDate"] = loanInfo.loanDate;
            dr["ReturnDate"] = loanInfo.returnDate;
            dr["Content"] = loanInfo.content;
            table.Rows.Add(dr);
        }