public static AnswerCellViewModel MakeAnswerCellViewModel(FactorColumnEntity factorColumnEntity, int factorTypeId, string factorTypeName, string species, string location, string bodyOfWater, string method) { AnswerCellViewModel model = new AnswerCellViewModel() { Answer = GetAnswer(factorColumnEntity, factorTypeId), FactorTypeName = factorTypeName, Species = species, Location = location, BodyOfWater = bodyOfWater, Method = method }; return model; }
public FactorColumnEntity FactorColumnEntityPopulate(FactorColumnEntity entity, DataRow dr, int number) { if (entity == null) entity = new FactorColumnEntity(); string num = number.ToString(); entity.FactorId = Convert.ToInt32(dr["Factor" + num + "Id"]); entity.FactorLabel = dr["Factor" + num + "Label"].ToString(); entity.FactorTitle = dr["Factor" + num + "Title"].ToString(); entity.FactorKeyInfo = dr["Factor" + num + "KeyInfo"].ToString(); entity.FactorScore = dr["Factor" + num + "Score"].ToString(); entity.FactorScoreDescription = dr["Factor" + num + "ScoreDescription"].ToString(); entity.FactorCommentCount = Convert.ToInt32(dr["Factor" + num + "CommentCount"]); try { entity.FactorDetailedRationale = dr["Factor" + num + "Rationale"].ToString(); } catch(Exception){ } return entity; }
public static AnswerEntity GetAnswer(FactorColumnEntity factorColumnEntity, int factorTypeId) { AnswerEntity answer = new AnswerEntity(); answer.FactorId = factorColumnEntity.FactorId; answer.Score = factorColumnEntity.FactorScore; answer.ScoreDescription = factorColumnEntity.FactorScoreDescription; answer.Label = factorColumnEntity.FactorLabel; answer.CommentCount = factorColumnEntity.FactorCommentCount; answer.Title = factorColumnEntity.FactorTitle; answer.KeyInfo = factorColumnEntity.FactorKeyInfo; answer.FactorTypeId = factorTypeId; return answer; }