Beispiel #1
0
        public static EmploymentDetail CreateEmploymentDetail(string personnelNumber,
                                                              string legalEntityId,
                                                              global::System.DateTimeOffset employmentStartDate,
                                                              global::System.DateTimeOffset employmentEndDate,
                                                              global::System.DateTimeOffset validFrom,
                                                              global::System.DateTimeOffset validTo,
                                                              int workerNoticeAmount,
                                                              global::System.DateTimeOffset transitionDate,
                                                              global::System.DateTimeOffset lastDateWorked,
                                                              int employerNoticeAmount,
                                                              global::System.DateTimeOffset adjustedWorkerStartDate,
                                                              global::System.DateTimeOffset workerStartDate,
                                                              global::Microsoft.Dynamics.DataEntities.Employment employment)
        {
            EmploymentDetail employmentDetail = new EmploymentDetail();

            employmentDetail.PersonnelNumber         = personnelNumber;
            employmentDetail.LegalEntityId           = legalEntityId;
            employmentDetail.EmploymentStartDate     = employmentStartDate;
            employmentDetail.EmploymentEndDate       = employmentEndDate;
            employmentDetail.ValidFrom               = validFrom;
            employmentDetail.ValidTo                 = validTo;
            employmentDetail.WorkerNoticeAmount      = workerNoticeAmount;
            employmentDetail.TransitionDate          = transitionDate;
            employmentDetail.LastDateWorked          = lastDateWorked;
            employmentDetail.EmployerNoticeAmount    = employerNoticeAmount;
            employmentDetail.AdjustedWorkerStartDate = adjustedWorkerStartDate;
            employmentDetail.WorkerStartDate         = workerStartDate;
            if ((employment == null))
            {
                throw new global::System.ArgumentNullException("employment");
            }
            employmentDetail.Employment = employment;
            return(employmentDetail);
        }
Beispiel #2
0
        public DocumentController(
            IUserService IUserService,
            IRelationService IRelationService,
            IDocumentService IDocumentService,
            IEmployementService IEmployementService,
            IDocumentDetailsService IDocumentDetailsService,
            IDocumentCategoryService IDocumentCategoryService,
            IEducationDocumentCategoryMappingService IEducationDocumentCategoryMappingService, ICandidateProgressDetailService ICandidateProgressDetailService, IPersonalService IPersonalService, IEmployeeService IEmployeeService, IEmploymentCountService IEmploymentCountService)
        {
            _IUserService             = IUserService;
            _IRelationService         = IRelationService;
            _IEmployementService      = IEmployementService;
            _IDocumentDetailsService  = IDocumentDetailsService;
            _IDocumentCategoryService = IDocumentCategoryService;
            _IDocumentService         = IDocumentService;
            _IEducationDocumentCategoryMappingService = IEducationDocumentCategoryMappingService;
            _ICandidateProgressDetailService          = ICandidateProgressDetailService;
            _IPersonalService        = IPersonalService;
            _IEmploymentCountService = IEmploymentCountService;

            _loginDetails  = new LoginDetail();
            _document      = new Master_Document();
            _docDetails    = new DocumentDetail();
            _employment    = new EmploymentDetail();
            _DocumetCat    = new Master_DocumentCategory();
            _DocumetCatNew = new Master_DocumentCategory();
            _educationDocumentCategoryMapping = new EducationDocumentCategoryMapping();
            _IEmployeeService = IEmployeeService;
        }
Beispiel #3
0
        public List <EmploymentDetail> Get(int EmploymentId)
        {
            var reader            = this.GetReader($"select * from EmploymentDetails where EmploymentId = {EmploymentId}");
            var employmentdetails = new List <EmploymentDetail>();

            while (reader.Read())
            {
                var employmentdetail = new EmploymentDetail();
                employmentdetail.JobTitle      = reader.GetString(1);
                employmentdetail.CompanyName   = reader.GetString(2);
                employmentdetail.Lakhs         = reader.GetInt32(3);
                employmentdetail.Thousands     = reader.GetInt32(4);
                employmentdetail.JoinYear      = reader.GetInt32(5);
                employmentdetail.JoinMonth     = reader.GetString(6);
                employmentdetail.PresentYear   = reader.GetInt32(7);
                employmentdetail.PresentMonth  = reader.GetString(8);
                employmentdetail.City          = reader.GetString(9);
                employmentdetail.NoticePeriod  = reader.GetString(10);
                employmentdetail.Industry      = reader.GetString(11);
                employmentdetail.FuctionalArea = reader.GetString(12);
                employmentdetail.Role          = reader.GetString(13);
                employmentdetail.UserId        = reader.GetInt64(14);
                employmentdetails.Add(employmentdetail);
            }
            return(employmentdetails);
        }
