Example #1
0
        public static BusinessTime ToBusinessTime(this M.BusinessTime model)
        {
            var btime = new BusinessTime()
            {
                Start = model.Start.ToTimeModel(),
                End   = model.End.ToTimeModel()
            };

            return(btime);
        }
Example #2
0
        public BusinessStatus GetStatus(BusinessStatus status, BusinessTime time)
        {
            if (status == BusinessStatus.Close)
            {
                return(BusinessStatus.Close);
            }
            var now = DateTime.Now;

            if (now >= time.Start.GetDateTime() && now < time.End.GetDateTime())
            {
                return(BusinessStatus.Open);
            }
            return(BusinessStatus.Close);
        }