Exemple #1
0
        private void DoPunchIn(string enrollmentId)
        {
            PunchManager     punchManager = new PunchManager();
            UserVoiceManager mgr          = new UserVoiceManager();

            EmployeeEnrollment enrollment = mgr.GetEmployeeEnrollment(enrollmentId);

            if (enrollment != null)
            {
                Punch p = new Punch
                {
                    ClientId            = enrollment.ClientId,
                    EmployeeUid         = enrollment.EmployeeUid,
                    DepartmentUid       = enrollment.DepartmentUid,
                    PunchDateTime       = DateTime.Now,
                    PunchSourceTypeId   = (byte)1, //manual
                    PunchActivityTypeId = (byte)1, //work
                    PunchStatusTypeId   = (byte)1, //auto
                    LaborAssociations   = new System.Collections.Generic.List <LaborPunchAssociation>(),
                    IsActive            = true,
                    CanBeProcessed      = true,
                    UserKey             = Guid.Parse("C00E2729-9FFA-E511-8893-005056BD7869")
                };

                punchManager.InsertPunch(p);
            }
            else
            {
                throw new Exception("Enrollment record could not be read from cosmosdb");
            }
        }
Exemple #2
0
        public string SaveUserVoiceData(EmployeeEnrollment employeeEnrollment)
        {
            AzureCosmosContext azureCosmosContext = new AzureCosmosContext();
            DocumentClient     client             = azureCosmosContext.GetCosmosDocumentClient();
            string             cosmosCollectionId = azureCosmosContext.GetCosmosCollectionId();
            var result = client.CreateDocumentAsync(UriFactory.CreateDocumentCollectionUri("roardb", cosmosCollectionId), employeeEnrollment).Result;

            return(result.ActivityId);
        }
        public EmployeeEnrollment MapData(EmployeeViewModel emp, int employeeID)
        {
            var employeeEnrollment = new EmployeeEnrollment();

            employeeEnrollment.EmployeeID        = employeeID;
            employeeEnrollment.Seniority         = (Level)emp.Positions;
            employeeEnrollment.OfficialWorkStart = emp.OfficialWorkStart;
            employeeEnrollment.WorkStart         = emp.WorkStart;
            return(employeeEnrollment);
        }
Exemple #4
0
 public HttpResponseMessage SaveUserVoiceData(EmployeeEnrollment employeeEnrollment)
 {
     try
     {
         UserVoiceManager manager = new UserVoiceManager();
         string           result  = string.Empty;
         result = manager.SaveUserVoiceData(employeeEnrollment);
         return(Request.CreateResponse(HttpStatusCode.OK, result));
     }
     catch (System.Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message));
     }
 }