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); }
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); }
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); }
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); }