Пример #1
0
        public Dictionary <string, string> Handle1095(IRSEmployee employee, bool isCorrected = false)
        {
            Context context = new Context(Year);

            context.SetInner("Text1", employee.EmployeeName);
            context.SetInner("Text2", employee.SSN);
            context.SetInner("Text3", employee.Address);
            context.SetInner("Text4", employee.City);
            context.SetInner("Text5", employee.State);
            context.SetInner("Text6", employee.ZipCode);
            //context.SetInner("DOB", employee.DOB.ToString("yyyy-MM-dd"));
            context.SetInner("DOB", employee.DOB.ToString("yyyyMMdd"));
            context.SetInner("Check2", CorrectedList.Contains(employee.EinfoID) ? "1" : "0");

            BaseEmoloyee bEmployee = null;

            //foreach (var employee in employees) {
            if (!HardCode(employee.EinfoID, context))
            {
                //在职
                if (employee.empStatus)
                {
                    if (employee.workYear)  //大于一年
                    {
                        bEmployee = new OnJobGreaterEmoloyee(employee);
                    }
                    else  //小于一年
                    {
                        bEmployee = new OnJobLessEmoloyee(employee);
                    }
                }
                else  //离职
                {
                    if (employee.workYear)   //大于一年
                    {
                        bEmployee = new UnJobGreaterEmoloyee(employee);
                    }
                    else  //小于一年
                    {
                        bEmployee = new UnJobLessEmoloyee(employee);
                    }
                }
                bEmployee.handler14(context);
                bEmployee.handler15(context);
                bEmployee.handlerExtend15(context);
                bEmployee.handler16(context);
                bEmployee.handlerExtend14(context);
            }
            return(context.GetResult());
        }
Пример #2
0
        /// <summary>
        /// Q: Should be 2D, because the employee's TD is 1/9/2015 years, he worked in January. Right?
        /// A: You are correct.The employee worked in January.As a result, it cannot be 2A or 2D.  If there is no record on emp_helathbilling for January, it has to be left blank
        /// </summary>
        /// <param name="query"></param>
        /// <param name="employee"></param>
        /// <returns></returns>
        internal static bool TerminationBorder(List <HealthbillingKeyValue> query, IRSEmployee employee)
        {
            if (query.Count > 0)
            {
                var last = query.OrderByDescending(p => p.Month).Take(1).FirstOrDefault();
                if (last.Value > 0)
                {
                    //处理离职最后一个月
                    string start = employee.terminateDate.Month == last.Month
                        ? employee.terminateDate.ToString("MM/01/yyyy")
                        : string.Format("{0}/1/{1}", last.Month, employee.Year);
                    string end = employee.terminateDate.Month == last.Month
                        ? employee.terminateDate.ToShortDateString()
                        : DateTime.Parse(start).AddMonths(1).AddDays(-1).ToShortDateString();

                    strSQL = string.Format("SELECT COUNT(*) FROM emp_LeaveRecord WHERE EInfo_id={0} AND leaveType IN('SWOP','LWOP','SWP') AND leaveDate BETWEEN '{1}' AND '{2}' ",
                                           employee.EinfoID, start, end);
                    int result = SqlHelperIRS.ExecuteScalarToStr(CommandType.Text, strSQL).ToInt();
                    return(result == 0);
                }
            }
            return(false);
        }