public Department UpdateDepartment(DepartmentAddEditArgs args) { Department returnItem = null; /* Start Temp Code */ ////returnItem = new Department() { DepartmentUUID = Guid.NewGuid(), DepartmentName = "DeptUpdate", CreateDate = DateTime.Now, TheVersionProperty = new byte[8] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 } }; /* End Temp Code */ ////Below Code is Good Code...Comment out the "Temp Code" (above) and uncomment below to hit the database. IDataReader idr = this.AdoDepartmentData.UpdateDepartment(args); returnItem = new DepartmentDefaultSerializer().SerializeSingle(idr); return(returnItem); }
public DepartmentCollection GetAllDepartments() { DepartmentCollection returnCollection = new DepartmentCollection(); /* Start Temp Code */ ////Department d1 = new Department() { DepartmentUUID = Guid.NewGuid(), DepartmentName = "Dept1", CreateDate = DateTime.Now, TheVersionProperty = new byte[8] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 } }; ////Department d2 = new Department() { DepartmentUUID = Guid.NewGuid(), DepartmentName = "Dept2", CreateDate = DateTime.Now, TheVersionProperty = new byte[8] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 } }; ////Department d3 = new Department() { DepartmentUUID = Guid.NewGuid(), DepartmentName = "Dept3", CreateDate = DateTime.Now, TheVersionProperty = new byte[8] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 } }; ////returnCollection.Add(d1); ////returnCollection.Add(d2); ////returnCollection.Add(d3); /* End Temp Code */ ////Below Code is Good Code...Comment out the "Temp Code" (above) and uncomment below to hit the database. IDataReader idr = this.AdoDepartmentData.GetAllDepartmentsDataReader(); ICollection <Department> coll = new DepartmentDefaultSerializer().SerializeCollection(idr); returnCollection.AddRange(coll); return(returnCollection); }