public List <UserEmploymentDetail> Get(int userId)
        {
            var reader = this.GetReader($"select * from useremploymentDetails where userId={userId}");
            var userEmpolymentDetails = new List <UserEmploymentDetail>();

            while (reader.Read())
            {
                var userEmploymentDetail = new UserEmploymentDetail();
                userEmploymentDetail.Designation     = reader.GetString(2);
                userEmploymentDetail.CompanyName     = reader.GetString(3);
                userEmploymentDetail.SalaryLakhs     = reader.GetString(4);
                userEmploymentDetail.SalaryThousands = reader.GetString(5);
                userEmploymentDetail.StartYear       = reader.GetInt32(6);
                userEmploymentDetail.StartMonth      = reader.GetString(7);
                userEmploymentDetail.EndYear         = reader.GetInt32(8);
                userEmploymentDetail.EndMonth        = reader.GetString(9);
                userEmploymentDetail.City            = reader.GetString(10);
                userEmploymentDetail.NoticPeriod     = reader.GetString(11);
                userEmploymentDetail.Industry        = reader.GetString(12);
                userEmploymentDetail.FunctionalArea  = reader.GetString(13);
                userEmploymentDetail.Role            = reader.GetString(14);
                userEmpolymentDetails.Add(userEmploymentDetail);
            }
            return(userEmpolymentDetails);
        }
