protected void PopulateAssessmentValues() { try { string s = DataProxy.EvaluateAssessmentTriggers(intAssessmentID); string strValue = DataProxy.GetAssessmentTriggers(intAssessmentID, intLanguageID); lblTriggerRecValue.Text = strValue; /*DON'T NEED TO DO ALL THIS ANYMORE - ALL UPDATES ARE WITHIN EVAL PROCEDURE NOW. * int intTriggerValue = 0; * Int32.TryParse(strValue, out intTriggerValue); * * if (intTriggerValue == 0) //Not enough information saved yet / no triggers evaluated to true. * intTriggerValue = 10; * * int intAssessmentTriggerID = DataProxy.GetAssessmentTriggerID(intAssessmentID); * * if (intAssessmentTriggerID > 0) //Record exists - update with new evaluation * DataProxy.UpdateAssessmentTriggers(intAssessmentTriggerID, intTriggerValue); * else * //Trigger record doesn't exist for Assessment - insert a new record. * DataProxy.InsertAssessmentTriggers(intAssessmentID, intTriggerValue); * * * DataTable dtTrigger = DataProxy.GetTriggerInfo(intAssessmentID); * if (dtTrigger != null) * { * if (dtTrigger.Rows.Count > 0) * { * DataRow drT = dtTrigger.Rows[0]; * lblTriggerRecValue.Text = drT["DisplayTriggers"].ToString(); * } * } */ DataTable dtAssess = DataProxy.GetAssessmentInfo(intAssessmentID, intLanguageID); DataRow dr = null; string strRLURL = "http://www.iucnredlist.org/apps/redlist/details/"; string strRLMap = "http://maps.iucnredlist.org/map.html?id="; string strRLID = ""; if (dtAssess != null) { if (dtAssess.Rows.Count > 0) { //Set page control values based on returned values in dataset. dr = dtAssess.Rows[0]; string strCommonName = ""; ARKIVESpeciesName = DataProxy.GetArkiveName(dr["GenusName"].ToString(), dr["SpeciesName"].ToString()); lblOrderValue.Text = dr["SpeciesOrder"].ToString(); lblFamilyValue.Text = dr["SpeciesFamily"].ToString(); lblNationalRLCValue.Text = dr["NationalRedListCategory"].ToString(); lblGlobalRLCValue.Text = dr["GlobalRedListCategory"].ToString(); strCommonName = dr["SpeciesAssessmentDisplayName"].ToString().Trim(); strRLID = dr["RedListID"].ToString().Trim(); strRLURL += strRLID; strRLMap += strRLID; lblAdditionalCommentsValue.Text = DataProxy.GetAdditionalComments(intAssessmentID); if (strCommonName != "") { lblSpeciesDisplayName.Text = dr["SpeciesDisplayName"].ToString() + ","; } else { lblSpeciesDisplayName.Text = dr["SpeciesDisplayName"].ToString(); } if (dr["Completed"] != null) { if (dr["Completed"].ToString().ToUpper() == "TRUE") { lblAssessmentStatusValue.Text = DataProxy.LoadString("COMPLETEDLABEL", strCurrentLanguage); } else { lblAssessmentStatusValue.Text = DataProxy.LoadString("INCOMPLETELABEL", strCurrentLanguage); } } else { lblAssessmentStatusValue.Text = DataProxy.LoadString("INCOMPLETELABEL", strCurrentLanguage); } lblSpeciesAssessmentDisplayName.Text = strCommonName; lblEDScoreValue.Text = dr["EDScore"].ToString(); lblDistributionValue.Text = DataProxy.GetSpeciesDistribution(intSpeciesID); lblAssessedForValue.Text = dr["CountryName"].ToString(); lblAssessedByValue.Text = dr["UserFullName"].ToString(); lblAssessedOnValue.Text = dr["DateCreatedDate"].ToString(); lnkRedList.NavigateUrl = strRLURL; lnkRedList.Text = DataProxy.LoadString("REDLISTMAPLABEL", strCurrentLanguage); lnkRLMap.HRef = strRLMap; if (strRLID == "" || strRLID == "0") { lnkRedList.Visible = false; lnkRLMap.Visible = false; imgRLMapOnly.Visible = true; string strURL = ""; if (strCurrentLanguage.ToUpper() == "SPANISH") { strURL = "~/images/No map data ES.jpg"; } else { strURL = "~/images/No map data EN.jpg"; } imgRLMapOnly.ImageUrl = strURL; } } } } catch (Exception ex) { lblError.Text = ex.Message; } }
protected void PopulateAssessmentValues() { try { string s = DataProxy.EvaluateAssessmentTriggers(intAssessmentID); string strValue = DataProxy.GetConsolidatedRecommendations(intLanguageID, intSpeciesID, intCountryID); lblTriggerRecValue.Text = strValue; DataTable dtAssess = DataProxy.GetConsolidatedReportResults(intCountryID, intSpeciesID, intLanguageID); DataRow dr = null; string strRLURL = "http://www.iucnredlist.org/apps/redlist/details/"; string strRLMap = "http://maps.iucnredlist.org/map.html?id="; string strRLID = ""; if (dtAssess != null) { if (dtAssess.Rows.Count > 0) { //Set page control values based on returned values in dataset. dr = dtAssess.Rows[0]; string strCommonName = ""; lblOrderValue.Text = dr["SpeciesOrder"].ToString(); lblFamilyValue.Text = dr["SpeciesFamily"].ToString(); lblNationalRLCValue.Text = dr["NationalRedListCategory"].ToString(); lblGlobalRLCValue.Text = dr["GlobalRedListCategory"].ToString(); strCommonName = dr["SpeciesAssessmentDisplayName"].ToString().Trim(); strRLID = dr["RedListID"].ToString().Trim(); strRLURL += strRLID; strRLMap += strRLID; //lblAdditionalCommentsValue.Text = DataProxy.GetAdditionalComments(intAssessmentID); lblAdditionalCommentsValue.Text = dr["Comments"].ToString(); if (strCommonName != "") { lblSpeciesDisplayName.Text = dr["SpeciesDisplayName"].ToString() + ","; } else { lblSpeciesDisplayName.Text = dr["SpeciesDisplayName"].ToString(); } if (dr["Completed"] != null) { if (dr["Completed"].ToString().ToUpper() == "TRUE") { lblAssessmentStatusValue.Text = DataProxy.LoadString("COMPLETEDLABEL", strCurrentLanguage); } else { lblAssessmentStatusValue.Text = DataProxy.LoadString("INCOMPLETELABEL", strCurrentLanguage); } } else { lblAssessmentStatusValue.Text = DataProxy.LoadString("INCOMPLETELABEL", strCurrentLanguage); } lblSpeciesAssessmentDisplayName.Text = strCommonName; lblEDScoreValue.Text = dr["EDScore"].ToString(); lblDistributionValue.Text = DataProxy.GetSpeciesDistribution(intSpeciesID); lblAssessedForValue.Text = dr["CountryName"].ToString(); //For consolidated reports - concatenate all values: lblAssessedByValue.Text = DataProxy.GetConcatAssessedOnValues(dtAssess);//dr["UserFullName"].ToString(); //lblAssessedOnValue.Text = dr["DateCreatedDate"].ToString();; lnkRedList.NavigateUrl = strRLURL; lnkRedList.Text = DataProxy.LoadString("REDLISTMAPLABEL", strCurrentLanguage); lnkRLMap.HRef = strRLMap; if (strRLID == "" || strRLID == "0") { lnkRedList.Visible = false; lnkRLMap.Visible = false; imgRLMapOnly.Visible = true; string strURL = ""; if (strCurrentLanguage.ToUpper() == "SPANISH") { strURL = "~/images/No map data ES.jpg"; } else { if (strCurrentLanguage.ToUpper() == "FRENCH") { strURL = "~/images/No map data FR.jpg"; } else { strURL = "~/images/No map data EN.jpg"; } } imgRLMapOnly.ImageUrl = strURL; } } } } catch (Exception ex) { lblError.Text = ex.Message; } }