/// <summary> /// /// </summary> /// <param name="Result"></param> /// <param name="MyConcept"></param> public override void C1002(BaseScndCnpValue Result, SecondaryConcept MyConcept) { ((PairableScndCnpValue)Result).ClearPairs(); //120 precard : مرخصی نیم روز Permit halfDayPermit = this.Person.GetPermitByDate(this.ConceptCalculateDate, EngEnvironment.GetPrecard(120)); Permit hourlyLeave = this.Person.GetPermitByDate(this.ConceptCalculateDate, EngEnvironment.GetPrecard(Precards.HourLeave1)); if (halfDayPermit.ID > 0 && halfDayPermit.PairCount > 0) { PairableScndCnpValue PermitInShift = new PairableScndCnpValue(); int demandLeave = 0; PairableScndCnpValue absence = (PairableScndCnpValue)this.DoConcept(3028); int absenceDuration = 0; int maxLeave = 3 * 60 + 30; foreach (PairableScndCnpValuePair pair in absence.Pairs) { if (absenceDuration >= maxLeave) { break; } int pairValue = pair.Value; if (absenceDuration + pair.Value > maxLeave) { pairValue = maxLeave - absenceDuration; //absenceDuration = maxLeave; } demandLeave = this.Person.GetRemainLeave(this.ConceptCalculateDate); if (demandLeave < pairValue && this.DoConcept(1098).Value == 0) { pairValue = demandLeave; } this.Person.AddUsedLeave(this.ConceptCalculateDate, pairValue, halfDayPermit); absenceDuration += pairValue; } IList <IPair> pairList = absence.DecreasePairFromFirst(absenceDuration); ((PairableScndCnpValue)this.DoConcept(3001)).DecreasePairFromFirst(absenceDuration); foreach (IPair pair in pairList) { ((PairableScndCnpValue)Result).AppendPair(pair); } this.ReCalculate(this.ConceptCalculateDate, 3008, 3010, 3014, 3029, 3030, 3031); } if (hourlyLeave.ID > 0 && hourlyLeave.PairCount > 0) { base.C1002(Result, MyConcept); } }
/// <summary> /// • در صورتی به شخص کارکرد روزانه داده میشود که شخص حداقل به میزان 7:30 حضور داشته باشد. //• در صورت حضور کمتر از 7:30 , میزان حضور اضافه کار لحاظ میگردد. //• در صورت حضور بیش از 7:30 , علاوه بر اختصاص کارکرد روزانه , اضافه کار نیز به شخص تعلق میگیرد. //• در صورت عدم حضور شخص در یک روز , به شخص غیبت روزانه تعلق میگیرد /// </summary> /// <param name="MyRule"></param> public virtual void R2501_old(AssignedRule MyRule) { GetLog(MyRule, DebugRuleState.Before, 4, 4002, 3028, 3004, 13); if (this.DoConcept(2005).Value == 0 && this.DoConcept(1090).Value == 0) { this.DoConcept(4).Value = 0; } PairableScndCnpValue tmpCnp = new PairableScndCnpValue(); PairableScndCnpValue orginTmpCnp = new PairableScndCnpValue(); tmpCnp.AddPairs(this.DoConcept(1)); tmpCnp.AppendPairs(this.DoConcept(1003)); tmpCnp.AppendPairs(this.DoConcept(2023)); ((PairableScndCnpValue)this.DoConcept(4002)).ClearPairs(); int minHozour = MyRule["first", this.RuleCalculateDate].ToInt(); int esterhat = MyRule["second", this.RuleCalculateDate].ToInt(); int in2Shift = MyRule["third", this.RuleCalculateDate].ToInt(); this.DoConcept(3012).Value = minHozour;//بعلت عدم تعریم مفهوم از این استفاده میشود if (tmpCnp.Value > 0) { orginTmpCnp.AddPairs(tmpCnp); int start1 = MyRule["4th", this.RuleCalculateDate].ToInt(); //شروع محدوده غیر مجاز اضافه کار قبل وقت صبح int start2 = MyRule["5th", this.RuleCalculateDate].ToInt(); //شروع محدوده غیر مجاز اضافه کار بعد وقت صبح int end2 = MyRule["6th", this.RuleCalculateDate].ToInt(); //پایان محدوده غیر مجاز اضافه کار بعد وقت صبح int start3 = MyRule["7th", this.RuleCalculateDate].ToInt(); //شروع محدوده غیر مجاز اضافه کار قبل وقت عصر int end3 = MyRule["8th", this.RuleCalculateDate].ToInt(); //پایان محدوده غیر مجاز اضافه کار قبل وقت عصر int end4 = MyRule["9th", this.RuleCalculateDate].ToInt(); //پایان محدوده غیر مجاز اضافه کار بعد وقت عصر int start = tmpCnp.Pairs.First().From; int end = tmpCnp.Pairs.Last().To; PairableScndCnpValuePair notAllow = new PairableScndCnpValuePair(); PairableScndCnpValue notAllowOverwork = new PairableScndCnpValue(); if (start1 > 0 && end4 > 0) { notAllow = new PairableScndCnpValuePair(start1, end4); notAllowOverwork.AddPairs(Operation.Differance(tmpCnp, notAllow)); tmpCnp.AddPairs(Operation.Intersect(tmpCnp, notAllow)); } if (end > 0 && start2 > 0 && end2 > 0 && end > start2 && end < end2) { notAllow = new PairableScndCnpValuePair(start2, end2); notAllowOverwork.AppendPairs(Operation.Intersect(tmpCnp, notAllow)); tmpCnp.AddPairs(Operation.Differance(tmpCnp, notAllow)); } if (start > 0 && start3 > 0 && end3 > 0 && start > start3 && start < end3) { notAllow = new PairableScndCnpValuePair(start3, end3); notAllowOverwork.AppendPairs(Operation.Intersect(tmpCnp, notAllow)); tmpCnp.AddPairs(Operation.Differance(tmpCnp, notAllow)); } ((PairableScndCnpValue)this.DoConcept(4003)).AddPairs(notAllowOverwork); } if (tmpCnp.Value > minHozour) { if (tmpCnp.Value >= in2Shift && in2Shift > 0) { tmpCnp.DecreasePairFromFirst(esterhat * 2); } else { tmpCnp.DecreasePairFromFirst(esterhat); } } if (tmpCnp.Value > 0) { this.DoConcept(13).Value = tmpCnp.Value; if (tmpCnp.Value >= this.DoConcept(7).Value) { this.DoConcept(4).Value = 1; tmpCnp.DecreasePairFromFirst(this.DoConcept(7).Value); ((PairableScndCnpValue)this.DoConcept(4002)).AddPairs(tmpCnp); } else { //اگر حداقل حضور که معمولا 3:30 است را داشته باشد , این مفهوم مقدار دهس میشود if (tmpCnp.Value >= minHozour) { this.DoConcept(503).Value = 1; ((PairableScndCnpValue)this.DoConcept(3028)).IncreaseValue(this.DoConcept(7).Value);// - tmpCnp.Value); ((PairableScndCnpValue)this.DoConcept(4002)).AddPairs(tmpCnp); } else { ((PairableScndCnpValue)this.DoConcept(4002)).AddPairs(tmpCnp); // this.DoConcept(13).Value = this.DoConcept(4002).Value; } } } else if (this.DoConcept(2005).Value == 0 && this.DoConcept(1090).Value == 0 && this.DoConcept(1091).Value == 0) { this.DoConcept(3004).Value = 1; } this.DoConcept(5022).FromPairs = ""; GetLog(MyRule, DebugRuleState.After, 4, 4002, 3028, 3004, 13); }
/// <summary> /// • در صورتی به شخص کارکرد روزانه داده میشود که شخص حداقل به میزان 7:30 حضور داشته باشد. //• در صورت حضور کمتر از 7:30 , میزان حضور اضافه کار لحاظ میگردد. //• در صورت حضور بیش از 7:30 , علاوه بر اختصاص کارکرد روزانه , اضافه کار نیز به شخص تعلق میگیرد. //• در صورت عدم حضور شخص در یک روز , به شخص غیبت روزانه تعلق میگیرد /// </summary> /// <param name="MyRule"></param> public virtual void R2501(AssignedRule MyRule) { GetLog(MyRule, DebugRuleState.Before, 4, 4002, 3028, 3004, 13); this.DoConcept(501).Value = 1;//روز محاسبه شده را نگه میدارد.بوسیله این متوجه میشویم که حداکثر تعداد روز محاسباتی در ماه چقدر است-همیشه نمیتوان به تعداد رینج ماهانه اکتفا کرد if (this.DoConcept(2005).Value == 0 && this.DoConcept(1090).Value == 0) { this.DoConcept(4).Value = 0; } PairableScndCnpValue tmpCnp = new PairableScndCnpValue(); PairableScndCnpValue orginTmpCnp = new PairableScndCnpValue(); tmpCnp.AddPairs(this.DoConcept(1)); tmpCnp.AppendPairs(this.DoConcept(1003)); tmpCnp.AppendPairs(this.DoConcept(2023)); ((PairableScndCnpValue)this.DoConcept(4002)).ClearPairs(); int minHozour = MyRule["first", this.RuleCalculateDate].ToInt(); int esterhat = MyRule["second", this.RuleCalculateDate].ToInt(); int in2Shift = MyRule["third", this.RuleCalculateDate].ToInt(); this.DoConcept(3012).Value = minHozour; //بعلت عدم تعریم مفهوم از این استفاده میشود if (tmpCnp.Value > 0) //کم کردن کارکرد خارج از محدوده { orginTmpCnp.AddPairs(tmpCnp); int start1 = MyRule["4th", this.RuleCalculateDate].ToInt(); //شروع محدوده غیر مجاز اضافه کار قبل وقت صبح int start2 = MyRule["5th", this.RuleCalculateDate].ToInt(); //شروع محدوده غیر مجاز اضافه کار بعد وقت صبح int end2 = MyRule["6th", this.RuleCalculateDate].ToInt(); //پایان محدوده غیر مجاز اضافه کار بعد وقت صبح int start3 = MyRule["7th", this.RuleCalculateDate].ToInt(); //شروع محدوده غیر مجاز اضافه کار قبل وقت عصر int end3 = MyRule["8th", this.RuleCalculateDate].ToInt(); //پایان محدوده غیر مجاز اضافه کار قبل وقت عصر int end4 = MyRule["9th", this.RuleCalculateDate].ToInt(); //پایان محدوده غیر مجاز اضافه کار بعد وقت عصر int start = tmpCnp.Pairs.First().From; int end = tmpCnp.Pairs.Last().To; PairableScndCnpValuePair notAllow = new PairableScndCnpValuePair(); PairableScndCnpValue notAllowOverwork = new PairableScndCnpValue(); if (start1 > 0 && end4 > 0) { notAllow = new PairableScndCnpValuePair(start1, end4); notAllowOverwork.AddPairs(Operation.Differance(tmpCnp, notAllow)); tmpCnp.AddPairs(Operation.Intersect(tmpCnp, notAllow)); } if (end > 0 && start2 > 0 && end2 > 0 && end > start2 && end < end2) { notAllow = new PairableScndCnpValuePair(start2, end2); notAllowOverwork.AppendPairs(Operation.Intersect(tmpCnp, notAllow)); tmpCnp.AddPairs(Operation.Differance(tmpCnp, notAllow)); } if (start > 0 && start3 > 0 && end3 > 0 && start > start3 && start < end3) { notAllow = new PairableScndCnpValuePair(start3, end3); notAllowOverwork.AppendPairs(Operation.Intersect(tmpCnp, notAllow)); tmpCnp.AddPairs(Operation.Differance(tmpCnp, notAllow)); } //((PairableScndCnpValue)this.DoConcept(4003)).AddPairs(notAllowOverwork); } if (tmpCnp.Value > 0)//کم کردن مدت استراحت { if (tmpCnp.Value >= in2Shift && in2Shift > 0) { tmpCnp.DecreasePairFromFirst(esterhat * 2); } else { tmpCnp.DecreasePairFromFirst(esterhat); } } if (tmpCnp.Value > 0) { this.DoConcept(13).Value = tmpCnp.Value; } else if (this.DoConcept(2005).Value == 0 && this.DoConcept(1090).Value == 0 && this.DoConcept(1091).Value == 0) { this.DoConcept(3004).Value = 1; } this.DoConcept(5022).FromPairs = ""; GetLog(MyRule, DebugRuleState.After, 4, 4002, 3028, 3004, 13); }