private void GetCommitSurvey() { string SurveyId = this.RequestData.Get <string>("SurveyId"); if (!string.IsNullOrEmpty(SurveyId)) { if (!string.IsNullOrEmpty(this.RequestData.Get <string>("UserId"))) { SurveyCommitHistory Ent = SurveyCommitHistory.FindFirstByProperties(SurveyCommitHistory.Prop_SurveyId, SurveyId, SurveyCommitHistory.Prop_SurveyedUserId, this.RequestData.Get <string>("UserId")); if (Ent != null) { string str = string.IsNullOrEmpty(Ent.CommitSurvey) ? "" : Ent.CommitSurvey; try { int start = str.IndexOf("<SCRIPT type=text/javascript src=\"js/renderSurvey.js\"></SCRIPT>"); int end = str.IndexOf("</HEAD>"); str = str.Remove(start, end - start); str = str.Replace("commit()", ""); str = str.Replace("cancel()", ""); Response.Write(str); } catch (Exception e) { Response.Write(str); } } } else { SurveyCommitHistory Ent = SurveyCommitHistory.FindFirstByProperties(SurveyCommitHistory.Prop_SurveyId, SurveyId, SurveyCommitHistory.Prop_SurveyedUserId, UserInfo.UserID); if (Ent != null) { string str = string.IsNullOrEmpty(Ent.CommitSurvey) ? "" : Ent.CommitSurvey; int start = str.IndexOf("<SCRIPT type=text/javascript src=\"js/renderSurvey.js\"></SCRIPT>"); int end = str.IndexOf("</HEAD>"); str = str.Remove(start, end - start); Response.Write(str); // Response.Write(string.IsNullOrEmpty(Ent.CommitSurvey) ? "" : Ent.CommitSurvey); } } } //Response.End(); }
private void GetCommitSurvey() { string SurveyId = this.RequestData.Get <string>("SurveyId"); if (!string.IsNullOrEmpty(SurveyId)) { if (!string.IsNullOrEmpty(this.RequestData.Get <string>("UserId"))) { SurveyCommitHistory Ent = SurveyCommitHistory.FindFirstByProperties(SurveyCommitHistory.Prop_SurveyId, SurveyId, SurveyCommitHistory.Prop_SurveyedUserId, this.RequestData.Get <string>("UserId")); if (Ent != null) { Response.Write(string.IsNullOrEmpty(Ent.CommitSurvey) ? "" : Ent.CommitSurvey); } } else { SurveyCommitHistory Ent = SurveyCommitHistory.FindFirstByProperties(SurveyCommitHistory.Prop_SurveyId, SurveyId, SurveyCommitHistory.Prop_SurveyedUserId, UserInfo.UserID); if (Ent != null) { Response.Write(string.IsNullOrEmpty(Ent.CommitSurvey) ? "" : Ent.CommitSurvey); } } } }