protected void Page_Load(object sender, EventArgs e)
 {
     AuthenticateUser();
     intProfile     = Int32.Parse(Request.Cookies["profileid"].Value);
     oServiceEditor = new ServiceEditor(intProfile, dsnServiceEditor);
     oUser          = new Users(intProfile, dsn);
     Int32.TryParse(Request.QueryString["wm"], out intWM);
     Int32.TryParse(Request.QueryString["serviceid"], out intService);
     Int32.TryParse(Request.QueryString["configid"], out intConfig);
     if (Request.QueryString["saved"] != null)
     {
         trSaved.Visible = true;
     }
     if (!IsPostBack)
     {
         if (intService > 0 && intConfig > 0)
         {
             DataSet ds = oServiceEditor.GetConfigs(intService, intWM, 1);
             foreach (DataRow dr in ds.Tables[0].Rows)
             {
                 int _configid = Int32.Parse(dr["id"].ToString());
                 if (intConfig == _configid)
                 {
                     break;
                 }
                 TreeNode oNode = new TreeNode();
                 oNode.Text         = dr["question"].ToString();
                 oNode.ToolTip      = dr["question"].ToString();
                 oNode.Value        = dr["id"].ToString();
                 oNode.SelectAction = TreeNodeSelectAction.None;
                 oNode.Checked      = false;
                 oTree.Nodes.Add(oNode);
                 if (dr["code"].ToString() == "DROPDOWN" || dr["code"].ToString() == "RADIOLIST")
                 {
                     DataSet dsValues = oServiceEditor.GetConfigValues(_configid);
                     foreach (DataRow drValue in dsValues.Tables[0].Rows)
                     {
                         TreeNode oChild = new TreeNode();
                         oChild.Text         = drValue["value"].ToString();
                         oChild.ToolTip      = drValue["value"].ToString();
                         oChild.Value        = drValue["id"].ToString();
                         oChild.SelectAction = TreeNodeSelectAction.None;
                         DataSet dsResponse = oServiceEditor.GetConfigAffects(intConfig, Int32.Parse(drValue["id"].ToString()));
                         oChild.Checked = (dsResponse.Tables[0].Rows.Count > 0);
                         oNode.ChildNodes.Add(oChild);
                     }
                 }
                 else
                 {
                     TreeNode oChild = new TreeNode();
                     oChild.Text         = "<b>Unavailable.</b> Only &quot;Drop Down List&quot; and &quot;Radio Button List&quot; controls can be used for dynamic display";
                     oChild.Value        = "0";
                     oChild.SelectAction = TreeNodeSelectAction.None;
                     oChild.ShowCheckBox = false;
                     oNode.ChildNodes.Add(oChild);
                 }
             }
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            AuthenticateUser();
            intProfile     = Int32.Parse(Request.Cookies["profileid"].Value);
            oServiceEditor = new ServiceEditor(intProfile, dsnServiceEditor);
            oService       = new Services(intProfile, dsn);
            oUser          = new Users(intProfile, dsn);
            Int32.TryParse(Request.QueryString["id"], out intID);
            Int32.TryParse(Request.QueryString["serviceid"], out intService);
            Int32.TryParse(Request.QueryString["nextservice"], out intNextService);

            if (Request.QueryString["saved"] != null)
            {
                trSaved.Visible = true;
            }
            if (!IsPostBack)
            {
                if (String.IsNullOrEmpty(Request.QueryString["id"]) == false)
                {
                    panCondition.Visible = true;
                    DataSet dsConfigs = oServiceEditor.GetConfigs(intService, -1, 1);
                    //DataSet dsConfigs = oServiceEditor.GetConfigs(intService, 0, 1);
                    foreach (DataRow dr in dsConfigs.Tables[0].Rows)
                    {
                        int      _configid = Int32.Parse(dr["id"].ToString());
                        TreeNode oNode     = new TreeNode();
                        oNode.Text         = dr["question"].ToString();
                        oNode.ToolTip      = dr["question"].ToString();
                        oNode.Value        = dr["id"].ToString();
                        oNode.SelectAction = TreeNodeSelectAction.None;
                        oNode.Checked      = false;
                        treConditional.Nodes.Add(oNode);

                        DataSet dsValues = oServiceEditor.GetConfigValues(_configid);
                        //dr["code"].ToString() == "DROPDOWN" || dr["code"].ToString() == "RADIOLIST"
                        if (dsValues.Tables[0].Rows.Count > 0)
                        {
                            foreach (DataRow drValue in dsValues.Tables[0].Rows)
                            {
                                TreeNode oChild = new TreeNode();
                                oChild.Text         = drValue["value"].ToString();
                                oChild.ToolTip      = drValue["value"].ToString();
                                oChild.Value        = drValue["id"].ToString();
                                oChild.SelectAction = TreeNodeSelectAction.None;
                                oChild.Checked      = oServiceEditor.IsWorkflowConditionValue(intID, Int32.Parse(drValue["id"].ToString()));
                                oNode.ChildNodes.Add(oChild);
                            }
                        }
                        else
                        {
                            TreeNode oChild = new TreeNode();
                            oChild.Text         = "<b>Unavailable.</b> Only &quot;valued&quot; controls can be used for conditional workflow";
                            oChild.Value        = "0";
                            oChild.SelectAction = TreeNodeSelectAction.None;
                            oChild.ShowCheckBox = false;
                            oNode.ChildNodes.Add(oChild);
                        }
                    }

                    if (intID > 0)
                    {
                        DataSet ds = oServiceEditor.GetWorkflowCondition(intID);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            txtName.Text       = ds.Tables[0].Rows[0]["name"].ToString();
                            chkEnabled.Checked = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1");
                        }
                    }
                    btnAdd.Attributes.Add("onclick", "return ValidateText('" + txtName.ClientID + "','Enter a name for this condition')" +
                                          ";");
                }
                else if (intService > 0 && intNextService > 0)
                {
                    DataSet ds = oService.GetWorkflow(intService, intNextService);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        panList.Visible            = true;
                        radConditionOnly.Checked   = (ds.Tables[0].Rows[0]["only"].ToString() == "1");
                        radConditionUnless.Checked = (ds.Tables[0].Rows[0]["only"].ToString() == "0");
                        radContinueYes.Checked     = (ds.Tables[0].Rows[0]["continue"].ToString() == "1");
                        radContinueNo.Checked      = (ds.Tables[0].Rows[0]["continue"].ToString() == "0");
                        btnSave.Attributes.Add("onclick", "return ValidateRadioButtons3('" + radConditionOnly.ClientID + "','" + radConditionUnless.ClientID + "','" + radConditionNeither.ClientID + "','Please select your condition for initiating this workflow')" +
                                               " && ValidateRadioButtons('" + radContinueYes.ClientID + "','" + radContinueNo.ClientID + "','Please select how you want to handle subsequent workflows if this workflow is not initiated')" +
                                               ";");

                        rptConditions.DataSource = oServiceEditor.GetWorkflowConditions(intService, intNextService, 0);
                        rptConditions.DataBind();
                        lblNone.Visible = (rptConditions.Items.Count == 0);
                        foreach (RepeaterItem ri in rptConditions.Items)
                        {
                            ((LinkButton)ri.FindControl("btnDelete")).Attributes.Add("onclick", "return confirm('Are you sure you want to delete this condition set?');");
                        }
                    }
                }
                if (radConditionOnly.Checked == false && radConditionUnless.Checked == false)
                {
                    radConditionNeither.Checked = true;
                }
                if (radContinueNo.Checked == false && radContinueYes.Checked == false)
                {
                    radContinueNo.Checked = true;
                }
            }
        }
