Beispiel #1
0
        public void AddRequestStatus(RecruitmentRequestStatusDto requestStatus)
        {
            RecruitmentRequestStatus status = new RecruitmentRequestStatus
            {
                Comments             = requestStatus.Comments,
                RecruitmentRequestID = requestStatus.RecruitmentRequestID,
                RequestUpdatedOn     = requestStatus.RequestUpdatedOn,
                RequestStatusEntryID = requestStatus.RequestStatusEntryID,
                RequestStatusID      = requestStatus.RequestStatusID,
                JoinedPositions      = requestStatus.JoinedPosition,
                OfferedPositions     = requestStatus.OfferedPosition,
            };

            status.UpdateTimeStamp(requestStatus.LoggedInUserName, true);
            DataContext.RequestStatuseEntries.Add(status);
            DataContext.Entry(status).State = EntityState.Added;
            DataContext.SaveChanges();

            UpdateOverallStatus(requestStatus.RecruitmentRequestID, requestStatus.RequestStatusID, requestStatus.LoggedInUserName, requestStatus.JoinedPosition, requestStatus.OfferedPosition);
        }
Beispiel #2
0
        public void Add(RecruitmentRequestDto entity)
        {
            RecruitmentRequest subCategory = CreateBusinessEntity(entity, true);

            Entities.Add(subCategory);
            DataContext.Entry(subCategory).State = EntityState.Added;
            DataContext.SaveChanges();

            int?statusID = DataContext.DropDownSubCategories.FirstOrDefault(s => s.SubCategoryName == "Open" && s.CategoryID == 18 && s.IsDeleted == false)?.SubCategoryID;
            RecruitmentRequestStatus requestStatus = new RecruitmentRequestStatus
            {
                Comments             = entity.LattestComment,
                RecruitmentRequestID = subCategory.RecruitmentRequestID,
                RequestStatusID      = statusID ?? 1,
                RequestUpdatedOn     = DateTime.Today,
                JoinedPositions      = 0,
                OfferedPositions     = 0,
            };

            requestStatus.UpdateTimeStamp(entity.LoggedInUserName, true);
            DataContext.RequestStatuseEntries.Add(requestStatus);
            DataContext.Entry(requestStatus).State = EntityState.Added;
            DataContext.SaveChanges();
        }