public async Task<PaginatedResponse<IEnumerable<EmployeeViewResponse>>> GetEmployees(EmployeeViewRequest request, int pageIndex, int pageSize, SystemSession session)
 {
     var serviceRequest = new Employees
     {
         UserId = request.TargetUserId,
         FilterId = request.FilterId,
         Offset = pageIndex,
         PageSize = pageSize,
         SearchTerm = request.SearchTerm
     };
     var response = await Task.Factory.StartNew(() => Client.UserService.getEmployees(serviceRequest, session.GetSession())).ConfigureAwait(false);
     var result = new PaginatedResponse<IEnumerable<EmployeeViewResponse>>
     {
         HasNextPage = response.HasNextPage,
         Page = response.CompanyEmployeeInfos.Select(
             x => new EmployeeViewResponse
             {
                 User = new UserResponse
                 {
                     UserId = x.UserId,
                     UserName = x.Username,
                     Name = x.Firstname + " " + x.Lastname,
                     Picture = x.Picture
                 },
                 Position = new GeneralKvPair<int?, string>
                 {
                     Id = x.PositionId,
                     Value = x.Position
                 },
                 EmploymentId = x.EmploymentId,
                 EmployeeTypeId = x.EmployeeTypeId,
                 EmploymentDate = new BeginEndDate
                 {
                     BeginDate = Convert.ToDateTime(x.StartDate),
                     EndDate = x.EndDate != null ? Convert.ToDateTime(x.EndDate) : (DateTime?)null
                 },
                 IsExecutiveBody = x.IsExecutiveBody,
                 Added = x.Added != null ? Convert.ToDateTime(x.Added) : (DateTime?)null,
                 IsApproved = x.ApprovedStatus
             })
     };
     return result;
 }
 public async Task<PaginatedResponse<IEnumerable<ResignationViewResponse>>> GetResignationRequest(int pageIndex, int pageSize, SystemSession session)
 {
     var serviceRequest = new Employees
     {
         UserId = session.UserId,
         Offset = pageIndex,
         PageSize = pageSize
     };
     var response = await Task.Factory.StartNew(() => Client.UserService.getResignationRequest(serviceRequest, session.GetSession())).ConfigureAwait(false);
     var result = new PaginatedResponse<IEnumerable<ResignationViewResponse>>
     {
         HasNextPage = response.HasNextPage,
         Page = response.Employees.Select(
          x => new ResignationViewResponse
          {
              PersonEmploymentId = x.PersonEmploymentId,
              User = new UserResponse
              {
                  UserId = x.UserId,
                  UserName = x.Username,
                  Name = x.Name,
                  Picture = x.Picture
              },
              Position = x.Position,
              EndDate = x.EndDate != null ? Convert.ToDateTime(x.EndDate) : (DateTime?)null
          })
     };
     return result;
 }
Esempio n. 3
0
 public void send_getResignationRequest(Employees employee, Session session)
 #endif
 {
   oprot_.WriteMessageBegin(new TMessage("getResignationRequest", TMessageType.Call, seqid_));
   getResignationRequest_args args = new getResignationRequest_args();
   args.Employee = employee;
   args.Session = session;
   args.Write(oprot_);
   oprot_.WriteMessageEnd();
   #if SILVERLIGHT
   return oprot_.Transport.BeginFlush(callback, state);
   #else
   oprot_.Transport.Flush();
   #endif
 }
Esempio n. 4
0
 public IAsyncResult send_getResignationRequest(AsyncCallback callback, object state, Employees employee, Session session)
Esempio n. 5
0
      public EmployeeList getResignationRequest(Employees employee, Session session)
      {
        #if !SILVERLIGHT
        send_getResignationRequest(employee, session);
        return recv_getResignationRequest();

        #else
        var asyncResult = Begin_getResignationRequest(null, null, employee, session);
        return End_getResignationRequest(asyncResult);

        #endif
      }
Esempio n. 6
0
 public IAsyncResult Begin_getResignationRequest(AsyncCallback callback, object state, Employees employee, Session session)
 {
   return send_getResignationRequest(callback, state, employee, session);
 }
Esempio n. 7
0
 public IAsyncResult send_getEmployees(AsyncCallback callback, object state, Employees employees, Session session)
Esempio n. 8
0
      public CompanyEmployeeInfoList getEmployees(Employees employees, Session session)
      {
        #if !SILVERLIGHT
        send_getEmployees(employees, session);
        return recv_getEmployees();

        #else
        var asyncResult = Begin_getEmployees(null, null, employees, session);
        return End_getEmployees(asyncResult);

        #endif
      }
Esempio n. 9
0
 public IAsyncResult Begin_getEmployees(AsyncCallback callback, object state, Employees employees, Session session)
 {
   return send_getEmployees(callback, state, employees, session);
 }
Esempio n. 10
0
 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.Struct) {
           Employee = new Employees();
           Employee.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.Struct) {
           Session = new Session();
           Session.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }