Exemplo n.º 1
0
        private Models.ResponseModels.Task.Task TranslateToTask(taskskill input)
        {
            var task = new Models.ResponseModels.Task.Task();

            task.Comments         = input.task.COMMENTS;
            task.CreatedBy        = input.task.CREATED_BY;
            task.CreatedOn        = input.task.CREATED_ON;
            task.Details          = input.task.DETAILS;
            task.DueDate          = CommonHelper.ConvertToDateUI(input.task.DUE_DATE);
            task.Duration         = CommonHelper.CalculateDuration(input.task.CREATED_ON);
            task.FirstName        = input.task.user.FIRST_NAME;
            task.LastName         = input.task.user.LAST_NAME;
            task.OnBoardingDate   = CommonHelper.ConvertToDateUI(input.task.ONBOARDING_DATE);
            task.ProjectName      = input.task.PROJECT_NAME;
            task.ProjectWBSCode   = input.task.PROJECT_WBS_Code;
            task.RequestorEmailId = input.task.user.EMAIL_ID;
            task.Skills           = input.skill.VALUE;
            task.Status           = input.task.STATUS;
            task.StatusDate       = input.task.STATUS_DATE;
            task.TaskName         = input.task.TASK_NAME;
            task.TypeId           = input.task.TASK_TYPE_ID.GetValueOrDefault();
            task.UpdatedBy        = input.task.UPDATED_BY;
            task.UpdatedOn        = input.task.UPDATED_ON;
            task.Id       = input.task.ID;
            task.Hours    = input.task.HOURS;
            task.Offering = input.task.offering.Code;
            return(task);
        }
Exemplo n.º 2
0
        private Models.ResponseModels.Task.Task TranslateTask(task input)
        {
            var task = new Models.ResponseModels.Task.Task();

            if (input != null)
            {
                task.Comments = input.COMMENTS;
                task.Details  = input.DETAILS;
                task.DueDate  = CommonHelper.ConvertToDateUI(input.DUE_DATE);
                if (input.user != null)
                {
                    task.FirstName        = input.user.FIRST_NAME;
                    task.LastName         = input.user.LAST_NAME;
                    task.RequestorEmailId = input.user.EMAIL_ID;
                }
                task.Hours          = input.HOURS;
                task.Id             = input.ID;
                task.ProjectName    = input.PROJECT_NAME;
                task.ProjectWBSCode = input.PROJECT_WBS_Code;
                task.Skills         = ConvertTaskSkillsToString(input.taskskills);
                task.Status         = input.STATUS;
                task.StatusDate     = input.STATUS_DATE;
                task.TypeId         = input.TASK_TYPE_ID.GetValueOrDefault();
                task.OnBoardingDate = CommonHelper.ConvertToDateUI(input.ONBOARDING_DATE);
                task.ServiceLine    = input.service_line?.Name;
                task.Duration       = CommonHelper.CalculateDuration(input.CREATED_ON);
                task.TaskName       = input.TASK_NAME;
                task.Offering       = input.offering?.Description;
                task.OfferingId     = Convert.ToString(input.OFFERING_ID);
            }
            return(task);
        }
Exemplo n.º 3
0
        private task TraslateTaskToDbTask(Models.ResponseModels.Task.Task input)
        {
            var dbTask    = new task();
            var modelTask = input as Models.ResponseModels.Task.Task;

            if (modelTask != null)
            {
                dbTask.COMMENTS = modelTask.Comments;
                //dbTask.CREATED_BY = modelTask.CreatedB
                dbTask.CREATED_ON       = modelTask.CreatedOn;
                dbTask.DETAILS          = modelTask.Details;
                dbTask.DUE_DATE         = CommonHelper.ConvertToDateDatabase(modelTask.DueDate);
                dbTask.HOURS            = modelTask.Hours;
                dbTask.ID               = modelTask.Id;
                dbTask.PROJECT_NAME     = modelTask.ProjectName;
                dbTask.PROJECT_WBS_Code = modelTask.ProjectWBSCode;
                //dbTask.REQUESTOR_EMAIL_ID = modelTask.RequestorEmailId;
                //dbTask.SKILLS = modelTask.Skills;
                dbTask.STATUS       = modelTask.Status;
                dbTask.STATUS_DATE  = modelTask.StatusDate;
                dbTask.TASK_TYPE_ID = modelTask.TypeId;
                //dbTask.UPDATED_BY =
                //dbTask.UPDATED_ON =
                if (Convert.ToDateTime(modelTask.DueDate) < DateTime.Today)
                {
                    input.Status = dbTask.STATUS = TaskStatus.Closed.ToString();
                }
            }
            return(dbTask);
        }
Exemplo n.º 4
0
        public IEnumerable <TModel> CreateModelList <TModel>(IEnumerable <task> inputList) where TModel : class
        {
            var modelList = new List <Models.ResponseModels.Task.Task>();

            foreach (var dbTask in inputList)
            {
                var task = new Models.ResponseModels.Task.Task();
                task = CreateModel <Models.ResponseModels.Task.Task>(dbTask);
                modelList.Add(task);
            }
            return(modelList as IEnumerable <TModel>);
        }