public IList <OtherRecommendationSetting> GetAll(int plannerId) { try { Logger.LogInfo("Get: Other recommenation process start"); IList <OtherRecommendationSetting> personalAccidentInsurances = new List <OtherRecommendationSetting>(); DataTable dtAppConfig = DataBase.DBService.ExecuteCommand(string.Format(SELECT_BY_PROJECT_ID, plannerId)); foreach (DataRow dr in dtAppConfig.Rows) { OtherRecommendationSetting personalAccidentInsurance = convertToOtherRecommendationObject(dr); personalAccidentInsurances.Add(personalAccidentInsurance); } Logger.LogInfo("Get: Other recommendation process completed."); return(personalAccidentInsurances); } catch (Exception ex) { StackTrace st = new StackTrace(); StackFrame sf = st.GetFrame(0); MethodBase currentMethodName = sf.GetMethod(); LogDebug(currentMethodName.Name, ex); return(null); } }
private OtherRecommendationSetting convertToOtherRecommendationObject(DataRow dr) { OtherRecommendationSetting otherRecommendationSetting = new OtherRecommendationSetting(); otherRecommendationSetting.PID = dr.Field <int>("PID"); otherRecommendationSetting.Title = dr.Field <string>("Title"); otherRecommendationSetting.Description = dr.Field <string>("Description"); otherRecommendationSetting.IsSelected = bool.Parse(dr["IsSelected"].ToString()); return(otherRecommendationSetting); }