Пример #1
0
        public static ContinedPeriod ConvertToViewModel(this bx_cityquoteday item)
        {
            ContinedPeriod model = new ContinedPeriod();

            model.BizDays   = item.bizquotedays ?? 0;
            model.ForceDays = item.quotedays ?? 0;
            model.CityCode  = item.cityid ?? 0;
            return(model);
        }
Пример #2
0
        public static ContinedPeriodNew ConvertToViewModelNew(this bx_cityquoteday item)
        {
            ContinedPeriodNew model = new ContinedPeriodNew();

            model.BizDays   = item.bizquotedays ?? 0;
            model.ForceDays = item.quotedays ?? 0;
            model.CityCode  = item.cityid ?? 0;
            model.CityName  = item.cityname ?? "";
            return(model);
        }
Пример #3
0
        public bx_cityquoteday Get(int cityId)
        {
            bx_cityquoteday model = null;

            try
            {
                model = new EntityContext().bx_cityquoteday.FirstOrDefault(i => i.cityid == cityId);
            }
            catch (Exception ex)
            {
                logError.Info("发生异常:" + ex.Source + "\n" + ex.StackTrace + "\n" + ex.Message + "\n" + ex.InnerException);
            }
            return(model);
        }
Пример #4
0
        public int GetDaysNum(int cityId)
        {
            int             daysNum = 0;
            bx_cityquoteday model   = new bx_cityquoteday();

            try
            {
                model = DataContextFactory.GetDataContext().bx_cityquoteday.FirstOrDefault(i => i.cityid == cityId);
                if (model != null)
                {
                    daysNum = model.quotedays.HasValue ? model.quotedays.Value : 90;//如果库中没值,默认90天
                }
            }
            catch (Exception ex)
            {
                logError.Info("发生异常:" + ex.Source + "\n" + ex.StackTrace + "\n" + ex.Message + "\n" + ex.InnerException);
            }
            return(daysNum);
        }