Exemple #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);
            }
        }
Exemple #2
0
        public bool Contains(LoanInfo value)
        {
            if (IndexOf(value) > -1)
            {
                return(true);
            }

            return(false);
        }
Exemple #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);
        }
 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;
 }
Exemple #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;
 }
Exemple #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);
        }
Exemple #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));
        }
        public void Remove(LoanInfo value)
        {
            List.Remove(value);

            innerListChanged = true;
        }
Exemple #9
0
        public void Remove(LoanInfo value)
        {
            List.Remove(value);

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

            innerListChanged = true;
        }
        public bool Contains(LoanInfo value)
        {
            if (IndexOf(value) > -1)
                return true;

            return false;
        }
Exemple #14
0
 public int Add(LoanInfo value)
 {
     return(this.List.Add(value));
 }
 public void CopyTo(LoanInfo[] array, int index)
 {
     this.List.CopyTo(array, index);
 }
        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;
        }
        public void Insert(int index, LoanInfo value)
        {
            List.Insert(index, value);

            innerListChanged = true;
        }
 /// <summary>
 /// Constructor using CcZlCzBillInfo array.
 /// </summary>
 /// <param name="value" />
 public LoanCollection(LoanInfo[] value)
 {
     this.AddRange(value);
 }
Exemple #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);
        }