/// <summary> /// get Moody_Monthly_PD_Info(A81) /// </summary> /// <returns></returns> public Tuple <bool, List <A81ViewModel> > GetA81() { using (IFRS9DBEntities db = new IFRS9DBEntities()) { if (db.Moody_Monthly_PD_Info.Any()) { List <A81ViewModel> data = (from item in db.Moody_Monthly_PD_Info.AsNoTracking() .AsEnumerable() select new A81ViewModel() //轉型 Datetime { Trailing_12m_Ending = item.Trailing_12m_Ending.HasValue ? item.Trailing_12m_Ending.Value.ToString("yyyy/MM/dd") : string.Empty, Actual_Allcorp = TypeTransfer.doubleNToString(item.Actual_Allcorp), Actual_SG = TypeTransfer.doubleNToString(item.Actual_SG), Baseline_forecast_Allcorp = TypeTransfer.doubleNToString(item.Baseline_forecast_Allcorp), Baseline_forecast_SG = TypeTransfer.doubleNToString(item.Baseline_forecast_SG), Pessimistic_Forecast_Allcorp = TypeTransfer.doubleNToString(item.Pessimistic_Forecast_Allcorp), Pessimistic_Forecast_SG = TypeTransfer.doubleNToString(item.Pessimistic_Forecast_SG), Data_Year = item.Data_Year }).ToList(); return(new Tuple <bool, List <A81ViewModel> >(true, data)); } } return(new Tuple <bool, List <A81ViewModel> >(false, new List <A81ViewModel>())); }
/// <summary> /// Db 組成 C07ViewModel /// </summary> /// <param name="data"></param> /// <returns></returns> private C07ViewModel DbToC07ViewModel(EL_Data_Out data) { return(new C07ViewModel() { PID = data.PID, Data_ID = data.Data_ID, PRJID = data.PRJID, FLOWID = data.FLOWID, Report_Date = data.Report_Date, Processing_Date = data.Processing_Date, Product_Code = data.Product_Code, Reference_Nbr = data.Reference_Nbr, PD = TypeTransfer.doubleNToString(data.PD), Lifetime_EL = TypeTransfer.doubleNToString(data.Lifetime_EL), Y1_EL = TypeTransfer.doubleNToString(data.Y1_EL), EL = TypeTransfer.doubleNToString(data.EL), Impairment_Stage = data.Impairment_Stage, Exec_Date = data.Exec_Date?.ToString("yyyy/MM/dd HH:mm:ss"), Version = data.Version.ToString() }); }