예제 #3
0
        protected void btnSave_Click(Object Sender, EventArgs e)
        {
            int intWM = (intWMFlag == 1 || chkWrite.Checked ? 1 : 0);

            if (intConfig == 0)
            {
                int intOrder = oServiceEditor.GetConfigs(intService, intWM, 0).Tables[0].Rows.Count + 1;
                switch (strCode.ToUpper())
                {
                case "DATE":
                    intConfig = oServiceEditor.AddConfig(intService, intField, intWM, txtQuestion.Text, -1, Int32.Parse(txtMinimum.Text), Int32.Parse(txtMaximum.Text), -1, -1, -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", intOrder, 1);
                    break;

                case "TEXTBOX":
                    intConfig = oServiceEditor.AddConfig(intService, intField, intWM, txtQuestion.Text, Int32.Parse(txtLength.Text), Int32.Parse(txtWidth.Text), -1, -1, -1, -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", intOrder, 1);
                    break;

                case "TEXTAREA":
                    intConfig = oServiceEditor.AddConfig(intService, intField, intWM, txtQuestion.Text, -1, Int32.Parse(txtWidth.Text), Int32.Parse(txtRows.Text), -1, -1, -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", intOrder, 1);
                    break;

                case "USERS":
                case "SERVERS":
                case "MNEMONICS":
                case "APPROVER":
                    intConfig = oServiceEditor.AddConfig(intService, intField, intWM, txtQuestion.Text, -1, Int32.Parse(txtWidth.Text), Int32.Parse(txtRows.Text), -1, -1, -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", intOrder, 1);
                    break;

                case "CHECKBOX":
                    intConfig = oServiceEditor.AddConfig(intService, intField, intWM, txtQuestion.Text, -1, -1, -1, (radCheckYes.Checked ? 1 : 0), -1, -1, txtTip.Text, 0, "", "", "", intOrder, 1);
                    break;

                case "CHECKLIST":
                    intConfig = oServiceEditor.AddConfig(intService, intField, intWM, txtQuestion.Text, 1, -1, -1, -1, (radDirectionH.Checked ? 1 : 0), -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", intOrder, 1);
                    break;

                case "DROPDOWN":
                    intConfig = oServiceEditor.AddConfig(intService, intField, intWM, txtQuestion.Text, -1, Int32.Parse(txtWidth.Text), 0, -1, -1, -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", intOrder, 1);
                    break;

                case "RADIOLIST":
                    intConfig = oServiceEditor.AddConfig(intService, intField, intWM, txtQuestion.Text, 1, -1, -1, -1, (radDirectionH.Checked ? 1 : 0), -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", intOrder, 1);
                    break;

                case "LISTBOX":
                    intConfig = oServiceEditor.AddConfig(intService, intField, intWM, txtQuestion.Text, -1, Int32.Parse(txtWidth.Text), Int32.Parse(txtRows.Text), -1, -1, (radMultipleYes.Checked ? 1 : 0), txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", intOrder, 1);
                    break;

                case "LIST":
                case "SERVERLIST":
                    intConfig = oServiceEditor.AddConfig(intService, intField, intWM, txtQuestion.Text, Int32.Parse(txtLength.Text), Int32.Parse(txtWidth.Text), Int32.Parse(txtRows.Text), -1, -1, -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", intOrder, 1);
                    break;

                case "HYPERLINK":
                    intConfig = oServiceEditor.AddConfig(intService, intField, intWM, txtQuestion.Text, -1, Int32.Parse(txtWidth.Text), -1, -1, -1, -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", intOrder, 1);
                    break;

                case "FILEUPLOAD":
                    intConfig = oServiceEditor.AddConfig(intService, intField, intWM, txtQuestion.Text, -1, Int32.Parse(txtWidth.Text), -1, -1, -1, -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", intOrder, 1);
                    break;

                case "DISCLAIMER":
                    intConfig = oServiceEditor.AddConfig(intService, intField, intWM, txtQuestion.Text, -1, -1, -1, -1, -1, -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, txtURL.Text, txtText.Text, intOrder, 1);
                    break;

                case "LOCATION":
                    intConfig = oServiceEditor.AddConfig(intService, intField, intWM, txtQuestion.Text, -1, Int32.Parse(ddlLocation.SelectedItem.Value), -1, -1, -1, -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", intOrder, 1);
                    break;
                }
            }
            else
            {
                switch (strCode.ToUpper())
                {
                case "DATE":
                    oServiceEditor.UpdateConfig(intConfig, intWM, txtQuestion.Text, -1, Int32.Parse(txtMinimum.Text), Int32.Parse(txtMaximum.Text), -1, -1, -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", 1);
                    break;

                case "TEXTBOX":
                    oServiceEditor.UpdateConfig(intConfig, intWM, txtQuestion.Text, Int32.Parse(txtLength.Text), Int32.Parse(txtWidth.Text), -1, -1, -1, -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", 1);
                    break;

                case "TEXTAREA":
                    oServiceEditor.UpdateConfig(intConfig, intWM, txtQuestion.Text, -1, Int32.Parse(txtWidth.Text), Int32.Parse(txtRows.Text), -1, -1, -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", 1);
                    break;

                case "USERS":
                case "SERVERS":
                case "MNEMONICS":
                case "APPROVER":
                    oServiceEditor.UpdateConfig(intConfig, intWM, txtQuestion.Text, -1, Int32.Parse(txtWidth.Text), Int32.Parse(txtRows.Text), -1, -1, -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", 1);
                    break;

                case "CHECKBOX":
                    oServiceEditor.UpdateConfig(intConfig, intWM, txtQuestion.Text, -1, -1, -1, (radCheckYes.Checked ? 1 : 0), -1, -1, txtTip.Text, 0, "", "", "", 1);
                    break;

                case "CHECKLIST":
                    oServiceEditor.UpdateConfig(intConfig, intWM, txtQuestion.Text, 1, -1, -1, -1, (radDirectionH.Checked ? 1 : 0), -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", 1);
                    break;

                case "DROPDOWN":
                    oServiceEditor.UpdateConfig(intConfig, intWM, txtQuestion.Text, -1, Int32.Parse(txtWidth.Text), 0, -1, -1, -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", 1);
                    break;

                case "RADIOLIST":
                    oServiceEditor.UpdateConfig(intConfig, intWM, txtQuestion.Text, 1, -1, -1, -1, (radDirectionH.Checked ? 1 : 0), -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", 1);
                    break;

                case "LISTBOX":
                    oServiceEditor.UpdateConfig(intConfig, intWM, txtQuestion.Text, -1, Int32.Parse(txtWidth.Text), Int32.Parse(txtRows.Text), -1, -1, (radMultipleYes.Checked ? 1 : 0), txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", 1);
                    break;

                case "LIST":
                case "SERVERLIST":
                    oServiceEditor.UpdateConfig(intConfig, intWM, txtQuestion.Text, Int32.Parse(txtLength.Text), Int32.Parse(txtWidth.Text), Int32.Parse(txtRows.Text), -1, -1, -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", 1);
                    break;

                case "HYPERLINK":
                    oServiceEditor.UpdateConfig(intConfig, intWM, txtQuestion.Text, -1, Int32.Parse(txtWidth.Text), -1, -1, -1, -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", 1);
                    break;

                case "FILEUPLOAD":
                    oServiceEditor.UpdateConfig(intConfig, intWM, txtQuestion.Text, -1, Int32.Parse(txtWidth.Text), -1, -1, -1, -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", 1);
                    break;

                case "DISCLAIMER":
                    oServiceEditor.UpdateConfig(intConfig, intWM, txtQuestion.Text, -1, -1, -1, -1, -1, -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, txtURL.Text, txtText.Text, 1);
                    break;

                case "LOCATION":
                    oServiceEditor.UpdateConfig(intConfig, intWM, txtQuestion.Text, -1, Int32.Parse(ddlLocation.SelectedItem.Value), -1, -1, -1, -1, txtTip.Text, (radRequiredYes.Checked ? 1 : 0), txtRequired.Text, "", "", 1);
                    break;
                }
            }

            //oServiceEditor.DeleteConfigValues(intConfig);
            List <int> lstValues = new List <int>();

            string[] strValues = Request.Form[hdnValues.UniqueID].Split(new char[] { ';' });
            DataSet  dsValues  = oServiceEditor.GetConfigValues(intConfig);

            for (int ii = 0; ii < strValues.Length; ii++)
            {
                if (strValues[ii] != "")
                {
                    // Loop through the values
                    int intValue = 0;
                    foreach (DataRow drValue in dsValues.Tables[0].Rows)
                    {
                        // Try to find matching, existing value
                        if (drValue["value"].ToString() == strValues[ii])
                        {
                            intValue = Int32.Parse(drValue["id"].ToString());
                            break;
                        }
                    }
                    if (intValue > 0)
                    {
                        // If match found, update with new order
                        lstValues.Add(intValue);
                        oServiceEditor.UpdateConfigValue(intValue, ii + 1);
                    }
                    else
                    {
                        // No match, add
                        oServiceEditor.AddConfigValue(intConfig, strValues[ii], ii + 1);
                    }
                }
            }
            // Delete the ones that were not added or selected
            foreach (DataRow drValue in dsValues.Tables[0].Rows)
            {
                int  intValue   = Int32.Parse(drValue["id"].ToString());
                bool boolDelete = true;
                // Try to find matching, existing value
                foreach (int intExists in lstValues)
                {
                    if (intExists == intValue)
                    {
                        boolDelete = false;
                        break;
                    }
                }
                if (boolDelete)
                {
                    oServiceEditor.DeleteConfigValue(intValue);
                }
            }

            /*
             * string strValues = Request.Form[hdnValues.UniqueID];
             * int intDisplay = 0;
             * while (strValues != "")
             * {
             *  intDisplay++;
             *  string strValue = strValues.Substring(0, strValues.IndexOf(";"));
             *  strValues = strValues.Substring(strValues.IndexOf(";") + 1);
             *  oServiceEditor.AddConfigValue(intConfig, strValue, intDisplay);
             * }
             */
            // Check Workload Manager Flag
            if (intWMFlag == 0 && intWM.ToString() != chkWrite.ToolTip.ToString())
            {
                int intDBField_Read = 0;
                Int32.TryParse(oServiceEditor.GetConfig(intConfig, "dbfield"), out intDBField_Read);
                if (intDBField_Read > 0)
                {
                    // A modification was made (either add or remove)
                    if (intWM == 1)
                    {
                        oServiceEditor.AddConfigWorkflowShared(intDBField_Read);
                    }
                    else
                    {
                        oServiceEditor.DeleteConfigWorkflowShared(intDBField_Read);
                    }
                }
            }
            oServiceEditor.AlterTable(intService);
            Response.Redirect(Request.Path + "?save=true");
        }
        private StringBuilder LoadWorkflowForm(int _serviceid, int _previous_serviceid, int _children, bool _first)
        {
            StringBuilder strReturn = new StringBuilder();

            strReturn.Append("<table width=\"350\" cellpadding=\"4\" cellspacing=\"0\" border=\"0\" style=\"border:dotted 1px #999\">");
            strReturn.Append("<tr><td colspan=\"3\" class=\"box_blue header\">");
            strReturn.Append(oService.GetName(_serviceid));
            strReturn.Append("</td></tr>");

            // From
            if (_first == false)
            {
                strReturn.Append("<tr><td colspan=\"3\" align=\"right\" class=\"smalldefault\">");
                strReturn.Append(oService.GetName(_previous_serviceid));
                strReturn.Append("</td></tr>");
            }

            // Conditions
            bool    boolConditional = false;
            DataSet dsConditions    = oServiceEditor.GetWorkflowConditions(_previous_serviceid, _serviceid, 1);

            if (dsConditions.Tables[0].Rows.Count > 0)
            {
                boolConditional = true;
                if (oService.GetWorkflow(_previous_serviceid, _serviceid, "only") == "1")
                {
                    strReturn.Append("<tr><td colspan=\"3\" class=\"redbold\">Initiate ONLY when:</td></tr>");
                }
                else if (oService.GetWorkflow(_previous_serviceid, _serviceid, "only") == "0")
                {
                    strReturn.Append("<tr><td colspan=\"3\" class=\"redbold\">Always initiate UNLESS:</td></tr>");
                }
                else
                {
                    boolConditional = false;
                }

                if (boolConditional)
                {
                    for (int cc = 0; cc < dsConditions.Tables[0].Rows.Count; cc++)
                    {
                        DataSet dsConditionValues = oServiceEditor.GetWorkflowConditionValues(Int32.Parse(dsConditions.Tables[0].Rows[cc]["id"].ToString()), 0, 0);
                        if (dsConditionValues.Tables[0].Rows.Count > 0)
                        {
                            if (cc > 0)
                            {
                                strReturn.Append("<tr><td></td><td colspan=\"2\" class=\"redbold\"> -- -- -- OR -- -- -- </td></tr>");
                            }
                            strReturn.Append("<tr><td></td><td colspan=\"2\">");
                            for (int vv = 0; vv < dsConditionValues.Tables[0].Rows.Count; vv++)
                            {
                                if (vv > 0)
                                {
                                    strReturn.Append(" <b>and</b> ");
                                }
                                strReturn.Append(dsConditionValues.Tables[0].Rows[vv]["question"].ToString());
                                strReturn.Append(" = &quot;");
                                strReturn.Append(dsConditionValues.Tables[0].Rows[vv]["value"].ToString());
                                strReturn.Append("&quot;<br/>");
                            }
                            strReturn.Append("</td></tr>");
                        }
                    }
                }
            }

            // Managers
            int intWorkflowServiceID = 0;

            if (Int32.TryParse(oService.Get(_serviceid, "workflow_userid"), out intWorkflowServiceID) == true && intWorkflowServiceID > 0)
            {
                strReturn.Append("<tr><td colspan=\"3\" class=\"greenbold\">" + (boolConditional ? "<br/>" : "") + "<b>Assign To (Service):</td></tr>");
                strReturn.Append("<tr><td></td><td colspan=\"2\">");
                strReturn.Append(oService.GetName(intWorkflowServiceID));
                strReturn.Append("</td></tr>");
            }
            else
            {
                DataSet dsTechnicians = oService.GetUser(_serviceid, 0);
                if (dsTechnicians.Tables[0].Rows.Count > 0)
                {
                    strReturn.Append("<tr><td colspan=\"3\" class=\"greenbold\">" + (boolConditional ? "<br/>" : "") + "<b>Assign To (Technician):</td></tr>");
                    foreach (DataRow drTechnician in dsTechnicians.Tables[0].Rows)
                    {
                        strReturn.Append("<tr><td></td><td colspan=\"2\">");
                        strReturn.Append(oUser.GetFullName(Int32.Parse(drTechnician["userid"].ToString())));
                        strReturn.Append("</td></tr>");
                    }
                }
                else
                {
                    strReturn.Append("<tr><td colspan=\"3\" class=\"greenbold\">" + (boolConditional ? "<br/>" : "") + "<b>Assign By:</td></tr>");
                    DataSet dsManagers = oService.GetUser(_serviceid, 1);
                    foreach (DataRow drManager in dsManagers.Tables[0].Rows)
                    {
                        strReturn.Append("<tr><td></td><td colspan=\"2\">");
                        strReturn.Append(oUser.GetFullName(Int32.Parse(drManager["userid"].ToString())));
                        strReturn.Append("</td></tr>");
                    }
                }
            }

            if (_first)
            {
                DataSet dsSR = oServiceEditor.GetConfigs(_serviceid, 0, 1);    // Original Request Details
                strReturn.Append("<tr><td colspan=\"3\"><br/><b>Service Request Questions:</b></td></tr>");
                foreach (DataRow drSR in dsSR.Tables[0].Rows)
                {
                    strReturn.Append("<tr><td nowrap valign=\"top\" nowrap><img src=\"/images/help.gif\" border=\"0\"/></td><td colspan=\"2\" width=\"100%\">");
                    strReturn.Append(drSR["question"].ToString() + "<br/>");
                    strReturn.Append("</td></tr>");

                    DataSet dsConfigs = oServiceEditor.GetConfigValues(Int32.Parse(drSR["id"].ToString()));
                    foreach (DataRow drConfig in dsConfigs.Tables[0].Rows)
                    {
                        strReturn.Append("<tr><td></td><td valign=\"top\" nowrap>-</td><td width=\"100%\">");
                        strReturn.Append(drConfig["value"].ToString() + "<br/>");
                        strReturn.Append("</td></tr>");
                    }
                }
            }

            // Workload Manager
            DataSet  dsWM = oServiceEditor.GetConfigs(_serviceid, 1, 1);
            DataView dvWM = dsWM.Tables[0].DefaultView;

            dvWM.Sort = "wm ASC";
            strReturn.Append("<tr><td colspan=\"3\"><br/><b>Workload Manager Fields:</b></td></tr>");
            foreach (DataRowView drWM in dvWM)
            {
                bool boolWM        = (drWM["wm"].ToString() == "1");
                bool boolInherited = (drWM["inherited"].ToString() == "1");
                strReturn.Append("<tr>");
                if (boolInherited)
                {
                    strReturn.Append("<td nowrap valign=\"top\" nowrap><img src=\"/images/hand_right.gif\" border=\"0\"/></td><td colspan=\"2\" width=\"100%\">");
                }
                else
                {
                    strReturn.Append("<td nowrap valign=\"top\" nowrap><img src=\"/images/help.gif\" border=\"0\"/></td><td colspan=\"2\" width=\"100%\">");
                }
                //strReturn.Append(boolWM ? "" : "<i>");
                //strReturn.Append(boolInherited ? "<span class=\"component_unavailable\">" : "");
                strReturn.Append(drWM["question"].ToString());
                //strReturn.Append(boolInherited ? "</span>" : "");
                //strReturn.Append(boolWM ? "" : "</i>");
                strReturn.Append("</td></tr>");

                DataSet dsConfigs = oServiceEditor.GetConfigValues(Int32.Parse(drWM["id"].ToString()));
                foreach (DataRow drConfig in dsConfigs.Tables[0].Rows)
                {
                    if (boolInherited)
                    {
                        strReturn.Append("<tr><td></td><td valign=\"top\" nowrap>-&gt;</td><td width=\"100%\">");
                    }
                    else
                    {
                        strReturn.Append("<tr><td></td><td valign=\"top\" nowrap>-</td><td width=\"100%\">");
                    }
                    //strReturn.Append(boolInherited ? "<span class=\"component_unavailable\">" : "");
                    strReturn.Append(drConfig["value"].ToString() + "<br/>");
                    //strReturn.Append(boolInherited ? "</span>" : "");
                    strReturn.Append("</td></tr>");
                }
            }

            strReturn.Append("</table><br/>");
            return(strReturn);
        }