Esempio n. 2
0
        public static string AddEmploymentDetails(string[] OrganizationName, string[] City, int[] StateId, string[] TelephoneNumber, string[] PositionTitle, string[] Description, int[] StartMonth, int[] StartYear, int[] EndMonth, int[] EndYear, string[] IsAttending)
        {
            // DateTime[] StartDate, DateTime?[] EndDate,
            UserProfileInfo userProfileInfo = new UserProfileInfo();
            string          message         = Constant.CONST_PROFESSIONAL_EXP_FAILURE;

            if (SessionWrapper.LoggedUser == null)
            {
                return(message = Constant.SESSION_EXPIRE);
            }
            try
            {
                List <UserEmploymentDetail> empDetailList = new List <UserEmploymentDetail>();
                UserEmploymentDetail        empDetails;
                int count = 0;
                while (count < OrganizationName.Length)
                {
                    if (!String.IsNullOrEmpty(OrganizationName[count]))
                    {
                        empDetails               = new UserEmploymentDetail();
                        empDetails.OrgName       = OrganizationName[count].Trim();
                        empDetails.City          = City[count].Trim();
                        empDetails.Telephone     = TelephoneNumber[count].Trim();
                        empDetails.StateId       = StateId[count];
                        empDetails.PositionTitle = PositionTitle[count].Trim();


                        empDetails.StartMonth = StartMonth[count];
                        empDetails.StartYear  = StartYear[count];
                        empDetails.EndMonth   = EndMonth[count];
                        empDetails.EndYear    = EndYear[count];

                        empDetails.Description = Description[count].Trim();
                        empDetails.IsAttending = Convert.ToBoolean(IsAttending[count]);

                        empDetails.UserId = SessionWrapper.LoggedUser.UserId;
                        empDetailList.Add(empDetails);
                    }
                    count++;
                }
                userProfileInfo = UserEmploymentDetailsHelper.SaveUserEmpDetails(empDetailList);
            }
            catch { }
            if (userProfileInfo.IsFirstRecord)
            {
                message = Constant.CONST_PROFESSIONAL_ADD_SUCCESS;
            }
            else
            {
                message = Constant.CONST_PROFESSIONAL_EXP_SUCCESS;
            }

            return(message);
        }
        public static bool DeleteEmpDetailsById(int EmpDetailsId)
        {
            bool isDeleted = false;

            try
            {
                Repository <UserEmploymentDetail> repository = new Repository <UserEmploymentDetail>("UserEmploymentDetailId");
                UserEmploymentDetail empDetails = repository.SelectByKey(EmpDetailsId.ToString());

                if (empDetails != null)
                {
                    repository.Delete(empDetails);
                    repository.Save();
                    isDeleted = true;
                }
            }
            catch { }
            return(isDeleted);
        }
        private void SetFromSessionData()
        {
            List <UserEmploymentDetail> userEmpDetails = new List <UserEmploymentDetail>();
            int proCount = SessionWrapper.ResumeParserData.SegregatedExperience.WorkHistory.Count;
            UserEmploymentDetail userEmpDetail;

            for (int i = 0; i < proCount; i++)
            {
                userEmpDetail               = new UserEmploymentDetail();
                userEmpDetail.OrgName       = SessionWrapper.ResumeParserData.SegregatedExperience.WorkHistory[i].Employer;
                userEmpDetail.City          = SessionWrapper.ResumeParserData.SegregatedExperience.WorkHistory[i].JobLocation.EmployerCity;
                userEmpDetail.PositionTitle = SessionWrapper.ResumeParserData.SegregatedExperience.WorkHistory[i].JobProfile.Title;
                userEmpDetail.Description   = SessionWrapper.ResumeParserData.SegregatedExperience.WorkHistory[i].JobDescription;
                userEmpDetails.Add(userEmpDetail);
            }
            if (userEmpDetails.Count > 0)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "AddEmpControl(" + userEmpDetails.Count + ");", true);
                FillInformation(userEmpDetails);
            }
        }
 public void Add(UserEmploymentDetail userEmploymentDetail)
 {
     this.ExecuteNonQuery($"insert into useremploymentdetails(UserId,Designation,CompanyName,SalaryLakhs,SalaryThousands,StartYear,StartMonth,EndYear,EndMonth,City,NoticePeriod,Industry,FunctionalArea,Role) values({userEmploymentDetail.UserId},'{userEmploymentDetail.Designation}','{userEmploymentDetail.CompanyName}','{userEmploymentDetail.SalaryLakhs}','{userEmploymentDetail.SalaryThousands}',{userEmploymentDetail.StartYear},'{userEmploymentDetail.StartMonth}',{userEmploymentDetail.EndYear},'{userEmploymentDetail.EndMonth}','{userEmploymentDetail.City}','{userEmploymentDetail.NoticPeriod}','{userEmploymentDetail.Industry}','{userEmploymentDetail.FunctionalArea}','{userEmploymentDetail.Role}')");
 }
 public IActionResult Post(UserEmploymentDetail userEmploymentDetail)
 {
     this.UserEmploymentDetailDomain.Add(userEmploymentDetail);
     return(Ok());
 }
        public static UserProfileInfo SaveUserEmpDetails(List <UserEmploymentDetail> UserEmpDetail)
        {
            //bool isSaved = false;
            Repository <UserEmploymentDetail> EmpDetailNewRepository = new Repository <UserEmploymentDetail>();
            UserEmploymentDetail userEmpdetails;

            int userId = UserEmpDetail[0].UserId;
            ISpecification <UserEmploymentDetail> specification = new Specification <UserEmploymentDetail>(u => u.UserId == userId);
            Repository <UserEmploymentDetail>     repository    = new Repository <UserEmploymentDetail>();
            IList <UserEmploymentDetail>          empDetailList = repository.SelectAll(specification);
            UserProfileInfo userProfileInfo = new UserProfileInfo();

            if (empDetailList.Count == 0)
            {
                userProfileInfo.IsFirstRecord = true;
            }
            else
            {
                userProfileInfo.IsFirstRecord = false;
            }

            try
            {
                int count = 0;
                while (count < UserEmpDetail.Count)
                {
                    if (count < empDetailList.Count)
                    {
                        empDetailList[count].OrgName       = UserEmpDetail[count].OrgName;
                        empDetailList[count].City          = UserEmpDetail[count].City;
                        empDetailList[count].StateId       = UserEmpDetail[count].StateId;
                        empDetailList[count].Telephone     = UserEmpDetail[count].Telephone;
                        empDetailList[count].PositionTitle = UserEmpDetail[count].PositionTitle;

                        empDetailList[count].StartMonth = UserEmpDetail[count].StartMonth;
                        empDetailList[count].StartYear  = UserEmpDetail[count].StartYear;
                        empDetailList[count].EndMonth   = UserEmpDetail[count].EndMonth;
                        empDetailList[count].EndYear    = UserEmpDetail[count].EndYear;


                        empDetailList[count].Description = UserEmpDetail[count].Description;
                        empDetailList[count].IsAttending = UserEmpDetail[count].IsAttending;

                        repository.Save();
                        count++;
                    }
                    else
                    {
                        userEmpdetails = new UserEmploymentDetail();

                        userEmpdetails.OrgName       = UserEmpDetail[count].OrgName;
                        userEmpdetails.City          = UserEmpDetail[count].City;
                        userEmpdetails.StateId       = UserEmpDetail[count].StateId;
                        userEmpdetails.Telephone     = UserEmpDetail[count].Telephone;
                        userEmpdetails.PositionTitle = UserEmpDetail[count].PositionTitle;

                        userEmpdetails.StartMonth = UserEmpDetail[count].StartMonth;
                        userEmpdetails.StartYear  = UserEmpDetail[count].StartYear;
                        userEmpdetails.EndMonth   = UserEmpDetail[count].EndMonth;
                        userEmpdetails.EndYear    = UserEmpDetail[count].EndYear;

                        userEmpdetails.Description = UserEmpDetail[count].Description;
                        userEmpdetails.IsAttending = UserEmpDetail[count].IsAttending;
                        userEmpdetails.UserId      = UserEmpDetail[count].UserId;

                        EmpDetailNewRepository.Add(userEmpdetails);
                        EmpDetailNewRepository.Save();
                        count++;
                    }
                }

                //isSaved = true;
            }
            catch { }

            return(userProfileInfo);
        }
