public async Task <ProfileViewModel> ViewProfile(string profileId)
        {
            profileinfo profileinfo = await _businessLayer.GetProfilesByIdAsync(profileId);

            ProfileViewModel profile = new ProfileViewModel()
            {
                AppliedPositionFor                                                = profileinfo.AppliedPositionFor,
                CandidateId                                                       = profileinfo.CandidateId,
                CompanyContact                                                    = profileinfo.CompanyContact,
                CompanyDetails                                                    = profileinfo.CompanyDetails,
                CreateDate                                                        = profileinfo.CreateDate,
                CreatedBy                                                         = profileinfo.CreatedBy,
                CurrentStatus                                                     = profileinfo.CurrentStatus,
                DateOfInterview                                                   = profileinfo.DateOfInterview != null?profileinfo.DateOfInterview.Value.ToShortDateString() : DateTime.MinValue.ToShortDateString(),
                                                               HRCopy             = profileinfo.HRCopy,
                                                               Interviewer        = profileinfo.Interviewer,
                                                               InterviewerContact = profileinfo.InterviewerMobile,
                                                               ModifiedBy         = profileinfo.ModifiedBy,
                                                               ModifiedDate       = profileinfo.ModifiedDate != null ? profileinfo.ModifiedDate.Value : DateTime.MinValue,
                                                               ProfileId          = profileinfo.ProfileId,
                                                               RecruiterContact   = profileinfo.ContactOfRecruiter,
                                                               RecruiterName      = profileinfo.NameOfRecruiter,
                                                               ReferenceType      = profileinfo.ReferenceType,
                                                               TeamLeadName       = profileinfo.TeamLeadName
            };

            return(profile);
        }
        private profileinfo[] GetProfile(ProfileViewModel model)
        {
            profileinfo[] candidates = new profileinfo[1];
            candidates[0] = new profileinfo
            {
                CreateDate = DateTime.Now,
                //CurrentCTC = model.CurrentCTC,
                //CurrentDesignation = model.CurrentDesignation,
                //CurrentEmployer = model.CurrentEmployer,
                //CreatedBy = HttpContext.User.Identity.Name,
                //FirstName = model.Name,
                //CurrentLocation = model.CurrentLocation,
                //Email = model.Email,
                //HomeTown = model.HomeTown,
                //MobileNumber = model.MobileNumber,
                //Source = model.Source
            };

            return(candidates);
        }
Пример #3
0
        public ProfileViewModel(profileinfo profile)//Dto is better
        {
            this.ProfileId       = profile.ProfileId;
            this.CandidateId     = profile.CandidateId;
            this.CompanyId       = profile.CompanyId;
            this.IndustryId      = profile.IndustryId;
            this.DateOfInterview = profile.DateOfInterview != null?profile.DateOfInterview.Value.ToShortDateString() : "";

            this.CurrentStatus      = profile.CurrentStatus;
            this.HRCopy             = profile.HRCopy;
            this.AppliedPositionFor = profile.AppliedPositionFor;
            this.Interviewer        = profile.Interviewer;
            this.InterviewerContact = profile.InterviewerMobile;
            this.CompanyContact     = profile.CompanyContact;
            this.ReferenceType      = profile.ReferenceType;
            this.RecruiterName      = profile.NameOfRecruiter;
            this.RecruiterContact   = profile.ContactOfRecruiter;
            this.TeamLeadName       = profile.TeamLeadName;
            this.CreateDate         = profile.CreateDate;
            this.CreatedBy          = profile.CreatedBy;
            //Need to map
        }