Ejemplo n.º 1
0
 public bool AddRemark(int empID, string remarkText)
 {
     if (empID != null)
     {
         if (!_remarksList.Exists(x => x.EmployeeID == empID))
         {
             Remarks remark = new Remarks();
             remark.EmployeeID  = empID;
             remark.DateTimeNow = DateTime.UtcNow;
             remark.Remark      = remarkText;
             _remarksList.Add(remark);
         }
         ///If the Remark on Employee already exists then append to the previous remark
         else
         {
             Remarks remark = _remarksList.Find(x => x.EmployeeID == empID);
             remark.Remark += remarkText;
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 2
0
 public Remarks GetRemark(int empID)
 {
     if (_remarksList.Exists(x => x.EmployeeID == empID))
     {
         Remarks remark = _remarksList.Find(x => x.EmployeeID == empID);
         return(remark);
     }
     throw new FaultException(new FaultReason("That employee ID does not exist in the database"), new FaultCode("106"));
 }
Ejemplo n.º 3
0
 public Employee()
 {
     this.Remarks = new List <Remark>();
     Remarks.Add(new Employee.Remark(DateTime.MinValue, null));
 }