public Maternity(Context context, LeaveTypeName leaveType, long leaver, double days) : base(context, leaveType, leaver, days) { switch (leaveType) { case LeaveTypeName.EutocousLeave: mYearAllowDays = 128; break; case LeaveTypeName.CesareanLeave: mYearAllowDays = 143; break; case LeaveTypeName.AbortionLeave_90: mYearAllowDays = 25; break; case LeaveTypeName.AbortionLeave_210: mYearAllowDays = 42; break; case LeaveTypeName.AbortionLeave_210_UP: mYearAllowDays = 90; break; default: throw new Exception("不能传入非产假的枚举类型!"); } }
public BaseType(Context context, LeaveTypeName leaveType, long leaver, double days) { mLeaveType = leaveType; mLeaver = leaver; mLeaveDays = days; mContext = context; }
/// <summary> /// 创建一个请假对象 /// </summary> /// <param name="leaveTypeValue">请假类型的枚举值</param> /// <param name="leaver">请假员工FID</param> /// <param name="days">请假天数</param> /// <returns>返回请假对象接口</returns> public ILeaveType MakeLeave(Context context, int leaveTypeValue, long leaver, double days) { LeaveTypeName leaveType = (LeaveTypeName)leaveTypeValue; switch (leaveType) { case LeaveTypeName.AntenatalCareLeave: return(new AntenatalCare(context, leaver, days)); case LeaveTypeName.PersonalAffairsLeave: return(new PersonalAffairs(context, leaver, days)); case LeaveTypeName.HomeLeave: return(new Home(context, leaver, days)); case LeaveTypeName.SickLeave: return(new Sick(context, leaver, days)); case LeaveTypeName.NursingLeave: return(new Nursing(context, leaver, days)); case LeaveTypeName.AnnualLeave: return(new Annual(context, leaver, days)); case LeaveTypeName.FuneralLeave: return(new Funeral(context, leaver, days)); case LeaveTypeName.MarriageLeave: return(new Marriage(context, leaver, days)); case LeaveTypeName.LieuLeave: return(new Lieu(context, leaver, days)); case LeaveTypeName.OccupationalInjury: return(new OccupationalInjury(context, leaver, days)); case LeaveTypeName.BreastfeedingLeave: return(new Breastfeeding(context, leaver, days)); case LeaveTypeName.EutocousLeave: return(new Maternity(context, LeaveTypeName.EutocousLeave, leaver, days)); case LeaveTypeName.CesareanLeave: return(new Maternity(context, LeaveTypeName.CesareanLeave, leaver, days)); case LeaveTypeName.AbortionLeave_90: return(new Maternity(context, LeaveTypeName.AbortionLeave_90, leaver, days)); case LeaveTypeName.AbortionLeave_210: return(new Maternity(context, LeaveTypeName.AbortionLeave_210, leaver, days)); case LeaveTypeName.AbortionLeave_210_UP: return(new Maternity(context, LeaveTypeName.AbortionLeave_210_UP, leaver, days)); case LeaveTypeName.JoinArmy: return(new JoinArmy(context, leaver, days)); case LeaveTypeName.Relocation: return(new Relocation(context, leaver, days)); case LeaveTypeName.DonateBlood: return(new DonateBlood(context, leaver, days)); case LeaveTypeName.SalemanHomeLeave: return(new SalemanHome(context, leaver, days)); case LeaveTypeName.SpecialHomeLeave: return(new SpecialHome(context, leaver, days)); default: return(new Other(context, leaver, days)); } }