protected void btnUpdate_Click(object sender, EventArgs e)
 {
     if (boolAdd)
     {
         string strDisplay = oRequest.MaximumProjectRequestQuestions();
         int    intDisplay = 0;
         if (strDisplay != "")
         {
             intDisplay = Int32.Parse(strDisplay);
         }
         int intQuestionID = oRequest.AddQuestion(txtQuestion.Text, txtQuestion.Text, intDisplay + 1, (hdnEnabled.Value.ToString() == "true" ? 1 : 0), (hdnRequired.Value.ToString() == "true" ? 1 : 0));
         oRequest.AddQuestionsClass(intQuestionID, Int32.Parse(drpClass.SelectedValue));
         oRequest.AddQA(strBase, intOrganizationId, intQuestionID);
     }
     else
     {
         oRequest.UpdateQuestionsClass(intQuestionId, Int32.Parse(drpClass.SelectedValue));
         oRequest.UpdateQuestion(intQuestionId, txtQuestion.Text.Trim(), txtQuestion.Text.Trim(), (hdnEnabled.Value.ToString() == "true" ? 1 : 0), (hdnRequired.Value.ToString() == "true" ? 1 : 0));
     }
     Redirect();
 }
Beispiel #2
0
 protected void btnAdd_Click(Object Sender, EventArgs e)
 {
     if (Request.Form[hdnId.UniqueID] == "0")
     {
         oProjectRequest.AddQuestion(txtName.Text, txtQuestion.Text, 0, (chkEnabled.Checked ? 1 : 0), (chkRequired.Checked ? 1 : 0));
     }
     else
     {
         oProjectRequest.UpdateQuestion(Int32.Parse(Request.Form[hdnId.UniqueID]), txtName.Text, txtQuestion.Text, (chkEnabled.Checked ? 1 : 0), (chkRequired.Checked ? 1 : 0));
     }
     if (Request.Form[hdnOrder.UniqueID] != "")
     {
         string strOrder = Request.Form[hdnOrder.UniqueID];
         int    intCount = 0;
         while (strOrder != "")
         {
             intCount++;
             int intId = Int32.Parse(strOrder.Substring(0, strOrder.IndexOf("&")));
             strOrder = strOrder.Substring(strOrder.IndexOf("&") + 1);
             oProjectRequest.UpdateQuestionOrder(intId, intCount);
         }
     }
     Response.Redirect(Request.Path);
 }