public Desboard1Response GetMEIScores([FromBody] Meiscore meiscore) { Desboard1Response dashboardData = new Desboard1Response(); try { Desboard1Response desboard1 = this._iDashboard1Services.GetMEIScores(meiscore); if (desboard1 != null) { dashboardData.Result = true; dashboardData.Data = desboard1.Data; dashboardData.fields = desboard1.fields; dashboardData.colorCode = desboard1.colorCode; dashboardData.commentsList = desboard1.commentsList; dashboardData.Message = "Success"; } else { dashboardData.Result = false; } } catch (Exception ex) { throw; } return(dashboardData); }
public Desboard1Response GetMEIScores(Meiscore meiscore) { DbConnection c = new DbConnection(_configuration); using (IDbConnection con = c.Connection) { con.Open(); var param = new DynamicParameters(); param.Add("@EMPID", meiscore.EMPID); param.Add("@CycleID", meiscore.CycleID); param.Add("@Role", meiscore.Role); param.Add("@DisplayName", meiscore.DisplayName); param.Add("@OrderBy", meiscore.OrderBy); Desboard1Response desboard1Response = new Desboard1Response(); List <DashboardData> castDeshboardData; List <colorCode> colorCode = new List <colorCode>(); List <Fields> fields = new List <Fields>(); List <commentsList> commentsLists = new List <commentsList>(); using (var qList = con.QueryMultiple("dbo.usp_Dashboard1Data", param, commandType: CommandType.StoredProcedure)) { castDeshboardData = qList.Read <DashboardData>().AsList(); colorCode = qList.Read <colorCode>().AsList(); fields = qList.Read <Fields>().AsList(); commentsLists = qList.Read <commentsList>().AsList(); desboard1Response.Data = castDeshboardData; desboard1Response.colorCode = colorCode; desboard1Response.fields = fields; desboard1Response.commentsList = commentsLists; //for(int i=0;i<fields.Count;i++) //{ // DashboardData dashboardData = new DashboardData() // { // dashboardData.Competative1 = fields[i].DisplayName; //}; //} } return(desboard1Response); } }