Esempio n. 8
0
        public static void FillSessionValues(person person)
        {
            SessionWrapper.LinkedinData = new LinkedinData();
            SessionWrapper.LinkedinData.EducationalDetail  = new EknowIDModel.UserEducationalDetail();
            SessionWrapper.LinkedinData.EmploymentDetailes = new List <UserEmploymentDetail>();
            UserEducationalDetail educationdetail = new UserEducationalDetail();
            UserPostGraduation    postGraduation  = new UserPostGraduation();
            UserEmploymentDetail  empDetails;
            string startDate = string.Empty;
            string endDate = string.Empty;
            int    educations = 0, positions = 0;

            if (person.educations != null)
            {
                educations = Convert.ToInt32(person.educations.total);
            }

            if (person.Positions != null)
            {
                positions = Convert.ToInt32(person.Positions.total);
            }

            if (educations != 0)
            {
                educationdetail.Basic          = person.educations.education[0].degree;
                educationdetail.Specialization = person.educations.education[0].FieldOfStudy;

                if (person.educations.education[0].StartDate != null)
                {
                    educationdetail.StartYear  = Convert.ToInt32(person.educations.education[0].StartDate.year);
                    educationdetail.StartMonth = 1;
                }
                if (person.educations.education[0].StartDate != null)
                {
                    educationdetail.EndYear  = Convert.ToInt32(person.educations.education[0].EndDate.year);
                    educationdetail.EndMonth = 1;
                }

                SessionWrapper.LinkedinData.EducationalDetail = educationdetail;

                if (educations >= 2)
                {
                    postGraduation.PostGraduation = person.educations.education[1].degree;
                    postGraduation.Specialization = person.educations.education[1].FieldOfStudy;

                    if (person.educations.education[1].StartDate != null)
                    {
                        postGraduation.StartYear  = Convert.ToInt32(person.educations.education[1].StartDate.year);
                        postGraduation.StartMonth = 1;
                    }
                    if (person.educations.education[1].StartDate != null)
                    {
                        postGraduation.EndYear  = Convert.ToInt32(person.educations.education[1].EndDate.year);
                        postGraduation.EndMonth = 1;
                    }
                    SessionWrapper.LinkedinData.Postgraduation = postGraduation;
                }
            }
            if (positions != 0)
            {
                for (int i = 0; i < Convert.ToInt32(person.Positions.total); i++)
                {
                    empDetails = new UserEmploymentDetail();
                    startDate  = string.Empty;
                    endDate    = string.Empty;

                    empDetails.OrgName       = person.Positions.position[i].company.name;
                    empDetails.PositionTitle = person.Positions.position[i].title;
                    empDetails.Description   = person.Positions.position[i].summary;
                    if (person.phonenumbers != null && person.phonenumbers.phonenumber != null)
                    {
                        empDetails.Telephone = person.phonenumbers.phonenumber.phoneNumber;
                    }
                    if (person.Positions.position[i].StartDate != null)
                    {
                        empDetails.StartYear  = Convert.ToInt32(person.Positions.position[i].StartDate.year);
                        empDetails.StartMonth = Convert.ToInt32(person.Positions.position[i].StartDate.month);
                    }
                    if (person.Positions.position[i].EndDate != null)
                    {
                        empDetails.EndYear  = Convert.ToInt32(person.Positions.position[i].EndDate.year);
                        empDetails.EndMonth = Convert.ToInt32(person.Positions.position[i].EndDate.month);
                    }

                    SessionWrapper.LinkedinData.EmploymentDetailes.Add(empDetails);
                }
            }
        }
