public List <ActiveData_VM> GetActiveData(SafetyDashboard_VM Model) { var query = new List <ActiveData_VM>(); try { using (var db = new DBConnection()) { var ds = new DataSet(); var par = new SqlParameter[] { new SqlParameter("@p_CustomerID", GetDBNULL(Model.CustomerID)), new SqlParameter("@p_ModuleCode", GetDBNULL(Model.CurrentModuleCode)), new SqlParameter("@p_ServiceLineCode", GetDBNULL(Model.CurrentServiceLineCode)), new SqlParameter("@p_LanguageCode", GetDBNULLString(Model.CurrentLanguageCode)), new SqlParameter("@p_UTCOffset", GetDBNULL(Model.CurrentUTCOffset)), new SqlParameter("@p_EndUserID", GetDBNULL(Model.CurrentEndUserID)), new SqlParameter("@p_UserRoleID", GetDBNULL(Model.CurrentUserRoleID)), new SqlParameter("@p_ScreenID", GetDBNULL(Model.CurrentScreenID)), new SqlParameter("@p_AccessPoint", GetDBNULLString(Model.AccessPoint)), }; ds = db.ExecuteDataSet("GetCustomerSafetyDashboardActiveAssetsPlansDeviations", par); query = ConvertToList <ActiveData_VM>(ds.Tables[0]); } } catch (Exception ex) { logger.Error("CustomerDashboardRepository_GetActiveData Error: ", ex); throw; } return(query); }
public List <SafetyDashboardYearlyChart_VM> GetDashboardYearlySnapshot(SafetyDashboard_VM Model) { var query = new List <SafetyDashboardYearlyChart_VM>(); try { using (var db = new WebPortalEntities()) { var config = new MapperConfiguration(cfg => cfg.CreateMap <GetCustomerSafetyDashboardYearlyChart_Result, SafetyDashboardYearlyChart_VM>()); var mapper = config.CreateMapper(); var data = db.GetCustomerSafetyDashboardYearlyChart(Model.CustomerID, Model.CurrentModuleCode, Model.CurrentServiceLineCode, Model.CurrentLanguageCode, Model.CurrentUTCOffset, Model.CurrentEndUserID, Model.CurrentUserRoleID, Model.CurrentScreenID, Model.AccessPoint).ToList(); return(mapper.Map <List <GetCustomerSafetyDashboardYearlyChart_Result>, List <SafetyDashboardYearlyChart_VM> >(data, query)); } } catch (Exception ex) { logger.Error("CustomerDashboardRepository_GetDashboardYearlySnapshot Error: ", ex); throw; } }