private int GetShiftDay(string ShiftCode) { BaseSetting.ShiftModelFacade shiftModel = new BaseSetting.ShiftModelFacade(this.DataProvider); Shift shift = (Shift)shiftModel.GetShift(ShiftCode); TimePeriod period = (TimePeriod)shiftModel.GetTimePeriod(shift.ShiftTypeCode, Web.Helper.FormatHelper.TOTimeInt(DateTime.Now)); if (period.IsOverDate == Web.Helper.FormatHelper.TRUE_STRING) { if (period.TimePeriodBeginTime < period.TimePeriodEndTime) { return(FormatHelper.TODateInt(DateTime.Now.AddDays(-1))); } else if (Web.Helper.FormatHelper.TOTimeInt(DateTime.Now) < period.TimePeriodBeginTime) { return(FormatHelper.TODateInt(DateTime.Now.AddDays(-1))); } else { return(FormatHelper.TODateInt(DateTime.Now)); } } else { return(FormatHelper.TODateInt(DateTime.Now)); } }
public object GetShift(string ShiftTypeCode) { BaseSetting.ShiftModelFacade shiftModel = new BaseSetting.ShiftModelFacade(this.DataProvider); Domain.BaseSetting.TimePeriod period = (Domain.BaseSetting.TimePeriod)shiftModel.GetTimePeriod(ShiftTypeCode, Web.Helper.FormatHelper.TOTimeInt(DateTime.Now)); if (period == null) { return(null); } return(shiftModel.GetShift(period.ShiftCode)); }