Beispiel #4
0
        public bool CheckSelectedEmploymentStatus(int userId, int employmentDetID)
        {
            bool result;

            using (IPDEntities ctx = new IPDEntities())
            {
                try
                {
                    EmploymentDetail employmnetDetails = ctx.EmploymentDetails.Where(m => m.UserID == userId && m.IsActive == true && m.IsCurrentEmployment == true && m.EmploymentDetID == employmentDetID).FirstOrDefault();

                    if (employmnetDetails != null)
                    {
                        result = true;
                    }
                    else
                    {
                        result = false;
                    }
                }
                catch (Exception ex)
                {
                    result = false;
                }
            }

            return(result);
        }
Beispiel #5
0
 public EmployementController(IEmployementService IEmployementService, ICityService ICityService, IStateService IStateService, ICountryService ICountryService, IUserService IUserService, IEmploymentCountService IEmploymentCountService)
 {
     this._IEmployementService = IEmployementService;
     _employement       = new EmploymentDetail();
     this._ICityService = ICityService;
     _city = new Master_City();
     this._IStateService = IStateService;
     _state = new Master_State();
     this._ICountryService = ICountryService;
     _country                      = new Master_Country();
     this._IUserService            = IUserService;
     this._IEmploymentCountService = IEmploymentCountService;
 }
Beispiel #6
0
        public IActionResult Save(EmploymentDetail employmentDetail)
        {
            var employmentDetails = _employmentDetailRepository.GetEmploymentDetailById(employmentDetail.EmploymentDetailID);

            if (employmentDetails == null)
            {
                _employmentDetailRepository.AddEmploymentDetail(employmentDetail);
            }
            else
            {
                _employmentDetailRepository.UpdateEmploymentDetail(employmentDetail);
            }
            return(RedirectToAction("List", "Employee"));
        }
        private static string GetEmpInfo(List <UserEmploymentDetail> EmpList, string spellErrorData)
        {
            EmploymentDetail        empDetails;
            List <EmploymentDetail> EmployeeDateGapCheck = new List <EmploymentDetail>();

            try
            {
                for (int loopCounter = 0; loopCounter < EmpList.Count; loopCounter++)
                {
                    spellErrorData = spellErrorData + " " + EmpList[loopCounter].OrgName;
                    spellErrorData = spellErrorData + " " + EmpList[loopCounter].City;
                    spellErrorData = spellErrorData + " " + EmpList[loopCounter].StateId;
                    spellErrorData = spellErrorData + " " + EmpList[loopCounter].Telephone;
                    spellErrorData = spellErrorData + " " + EmpList[loopCounter].PositionTitle;
                    spellErrorData = spellErrorData + " " + EmpList[loopCounter].Description;


                    empDetails                    = new EmploymentDetail();
                    empDetails.StartMonth         = EmpList[loopCounter].StartMonth;
                    empDetails.StartYear          = EmpList[loopCounter].StartYear;
                    empDetails.EndMonth           = EmpList[loopCounter].EndMonth;
                    empDetails.EndYear            = EmpList[loopCounter].EndYear;
                    empDetails.IsAttending        = Convert.ToBoolean(EmpList[loopCounter].IsAttending);
                    empDetails.EmploymentDetailId = loopCounter;

                    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);
                }
                checkEmployeeDateGap(EmployeeDateGapCheck);
            }
            catch
            { }
            return(spellErrorData);
        }