Esempio n. 9
0
        public static string AddEmploymentDetails(string[] OrganizationName, string[] City, int[] StateId, string[] TelephoneNumber, string[] PositionTitle, string[] Description, int[] StartMonth, int[] StartYear, int[] EndMonth, int[] EndYear, string[] IsAttending)
        {
            UserProfileInfo userProfileInfo = new UserProfileInfo();
            string          message         = Constant.CONST_PROFESSIONAL_EXP_FAILURE;

            if (SessionWrapper.LoggedUser == null)
            {
                return(message = Constant.SESSION_EXPIRE);
            }
            try
            {
                List <UserEmploymentDetail> userEmpDetails = new List <UserEmploymentDetail>();
                UserEmploymentDetail        userEmpDetail;
                OrderDetails orderDetails = GetSessionOrderDetails();
                orderDetails.EmploymentDetailes = new List <EmploymentDetail>();
                EmploymentDetail        empDetails;
                List <EmploymentDetail> EmployeeDateGapCheck = new List <EmploymentDetail>();
                int count = 0;

                while (count < OrganizationName.Length)
                {
                    empDetails    = new EmploymentDetail();
                    userEmpDetail = new UserEmploymentDetail();

                    empDetails.OrgName       = OrganizationName[count].Trim();
                    empDetails.City          = City[count].Trim();
                    empDetails.Telephone     = TelephoneNumber[count].Trim();
                    empDetails.StateId       = StateId[count];
                    empDetails.PositionTitle = PositionTitle[count].Trim();

                    empDetails.StartMonth  = StartMonth[count];
                    empDetails.StartYear   = StartYear[count];
                    empDetails.EndMonth    = EndMonth[count];
                    empDetails.EndYear     = EndYear[count];
                    empDetails.IsAttending = Convert.ToBoolean(IsAttending[count]);
                    empDetails.Description = Description[count].Trim();

                    userEmpDetail.OrgName       = OrganizationName[count].Trim();
                    userEmpDetail.City          = City[count].Trim();
                    userEmpDetail.Telephone     = TelephoneNumber[count].Trim();
                    userEmpDetail.StateId       = StateId[count];
                    userEmpDetail.PositionTitle = PositionTitle[count].Trim();

                    userEmpDetail.StartMonth = StartMonth[count];
                    userEmpDetail.StartYear  = StartYear[count];
                    userEmpDetail.EndMonth   = EndMonth[count];
                    userEmpDetail.EndYear    = EndYear[count];

                    userEmpDetail.Description = Description[count].Trim();
                    userEmpDetail.IsAttending = Convert.ToBoolean(IsAttending[count]);
                    userEmpDetail.UserId      = SessionWrapper.LoggedUser.UserId;

                    userEmpDetails.Add(userEmpDetail);
                    orderDetails.EmploymentDetailes.Add(empDetails);

                    empDetails.EmploymentDetailId = count;

                    string   month     = empDetails.StartMonth != 0 ? empDetails.StartMonth.ToString("00") : "01";
                    string   year      = empDetails.StartYear != 0 ? empDetails.StartYear.ToString(): "1900";
                    string   startDate = "01/" + month + "/" + year;
                    DateTime StartDate = DateTime.ParseExact(startDate, "MM/dd/yyyy", null);
                    empDetails.StartDate = StartDate;

                    month = empDetails.EndMonth != 0 ? empDetails.EndMonth.ToString("00") : "01";
                    year  = empDetails.EndYear != 0 ? empDetails.EndYear.ToString() : "1900";
                    string   endDate = "01/" + month + "/" + year;
                    DateTime EndDate = DateTime.ParseExact(endDate, "MM/dd/yyyy", null);
                    empDetails.EndDate = EndDate;

                    EmployeeDateGapCheck.Add(empDetails);
                    count++;
                }

                SessionWrapper.OrderDetail = orderDetails;
                if (userEmpDetails.Count != 0)
                {
                    userProfileInfo = UserEmploymentDetailsHelper.SaveUserEmpDetails(userEmpDetails);
                    if (userProfileInfo.IsFirstRecord)
                    {
                        message = Constant.CONST_PROFESSIONAL_ADD_SUCCESS;
                    }
                    else
                    {
                        message = Constant.CONST_PROFESSIONAL_EXP_SUCCESS;
                    }
                }
                else
                {
                    message = Constant.CONST_PROFESSIONAL_ADD_SUCCESS;
                }
            }
            catch { }
            return(message);
        }