Ejemplo n.º 1
0
 /// <summary>
 /// Find
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public Holiday FindHoliday(int id)
 {
     lock (BusinessEntity.m_sDS)
     {
         return(Holidays.Find(s => s.ID == id));
     }
 }
Ejemplo n.º 2
0
        //获取这天的配送类型
        public void GetDeliveryType()
        {
            if (OriginalDeliveryType == 1)
            {
                //检查节假日
                HolidayEntity hd = Holidays.Find(x => x.HolidayDate == StartTime.Date);
                DeliveryType = hd == null ? 1 : hd.DeliveryType;
            }
            else if (OriginalDeliveryType == 2)
            {
                //检查节假日和星期日
                DeliveryType = StartTime.DayOfWeek == DayOfWeek.Sunday ? 1 : 2;

                //检查节假日
                HolidayEntity hd = Holidays.Find(x => x.HolidayDate.Date == StartTime.Date);
                if (hd != null)
                {
                    DeliveryType = hd.DeliveryType;
                }
            }
        }