Ejemplo n.º 1
0
 static FakeDatabase()
 { 
     //add two fake rows to our fake db
     Employee e = new Employee
     {
         EmpId = 1,
         FirstName = "Jake",
         LastName = "Drew",
         JobTitle = "Programmer",
         DOB = new DateTime(1980,12,23),
         Status = "Active"
     };
     Employee e2 = new Employee
     {
         EmpId = 2,
         FirstName = "Victoria",
         LastName = "McDowell-Drew",
         JobTitle = "Queen",
         DOB = new DateTime(1980, 3, 23),
         Status = "Inactive"
     };
     db.Add(db.Count + 1, e);
     keyIndex++;
     db.Add(db.Count + 1, e2);
     keyIndex++;
 }
Ejemplo n.º 2
0
 public static int add(Dictionary<string, string> data)
 {
     Employee e = new Employee 
     {
         EmpId = keyIndex,
         FirstName = data["First Name"],
         LastName = data["Last Name"],
         JobTitle = data["Job Title"],
         DOB = DateTime.Parse(data["DOB"]),
         Status = data["Status"]
     };
     db.Add(keyIndex, e);
     keyIndex++;
     return db.Count;
 }