コード例 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Sid <= 0)
         {
             function.WriteErrMsg("缺少问卷投票的ID参数!", "../Plus/SurveyManage.aspx"); return;
         }
         M_Survey info = surBll.GetSurveyBySid(Sid);
         if (info.IsNull)
         {
             function.WriteErrMsg("该问卷投票不存在!可能已被删除", "../Plus/SurveyManage.aspx"); return;
         }
         //this.lblSurveyName.Text = info.SurveyName;
         //this.lblDesp.Text = info.Description;
         //if (!string.IsNullOrEmpty(info.Description))
         //{
         //    this.lblDesp.Text = "问卷描述:" + info.Description;
         //}
         MyBind();
         IList <M_Question> list = new List <M_Question>();
         list = B_Survey.GetQueList(Sid);
         rptReuslt.DataSource = list;
         rptReuslt.DataBind();
         Call.SetBreadCrumb(Master, "<li><a href='SurveyManage.aspx'>问卷投票</a></li><li><a href='Survey.aspx?SID=" + info.SurveyID + "'>" + info.SurveyName + "</a></li><li class='active'>问卷投票结果</li>");
     }
 }
コード例 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Sid <= 0)
         {
             function.WriteErrMsg("缺少问卷的ID参数!");
         }
         M_Survey info = surveyBll.GetSurveyBySid(Sid);
         if (info == null)
         {
             function.WriteErrMsg("该问卷不存在!可能已被删除");
         }
         if (info.EndTime < DateTime.Now)
         {
             function.WriteErrMsg("该问卷已过期!");
         }
         if (!B_Survey.HasQuestion(Sid))
         {
             function.WriteErrMsg("该问卷没有设定问卷问题!");
         }
         MyBind();
     }
 }
コード例 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Sid <= 0)
         {
             function.WriteErrMsg("缺少问卷投票的ID参数!", "SurveyManage.aspx");
         }
         surMod = surBll.GetSurveyBySid(Sid);
         if (surMod.IsNull)
         {
             function.WriteErrMsg("该问卷投票不存在!可能已被删除", "SurveyManage.aspx");
         }
         MyBind();
         string bread = "<li><a href='" + customPath2 + "I/Main.aspx'>工作台</a></li><li><a href='SurveyManage.aspx'>问卷投票管理</a></li><li><a href='Survey.aspx?SID=" + surMod.SurveyID + "'>" + surMod.SurveyName + "</a></li><li class='active'><a href='" + Request.RawUrl + "'>问卷投票列表</a> <a href='SurveyItem.aspx?SID=" + surMod.SurveyID + "'>[添加问题]</a></li>";
         bread += "<a href='/Plugins/Vote.aspx?Sid=" + Sid + "' target='_blank' class='pull-right'><i class='fa fa-eye'></i> 预览</a>";
         Call.SetBreadCrumb(Master, bread);
     }
 }
コード例 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Sid <= 0)
         {
             this.txtStartTime.Text    = DateTime.Now.ToString("yyyy-MM-dd");
             this.txtEndTime.Text      = DateTime.Now.AddDays(30).ToString("yyyy-MM-dd");
             this.ChkIsOpen.Checked    = true;
             this.ChkNeedLogin.Checked = false;
             this.ChkIsStatus.Checked  = false;
             this.ChkIsCheck.Checked   = false;
             this.ChkIsShow.Checked    = false;
         }
         else
         {
             M_Survey info = surveyBll.GetSurveyBySid(Sid);
             if (info.IsNull)
             {
                 function.WriteErrMsg("要修改的问卷投票不存在,可能已被删除!", "../Plus/SurveyManage.aspx");
             }
             else
             {
                 this.TxtSurveyName.Text       = info.SurveyName;
                 this.TxtDescription.Text      = info.Description;
                 this.txtStartTime.Text        = info.StartTime.ToString("yyyy-MM-dd");
                 this.txtEndTime.Text          = info.EndTime.ToString("yyyy-MM-dd");
                 this.ChkIsOpen.Checked        = info.IsOpen;
                 this.ChkNeedLogin.Checked     = info.NeedLogin;
                 this.ChkIsStatus.Checked      = info.IsStatus;
                 this.ChkIsCheck.Checked       = info.IsCheck;
                 this.ChkIsShow.Checked        = info.IsShow == 1;
                 this.RblSurType.SelectedValue = info.SurType.ToString();
                 this.txtIPRepeat.Text         = info.IPRepeat.ToString();
             }
         }
         Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>工作台</a></li><li><a href='ADManage.aspx'>扩展功能</a></li><li><a href='SurveyManage.aspx'>问卷投票列表</a><li class='active'><a href='Survey.aspx'>问卷投票管理</a></li>");
     }
 }
