/// <summary> /// 设置比较的开始时间和结束时间 /// </summary> protected void SetCompareTime() { int type = HeadControl1.CompareTimeType; int daysSpan = 0; daysSpan = (EndTime - BeginTime).Days; if (HeadControl1.CompareTimeType > 0) { switch (type) { case 1: BeginCompareTime = BeginTime.AddDays(-7); EndCompareTime = BeginCompareTime.AddDays(daysSpan); break; case 2: BeginCompareTime = BeginTime.AddMonths(-1); EndCompareTime = BeginCompareTime.AddDays(daysSpan); break; case 3: EndCompareTime = HeadControl1.CompareBeginTime.AddDays(daysSpan); BeginCompareTime = HeadControl1.CompareBeginTime; break; } } BeginCompareTime = new DateTime(BeginCompareTime.Year, BeginCompareTime.Month, BeginCompareTime.Day); EndCompareTime = new DateTime(EndCompareTime.Year, EndCompareTime.Month, EndCompareTime.Day); }
private void ChangedEmployee() { if (EntityEmployee != null) { teEmployee.Text = EntityEmployee.FullName; BeginTime = DateTime.Today; EndTime = BeginTime.AddDays(14); } LoadStores(); InitMinMax(); }
protected override void CalculateTime(DateTime now, out DateTime thisTime, out DateTime nextTime) { thisTime = BeginTime; if (now < thisTime) { nextTime = thisTime; } else { var days = (int)(now - BeginTime).TotalDays; nextTime = BeginTime.AddDays(RepeatPerDays * (days / RepeatPerDays + 1)); //在无重复的情况下下次的执行时间 thisTime = nextTime.AddDays(-RepeatPerDays); } }
public bool IsNeighborRelation(_EmployeeRelation relation) { return(EndTime.AddDays(1) == relation.BeginTime || relation.EndTime == BeginTime.AddDays(-1)); }