Beispiel #8
0
        public EmploymentDetail UpdateEmploymentDetail(EmploymentDetail employmentDetail)
        {
            var updateEmploymentDetail = _context.EmploymentDetails.FirstOrDefault(e => e.EmployeeID == employmentDetail.EmployeeID);

            updateEmploymentDetail.Contractor     = employmentDetail.Contractor;
            updateEmploymentDetail.Department     = employmentDetail.Department;
            updateEmploymentDetail.HourlyRate     = employmentDetail.HourlyRate;
            updateEmploymentDetail.JobTitle       = employmentDetail.JobTitle;
            updateEmploymentDetail.LeaveDate      = employmentDetail.LeaveDate;
            updateEmploymentDetail.Manager        = employmentDetail.Manager;
            updateEmploymentDetail.SSN            = employmentDetail.SSN;
            updateEmploymentDetail.StartDate      = employmentDetail.StartDate;
            updateEmploymentDetail.WorkEmail      = employmentDetail.WorkEmail;
            updateEmploymentDetail.EmployeeNumber = employmentDetail.EmployeeNumber;

            _context.Update(updateEmploymentDetail);
            _context.SaveChanges();
            return(null);
        }
Beispiel #9
0
        public EmploymentDetail AddEmploymentDetail(EmploymentDetail employmentDetail)
        {
            EmploymentDetail newEmploymentDetail = new EmploymentDetail
            {
                Contractor     = employmentDetail.Contractor,
                Department     = employmentDetail.Department,
                HourlyRate     = employmentDetail.HourlyRate,
                JobTitle       = employmentDetail.JobTitle,
                LeaveDate      = employmentDetail.LeaveDate,
                Manager        = employmentDetail.Manager,
                Salary         = employmentDetail.Salary,
                SSN            = employmentDetail.SSN,
                StartDate      = employmentDetail.StartDate,
                EmployeeID     = employmentDetail.EmployeeID,
                EmployeeNumber = employmentDetail.EmployeeNumber,
                WorkEmail      = employmentDetail.WorkEmail
            };

            _context.Add(newEmploymentDetail);
            _context.SaveChanges();

            return(newEmploymentDetail);
        }
Beispiel #10
0
        public bool DeleteEmploymnetDetail(int ID, string userName)
        {
            bool result;

            using (IPDEntities ctx = new IPDEntities())
            {
                try
                {
                    EmploymentDetail employmnetDetails = ctx.EmploymentDetails.Where(m => m.EmploymentDetID == ID).FirstOrDefault();
                    employmnetDetails.IsActive    = false;
                    employmnetDetails.UpdatedDate = DateTime.UtcNow;
                    employmnetDetails.UpdatedBy   = userName;
                    ctx.SaveChanges();

                    result = true;
                }
                catch (Exception ex)
                {
                    result = false;
                }
            }
            return(result);
        }
Beispiel #11
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);
        }
Beispiel #12
0
 public void Add(EmploymentDetail employmentDetail)
 {
     this.ExecuteNonQuery($"insert into EmploymentDetails (JobTitle,CompanyName,Lakhs,Thousands,JoinYear,JoinMonth,PresentYear,PresentMonth,City,NoticePeriod,Industry,FuctionalArea,Role,UserId) values('{employmentDetail.JobTitle}','{employmentDetail.CompanyName}',{employmentDetail.Lakhs},{employmentDetail.Thousands},{employmentDetail.JoinYear},'{employmentDetail.JoinMonth}',{employmentDetail.PresentYear},'{employmentDetail.PresentMonth}','{employmentDetail.City}','{employmentDetail.NoticePeriod}','{employmentDetail.Industry}','{employmentDetail.FuctionalArea}','{employmentDetail.Role}',{employmentDetail.UserId})");
 }
Beispiel #13
0
 public bool Update(EmploymentDetail obj, string[] param, string spName)
 {
     return(_IEmployementRepository.Update(obj, param, spName));
 }
Beispiel #14
0
 public bool Insert(EmploymentDetail obj, string[] param, string spName)
 {
     return(_IEmployementRepository.Insert(obj, param, spName));
 }
Beispiel #15
0
 public IEnumerable <EmploymentDetail> GetAll(EmploymentDetail obj, string[] param, string spName)
 {
     return(_IEmployementRepository.GetAll(obj, param, spName));
 }
 public EmploymentWrapper(EmploymentDetail empDetail)
 {
     _employmentDetail = empDetail;
 }