コード例 #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Sid <= 0)
         {
             function.WriteErrMsg("缺少问卷投票的ID参数!", "SurveyManage.aspx");
         }
         M_Survey surMod = surBll.GetSurveyBySid(Sid);
         if (surMod.IsNull)
         {
             function.WriteErrMsg("该问卷投票不存在!可能已被删除", "SurveyManage.aspx");
         }
         this.Label1.Text = surMod.SurveyName;
         if (Qid > 0)
         {
             this.ltlAction.Text  = "修改";
             this.EBtnSubmit.Text = "修改";
             MyBind();
         }
         Call.SetBreadCrumb(Master, "<li><a href='" + customPath2 + "I/Main.aspx'>工作台</a></li><li><a href='SurveyManage.aspx'>问卷投票管理</a></li><li><a href='Survey.aspx?SID=" + surMod.SurveyID + "'>" + surMod.SurveyName + "</a></li><li><a href='SurveyItemList.aspx?SID=" + surMod.SurveyID + "'>问卷投票问题列表</a></li><li class='active'><a href='SurveyItem.aspx'>添加问卷投票问题</a></li>");
     }
 }
コード例 #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         M_UserInfo mu   = buser.GetLogin();
         M_Survey   info = surBll.GetSurveyBySid(Sid);
         if (Sid <= 0)
         {
             function.WriteErrMsg("缺少问卷投票的ID参数!", Request.UrlReferrer.ToString());
         }
         if (info == null || info.IsNull)
         {
             function.WriteErrMsg("缺少问卷!!");
         }
         if (!B_Survey.HasQuestion(Sid))
         {
             function.WriteErrMsg("该投票没有设定投票问题!");
         }
         if (info.NeedLogin)
         {
             B_User.CheckIsLogged(Request.RawUrl);
         }
         if (info.IsCheck)
         {
             regVcodeRegister.Visible = true;
         }
         if (!info.IsOpen)
         {
             function.WriteErrMsg("对不起,该问卷尚未启用!!", Request.UrlReferrer.ToString());
         }
         if (info.StartTime > DateTime.Now || info.EndTime < DateTime.Now)
         {
             function.WriteErrMsg("对不起,每年填写或报名时间是" + info.StartTime.ToLongDateString() + "到" + info.EndTime.ToLongDateString());
         }
         //判断是否已参与了该问卷
         if (B_Survey.HasAnswerBySID(Sid, mu.UserID))
         {
             function.WriteErrMsg("您已提交过该问卷!");
         }
         CheckIP(info);
         Random_Hid.Value = GetRandomID().ToString();
         DataTable tblAnswers = new DataTable();
         if (Request.QueryString["UID"] != null && Request.QueryString["PTime"] != null)
         {
             int    uid  = DataConverter.CLng(Request.QueryString["UID"]);
             string time = Server.UrlDecode(Request.QueryString["PTime"]);
             tblAnswers = B_Answer.GetUserAnswers(Sid, uid, time);
         }
         if (tblAnswers.Rows.Count > 0)
         {
             btnSubmit.Visible = false;
             btnExport.Visible = true;
         }
         else
         {
             btnExport.Visible = false;
             btnSubmit.Visible = true;
         }
         this.SurveyName_L.Text  = info.SurveyName;
         this.Description_L.Text = info.Description;
         this.CreateDate_L.Text  = info.CreateDate.ToString("yyyy-MM-dd");
         qtitle.Visible          = !string.IsNullOrEmpty(info.Description);
         StringBuilder      sb   = new StringBuilder();
         IList <M_Question> list = new List <M_Question>();
         list = B_Survey.GetQueList(Sid);
         for (int i = 0; i < list.Count; i++)
         {
             if (list[i].IsNull)
             {
                 sb.AppendLine("<li id='mao_" + i + "' name='mao_" + i + " '>");
                 IsNull_H.Value += "vote_" + i + ",";
             }
             else
             {
                 sb.AppendLine("<li id='mao_" + i + "' name='mao_" + i + " '>");
             }
             sb.AppendLine("<table id='tbl_" + i + "' style='width:100%;'>");
             sb.AppendLine("<tr style='border-bottom:1px solid #ddd;padding-bottom:5px;'><th>" + (i + 1) + ". " + list[i].QuestionTitle + (list[i].IsNull ? "<span style='color:#f00;margin-left:10px;'>*</span>" : "") + "</th></tr>");
             sb.AppendLine("<tr><td>" + list[i].QuestionContent + "</td></tr>");
             List <string> optionlist  = new List <string>();
             JObject       jobj        = JsonConvert.DeserializeObject <JObject>(list[i].Qoption);
             string[]      OptionValue = list[i].TypeID == 0 ? jobj["sel_op_body"].ToString().Split(',') : jobj["text_str_dp"].ToString().Split(',');
             string        optiontype  = list[i].TypeID == 0 ? jobj["sel_type_rad"].ToString() : jobj["text_type_rad"].ToString();
             if (tblAnswers.Rows.Count > 0)
             {
                 sb.AppendLine(SetAnswers(i, list[i].TypeID, list[i].QuestionID, tblAnswers, OptionValue));
             }
             else
             {
                 sb.AppendLine(SetOptions(i, optiontype, OptionValue));
             }
             sb.AppendLine("</table></li>");
         }
         IsNull_H.Value     = IsNull_H.Value.Trim(',');
         ltlResultHtml.Text = sb.ToString();
     }
 }