Esempio n. 1
0
        public string wmGetStep(string sStepID)
        {
            FunctionTemplates.HTMLTemplates ft = new FunctionTemplates.HTMLTemplates();
            acUI.acUI ui = new acUI.acUI();

            try
            {

                string sStepHTML = "";
                string sErr = "";

                if (!ui.IsGUID(sStepID))
                    throw new Exception("Unable to get step. Invalid or missing Step ID. [" + sStepID + "]" + sErr);

                string sUserID = ui.GetSessionUserID();

                DataRow dr = ft.GetSingleStep(sStepID, sUserID, ref sErr);
                if (dr != null && sErr == "")
                {
                    //embedded steps...
                    //if the step_order is -1 and the codeblock_name is a guid, this step is embedded
                    //within another step
                    if (dr["step_order"].ToString() == "-1" && ui.IsGUID(dr["codeblock_name"].ToString()))
                        sStepHTML += ft.DrawEmbeddedStep(dr);
                    else
                        sStepHTML += ft.DrawFullStep(dr);
                }
                else
                    sStepHTML += "<span class=\"red_text\">" + sErr + "</span>";

                //return the html
                return sStepHTML;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }