public object GetImprovementDetails(ImprovementDetail impr) { dynamic TBImprovementListResult; List <object> ImprListResult = new List <object>(); try { List <ImprovementList> Result = Improvement.GetImprovementDetails(impr); for (int i = 0; i < Result.Count; i++) { ImprListResult.Add(new { ImprovementList = Result[i] }); } if (Result != null && Result.Count != 0) { TBImprovementListResult = new { status = "0", message = "success", ImprovementListResult = ImprListResult }; } else { TBImprovementListResult = new { status = "1", message = "Record not found", ImprovementListResult = ImprListResult }; } } catch { TBImprovementListResult = new { status = "1", message = "failed" }; } return(new { TBImprovementListResult = TBImprovementListResult }); }
public static List <ImprovementList> GetImprovementDetails(ImprovementDetail imp) { try { var imprID = new MySqlParameter("?imprID", imp.improvementID); var grpID = new MySqlParameter("?grpID", imp.grpID); var memberProfileID = new MySqlParameter("?memberProfileID", imp.memberProfileID); using (TouchBaseWebAPI.Data.row_productionEntities context = new TouchBaseWebAPI.Data.row_productionEntities()) { context.Connection.Open(); var Result = context.ExecuteStoreQuery <ImprovementList>("CALL V4_USPGetImprovementDetails(?imprID,?grpID,?memberProfileID)", imprID, grpID, memberProfileID).ToList(); foreach (ImprovementList improvement in Result) { if (!string.IsNullOrEmpty(improvement.improvementImg)) { string announ_Image = improvement.improvementImg.ToString(); string path = ConfigurationManager.AppSettings["imgPath"] + "Documents/Improvement/Group" + imp.grpID + "/"; improvement.improvementImg = path + announ_Image; } } return(Result); } } catch (Exception ex) { throw ex; } }