private void SaveQA(TreeNode oParent) { foreach (TreeNode oNode in oParent.ChildNodes) { if (oNode.Checked == true) { int _organization_id = Int32.Parse(oNode.Value); oProjectRequest.AddQA(oParent.Text, _organization_id, intQuestion); } } }
private void SaveQA(TreeNode oParent) { foreach (TreeNode oNode in oParent.ChildNodes) { if (oNode.Checked == true && !(oParent.Text.ToString() == strBase && oNode.Value.ToString() == intOrganizationID.ToString())) { int _organization_id = Int32.Parse(oNode.Value); oProjectRequest.DeleteQA(oParent.Text, _organization_id); dsQA = oProjectRequest.GetQA(strBase, intOrganizationID); foreach (DataRow drQA in dsQA.Tables[0].Rows) { intQuestion = Int32.Parse(drQA["questionid"].ToString()); oProjectRequest.AddQA(oParent.Text, _organization_id, intQuestion); } } } }
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(); }