Exemple #1
0
        public List <OutputXMLResult> Main(string EinfoID)
        {
            //DateTime dtStart = new DateTime(Year + 1, 1, 1).AddDays(-1);
            //DateTime dtEnd = new DateTime(Year, 1, 1);
            //string Condition = string.Format(" AND a.EInfo_id IN ({0})", EinfoID);
            //var employees = IRSQueryDB.loadAllEmployees(Condition, dtStart, dtEnd);

            //var employees = IRSQueryDB.loadAllEmployees(string.Empty, dtStart, dtEnd);
            var          eid       = EinfoID.ToInt();
            var          all       = this.loadAllEmployees();
            var          employees = all.Where(p => p.EinfoID == eid).ToList();
            Context      context   = new Context(Year);
            BaseEmoloyee bEmployee = null;

            foreach (var employee in employees)
            {
                if (HardCode(employee.EinfoID, context))
                {
                    continue;
                }
                //在职
                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.getXMLResult());
        }
Exemple #2
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());
        }