当前位置: 首页>>代码示例>>C#>>正文


C# dataAccess.sqlExecuteUpdate方法代码示例

本文整理汇总了C#中dataAccess.sqlExecuteUpdate方法的典型用法代码示例。如果您正苦于以下问题:C# dataAccess.sqlExecuteUpdate方法的具体用法?C# dataAccess.sqlExecuteUpdate怎么用?C# dataAccess.sqlExecuteUpdate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dataAccess的用法示例。


在下文中一共展示了dataAccess.sqlExecuteUpdate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: wmCreateEcotemplate

        public string wmCreateEcotemplate(string sName, string sDescription)
        {
            dataAccess dc = new dataAccess();
            acUI.acUI ui = new acUI.acUI();
            string sSQL = null;
            string sErr = null;

            try
            {
                sSQL = "select ecotemplate_name from ecotemplate where ecotemplate_name = '" + sName + "'";
                string sExists = "";
                if (!dc.sqlGetSingleString(ref sExists, sSQL, ref sErr))
                {
                    throw new Exception(sErr);
                }
                else
                {
                    if (!string.IsNullOrEmpty(sExists))
                    {
                        return "Eco Template exists - choose another name.";
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            try
            {
                string sNewID = ui.NewGUID();

                sSQL = "insert into ecotemplate (ecotemplate_id, ecotemplate_name, ecotemplate_desc)" +
                    " values ('" + sNewID + "'," +
                    " '" + sName + "'," +
                    (string.IsNullOrEmpty(sDescription) ? " null" : " '" + sDescription + "'") + ")";

                if (!dc.sqlExecuteUpdate(sSQL, ref sErr))
                    throw new Exception(sErr);

                ui.WriteObjectAddLog(acObjectTypes.Ecosystem, sNewID, sName, "Ecotemplate created.");

                return sNewID;
            }
            catch (Exception ex)
            {

                throw new Exception(ex.Message);
            }
        }
开发者ID:remotesyssupport,项目名称:cato,代码行数:50,代码来源:uiMethods.asmx.cs

示例2: wmAddStep

        public string wmAddStep(string sTaskID, string sCodeblockName, string sItem)
        {
            dataAccess dc = new dataAccess();
            FunctionTemplates.HTMLTemplates ft = new FunctionTemplates.HTMLTemplates();
            acUI.acUI ui = new acUI.acUI();

            try
            {
                string sUserID = ui.GetSessionUserID();

                string sStepHTML = "";
                string sErr = "";
                string sSQL = "";
                string sNewStepID = "";

                if (!ui.IsGUID(sTaskID))
                    throw new Exception("Unable to add step. Invalid or missing Task ID. [" + sTaskID + "]" + sErr);

                //now, the sItem variable may have a function name (if it's a new command)
                //or it may have a guid (if it's from the clipboard)

                //so, if it's a guid after stripping off the prefix, it's from the clipboard

                //the function has a fn_ or clip_ prefix on it from the HTML.  Strip it off.
                //FIX... test the string to see if it BEGINS with fn_ or clip_
                //IF SO... cut off the beginning... NOT a replace operation.
                if (sItem.StartsWith("fn_")) sItem = sItem.Remove(0, 3);
                if (sItem.StartsWith("clip_")) sItem = sItem.Remove(0, 5);

                //NOTE: !! yes we are adding the step with an order of -1
                //the update event on the client does not know the index at which it was dropped.
                //so, we have to insert it first to get the HTML... but the very next step
                //will serialize and update the entire sortable...
                //immediately replacing this -1 with the correct position

                if (ui.IsGUID(sItem))
                {
                    sNewStepID = sItem;

                    //copy from the clipboard (using the root_step_id to get ALL associated steps)
                    sSQL = "insert into task_step (step_id, task_id, codeblock_name, step_order, step_desc," +
                        " commented, locked, output_parse_type, output_row_delimiter, output_column_delimiter," +
                        " function_name, function_xml, variable_xml)" +
                        " select step_id, '" + sTaskID + "'," +
                        " case when codeblock_name is null then '" + sCodeblockName + "' else codeblock_name end," +
                        "-1,step_desc," +
                        "0,0,output_parse_type,output_row_delimiter,output_column_delimiter," +
                        "function_name,function_xml,variable_xml" +
                        " from task_step_clipboard" +
                        " where user_id = '" + sUserID + "'" +
                        " and root_step_id = '" + sItem + "'";

                    if (!dc.sqlExecuteUpdate(sSQL, ref sErr))
                        throw new Exception("Unable to add step." + sErr);

                    ui.WriteObjectChangeLog(Globals.acObjectTypes.Task, sTaskID, sItem,
                        "Added Command from Clipboard to Codeblock:" + sCodeblockName);
                }
                else
                {
                    //add a new command
                    sNewStepID = ui.NewGUID();

                    //NOTE: !! yes we are doing some command specific logic here.
                    //Certain commands have different 'default' values for delimiters, etc.
                    //sOPM: 0=none, 1=delimited, 2=parsed
                    string sOPM = "0";

                    switch (sItem)
                    {
                        case "sql_exec":
                            sOPM = "1";
                            break;
                        case "win_cmd":
                            sOPM = "1";
                            break;
                        case "dos_cmd":
                            sOPM = "2";
                            break;
                        case "cmd_line":
                            sOPM = "2";
                            break;
                        case "http":
                            sOPM = "2";
                            break;
                        case "parse_text":
                            sOPM = "2";
                            break;
                        case "read_file":
                            sOPM = "2";
                            break;
                    }

                    sSQL = "insert into task_step (step_id, task_id, codeblock_name, step_order," +
                        " commented, locked, output_parse_type, output_row_delimiter, output_column_delimiter," +
                        " function_name, function_xml)" +
                           " select '" + sNewStepID + "'," +
                           "'" + sTaskID + "'," +
                           (string.IsNullOrEmpty(sCodeblockName) ? "NULL" : "'" + sCodeblockName + "'") + "," +
                           "-1," +
//.........这里部分代码省略.........
开发者ID:remotesyssupport,项目名称:cato,代码行数:101,代码来源:taskMethods.asmx.cs

示例3: SaveKeyPair

        public static string SaveKeyPair(string sKeypairID, string sAccountID, string sName, string sPK, string sPP)
        {
            acUI.acUI ui = new acUI.acUI();

            if (string.IsNullOrEmpty(sName))
                return "KeyPair Name is Required.";

            //we encoded this in javascript before the ajax call.
            //the safest way to unencode it is to use the same javascript lib.
            //(sometimes the javascript and .net libs don't translate exactly, google it.)
            sPK = ui.unpackJSON(sPK);

            bool bUpdatePK = false;
            if (sPK != "-----BEGIN RSA PRIVATE KEY-----\n**********\n-----END RSA PRIVATE KEY-----")
            {

                //we want to make sure it's not just the placeholder, but DOES have the wrapper.
                //and 61 is the lenght of the wrapper with no content... effectively empty
                if (sPK.StartsWith("-----BEGIN RSA PRIVATE KEY-----\n") && sPK.EndsWith("\n-----END RSA PRIVATE KEY-----"))
                {
                    //now, is there truly something in it?
                    string sContent = sPK.Replace("-----BEGIN RSA PRIVATE KEY-----", "").Replace("-----END RSA PRIVATE KEY-----", "").Replace("\n", "");
                    if (sContent.Length > 0)
                        bUpdatePK = true;
                    else
                        return "Private Key contained within:<br />-----BEGIN RSA PRIVATE KEY-----<br />and<br />-----END RSA PRIVATE KEY-----<br />cannot be blank.";
                }
                else
                {
                    return "Private Key must be contained within:<br />-----BEGIN RSA PRIVATE KEY-----<br />and<br />-----END RSA PRIVATE KEY-----";
                }
            }

            bool bUpdatePP = false;
            if (sPP != "!2E4S6789O")
                bUpdatePP = true;

            //all good, keep going

            dataAccess dc = new dataAccess();
            string sSQL = null;
            string sErr = null;

            try
            {
                if (string.IsNullOrEmpty(sKeypairID))
                {
                    //empty id, it's a new one.
                    string sPKClause = "";
                    if (bUpdatePK)
                        sPKClause = "'" + dc.EnCrypt(sPK) + "'";

                    string sPPClause = "null";
                    if (bUpdatePP)
                        sPPClause = "'" + dc.EnCrypt(sPP) + "'";

                    sSQL = "insert into cloud_account_keypair (keypair_id, account_id, keypair_name, private_key, passphrase)" +
                        " values ('" + ui.NewGUID() + "'," +
                        "'" + sAccountID + "'," +
                        "'" + sName.Replace("'", "''") + "'," +
                        sPKClause + "," +
                        sPPClause +
                        ")";
                }
                else
                {
                    string sPKClause = "";
                    if (bUpdatePK)
                        sPKClause = ", private_key = '" + dc.EnCrypt(sPK) + "'";

                    string sPPClause = "";
                    if (bUpdatePP)
                        sPPClause = ", passphrase = '" + dc.EnCrypt(sPP) + "'";

                    sSQL = "update cloud_account_keypair set" +
                        " keypair_name = '" + sName.Replace("'", "''") + "'" +
                        sPKClause + sPPClause +
                        " where keypair_id = '" + sKeypairID + "'";
                }

                if (!dc.sqlExecuteUpdate(sSQL, ref sErr))
                    throw new Exception(sErr);

            }
            catch (Exception ex)
            {

                throw new Exception(ex.Message);
            }

            //// add security log
            //// since this is not handled as a page postback, theres no "Viewstate" settings
            //// so 2 options either we keep an original setting for each value in hid values, or just get them from the db as part of the
            //// update above, since we are already passing in 15 or so fields, lets just get the values at the start and reference them here
            //if (sMode == "edit")
            //{
            //    ui.WriteObjectChangeLog(Globals.acObjectTypes.CloudAccount, sAccountID, sAccountName, sOriginalName, sAccountName);
            //}
            //else
            //{
//.........这里部分代码省略.........
开发者ID:remotesyssupport,项目名称:cato,代码行数:101,代码来源:cloudAccountEdit.aspx.cs

示例4: wmUpdateTaskDetail

        public string wmUpdateTaskDetail(string sTaskID, string sColumn, string sValue)
        {
            dataAccess dc = new dataAccess();

            acUI.acUI ui = new acUI.acUI();

            try
            {
                string sUserID = ui.GetSessionUserID();

                if (ui.IsGUID(sTaskID) && ui.IsGUID(sUserID))
                {
                    string sErr = "";
                    string sSQL = "";

                    //we encoded this in javascript before the ajax call.
                    //the safest way to unencode it is to use the same javascript lib.
                    //(sometimes the javascript and .net libs don't translate exactly, google it.)
                    sValue = ui.unpackJSON(sValue);

                    string sOriginalTaskID = "";

                    sSQL = "select original_task_id from task where task_id = '" + sTaskID + "'";

                    if (!dc.sqlGetSingleString(ref sOriginalTaskID, sSQL, ref sErr))
                        throw new Exception("Unable to get original_task_id for [" + sTaskID + "]." + sErr);

                    if (sOriginalTaskID == "")
                        return "Unable to get original_task_id for [" + sTaskID + "].";

                    // bugzilla 1074, check for existing task_code and task_name
                    if (sColumn == "task_code" || sColumn == "task_name")
                    {
                        sSQL = "select task_id from task where " +
                                sColumn.Replace("'", "''") + "='" + sValue.Replace("'", "''") + "'" +
                                " and original_task_id <> '" + sOriginalTaskID + "'";

                        string sValueExists = "";
                        if (!dc.sqlGetSingleString(ref sValueExists, sSQL, ref sErr))
                            throw new Exception("Unable to check for existing names [" + sTaskID + "]." + sErr);

                        if (!string.IsNullOrEmpty(sValueExists))
                            return sValue + " exists, please choose another value.";
                    }

                    if (sColumn == "task_code" || sColumn == "task_name")
                    {
                        //changing the name or code updates ALL VERSIONS
                        string sSetClause = sColumn + "='" + sValue.Replace("'", "''") + "'";
                        sSQL = "update task set " + sSetClause + " where original_task_id = '" + sOriginalTaskID + "'";
                    }
                    else
                    {
                        string sSetClause = sColumn + "='" + sValue.Replace("'", "''") + "'";

                        //some columns on this table allow nulls... in their case an empty sValue is a null
                        if (sColumn == "concurrent_instances" || sColumn == "queue_depth")
                        {
                            if (sValue.Replace(" ", "").Length == 0)
                                sSetClause = sColumn + " = null";
                            else
                                sSetClause = sColumn + "='" + sValue.Replace("'", "''") + "'";
                        }

                        //some columns are checkboxes, so make sure it is a db appropriate value (1 or 0)
                        //some columns on this table allow nulls... in their case an empty sValue is a null
                        if (sColumn == "concurrent_by_asset")
                        {
                            if (dc.IsTrue(sValue))
                                sSetClause = sColumn + " = 1";
                            else
                                sSetClause = sColumn + " = 0";
                        }

                        sSQL = "update task set " + sSetClause + " where task_id = '" + sTaskID + "'";
                    }

                    if (!dc.sqlExecuteUpdate(sSQL, ref sErr))
                        throw new Exception("Unable to update task [" + sTaskID + "]." + sErr);

                    ui.WriteObjectChangeLog(Globals.acObjectTypes.Task, sTaskID, sColumn, sValue);
                }
                else
                {
                    throw new Exception("Unable to update task. Missing or invalid task [" + sTaskID + "] id.");
                }

            }
            catch (Exception ex)
            {
                throw ex;
            }
            return "";
        }
开发者ID:remotesyssupport,项目名称:cato,代码行数:94,代码来源:taskMethods.asmx.cs

示例5: AlsoCopyEmbeddedStepsToClipboard

        private void AlsoCopyEmbeddedStepsToClipboard(string sUserID, string sSourceStepID, string sRootStepID, string sNewParentStepID, ref string sErr)
        {
            dataAccess dc = new dataAccess();
            FunctionTemplates.HTMLTemplates ft = new FunctionTemplates.HTMLTemplates();
            acUI.acUI ui = new acUI.acUI();

            //get all the steps that have the calling stepid as a parent (codeblock)
            string sSQL = "select step_id" +
                " from task_step" +
                " where codeblock_name = '" + sSourceStepID + "'";

            DataTable dt = new DataTable();
            if (!dc.sqlGetDataTable(ref dt, sSQL, ref sErr))
                throw new Exception(sErr);

            foreach (DataRow dr in dt.Rows)
            {
                string sThisStepID = dr["step_id"].ToString();
                string sThisNewID = ui.NewGUID();

                //put them in the table
                sSQL = "delete from task_step_clipboard" +
                    " where user_id = '" + sUserID + "'" +
                    " and src_step_id = '" + sThisStepID + "'";
                if (!dc.sqlExecuteUpdate(sSQL, ref sErr))
                    throw new Exception("Unable to clean embedded steps of [" + sSourceStepID + "]." + sErr);

                sSQL = " insert into task_step_clipboard" +
                " (user_id, clip_dt, src_step_id, root_step_id, step_id, function_name, function_xml, step_desc," +
                " output_parse_type, output_row_delimiter, output_column_delimiter, variable_xml, codeblock_name)" +
                " select '" + sUserID + "', now(), step_id, '" + sRootStepID + "', '" + sThisNewID + "'," +
                " function_name, function_xml, step_desc," +
                " output_parse_type, output_row_delimiter, output_column_delimiter, variable_xml, '" + sNewParentStepID + "'" +
                " from task_step" +
                " where step_id = '" + sThisStepID + "'";

                if (!dc.sqlExecuteUpdate(sSQL, ref sErr))
                    throw new Exception("Unable to copy embedded steps of [" + sSourceStepID + "]." + sErr);

                //we need to update the "action" XML of the parent too...

                /*OK here's the deal..I'm out of time

                 This should not be hardcoded, it should be smart enough to find an XML node with a specific
                 value and update that node.

                 I just don't know enought about xpath to figure it out, and don't have time to do it before
                 I gotta start chilling at tmo.

                 So, I've hardcoded it to the known cases so it will work.

                 Add a new dynamic command type that has embedded steps, and this will probably no longer work.
                 */

                ft.SetNodeValueinXMLColumn("task_step_clipboard", "function_xml", "user_id = '" + sUserID + "'" +
                    " and step_id = '" + sNewParentStepID + "'", "//action[text() = '" + sThisStepID + "']", sThisNewID);

                ft.SetNodeValueinXMLColumn("task_step_clipboard", "function_xml", "user_id = '" + sUserID + "'" +
                    " and step_id = '" + sNewParentStepID + "'", "//else[text() = '" + sThisStepID + "']", sThisNewID);

                ft.SetNodeValueinXMLColumn("task_step_clipboard", "function_xml", "user_id = '" + sUserID + "'" +
                    " and step_id = '" + sNewParentStepID + "'", "//positive_action[text() = '" + sThisStepID + "']", sThisNewID);

                ft.SetNodeValueinXMLColumn("task_step_clipboard", "function_xml", "user_id = '" + sUserID + "'" +
                    " and step_id = '" + sNewParentStepID + "'", "//negative_action[text() = '" + sThisStepID + "']", sThisNewID);

                //END OF HARDCODED HACK

                // and check this one for children too
                AlsoCopyEmbeddedStepsToClipboard(sUserID, sThisStepID, sRootStepID, sThisNewID, ref sErr);
            }
        }
开发者ID:remotesyssupport,项目名称:cato,代码行数:72,代码来源:taskMethods.asmx.cs

示例6: wmSaveTaskUserSetting

        public void wmSaveTaskUserSetting(string sTaskID, string sSettingKey, string sSettingValue)
        {
            dataAccess dc = new dataAccess();

            acUI.acUI ui = new acUI.acUI();

            try
            {
                string sUserID = ui.GetSessionUserID();

                if (ui.IsGUID(sTaskID) && ui.IsGUID(sUserID))
                {
                    //1) get the settings
                    //2) update/add the appropriate value
                    //3) update the settings to the db

                    string sSettingXML = "";
                    string sErr = "";
                    string sSQL = "select settings_xml from users where user_id = '" + sUserID + "'";

                    if (!dc.sqlGetSingleString(ref sSettingXML, sSQL, ref sErr))
                    {
                        throw new Exception("Unable to get settings for user." + sErr);
                    }

                    if (sSettingXML == "")
                        sSettingXML = "<settings><debug><tasks></tasks></debug></settings>";

                    XDocument xDoc = XDocument.Parse(sSettingXML);
                    if (xDoc == null) throw new Exception("XML settings data for user is invalid.");

                    //we have to analyze the doc and see if the appropriate section exists.
                    //if not, we need to construct it
                    if (xDoc.Element("settings").Descendants("debug").Count() == 0)
                        xDoc.Element("settings").Add(new XElement("debug"));

                    if (xDoc.Element("settings").Element("debug").Descendants("tasks").Count() == 0)
                        xDoc.Element("settings").Element("debug").Add(new XElement("tasks"));

                    XElement xTasks = xDoc.Element("settings").Element("debug").Element("tasks");

                    //to search by attribute we must get back an array and we shouldn't have an array anyway
                    //so to be safe and clean, delete all matches and just add back the one we want
                    xTasks.Descendants("task").Where(
                        x => (string)x.Attribute("task_id") == sTaskID).Remove();

                    //add it
                    XElement xTask = new XElement("task");
                    xTask.Add(new XAttribute("task_id", sTaskID));
                    xTask.Add(new XAttribute(sSettingKey, sSettingValue));

                    xTasks.Add(xTask);

                    sSQL = "update users set settings_xml = '" + xDoc.ToString(SaveOptions.DisableFormatting) + "'" +
                        " where user_id = '" + sUserID + "'";
                    if (!dc.sqlExecuteUpdate(sSQL, ref sErr))
                    {
                        throw new Exception("Unable to save Task User Setting." + sErr);
                    }

                    return;
                }
                else
                {
                    throw new Exception("Unable to run task. Missing or invalid task [" + sTaskID + "] or unable to get current user.");
                }

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
开发者ID:remotesyssupport,项目名称:cato,代码行数:73,代码来源:taskMethods.asmx.cs

示例7: wmToggleStepCommonSection

        public void wmToggleStepCommonSection(string sStepID, string sButton)
        {
            dataAccess dc = new dataAccess();

            acUI.acUI ui = new acUI.acUI();

            try
            {
                if (ui.IsGUID(sStepID))
                {
                    string sUserID = ui.GetSessionUserID();

                    sButton = (sButton == "" ? "null" : "'" + sButton + "'");

                    string sErr = "";

                    //is there a row?
                    int iRowCount = 0;
                    dc.sqlGetSingleInteger(ref iRowCount, "select count(*) from task_step_user_settings" +
                                " where user_id = '" + sUserID + "'" +
                                " and step_id = '" + sStepID + "'", ref sErr);

                    if (iRowCount == 0)
                    {
                        string sSQL = "insert into task_step_user_settings" +
                            " (user_id, step_id, visible, breakpoint, skip, button)" +
                            " values ('" + sUserID + "','" + sStepID + "', 1, 0, 0, " + sButton + ")";
                        if (!dc.sqlExecuteUpdate(sSQL, ref sErr))
                            throw new Exception("Unable to toggle step button (0) [" + sStepID + "]." + sErr);
                    }
                    else
                    {
                        string sSQL = " update task_step_user_settings set button = " + sButton +
                            " where step_id = '" + sStepID + "';";
                        if (!dc.sqlExecuteUpdate(sSQL, ref sErr))
                            throw new Exception("Unable to toggle step button (1) [" + sStepID + "]." + sErr);
                    }

                    return;
                }
                else
                {
                    throw new Exception("Unable to toggle step button. Missing or invalid step_id or button.");
                }

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
开发者ID:remotesyssupport,项目名称:cato,代码行数:51,代码来源:taskMethods.asmx.cs

示例8: wmDeleteEcotemplates

        public string wmDeleteEcotemplates(string sDeleteArray)
        {
            dataAccess dc = new dataAccess();
            acUI.acUI ui = new acUI.acUI();
            string sSQL = null;
            string sErr = "";

            if (sDeleteArray.Length == 0)
                return "";

            try
            {
                sDeleteArray = ui.QuoteUp(sDeleteArray);

                //can't delete templates that have references...
                int iResults = 0;
                sSQL = "select count(*) from ecosystem where ecotemplate_id in (" + sDeleteArray.ToString() + ")";
                if (!dc.sqlGetSingleInteger(ref iResults, sSQL, ref sErr))
                    throw new Exception(sErr);

                if (iResults == 0)
                {
                    sSQL = "delete from ecotemplate_action where ecotemplate_id in (" + sDeleteArray.ToString() + ")";
                    if (!dc.sqlExecuteUpdate(sSQL, ref sErr))
                        throw new Exception(sErr);

                    sSQL = "delete from ecotemplate where ecotemplate_id in (" + sDeleteArray.ToString() + ")";
                    if (!dc.sqlExecuteUpdate(sSQL, ref sErr))
                        throw new Exception(sErr);

                    // if we made it here, so save the logs
                    ui.WriteObjectDeleteLog(acObjectTypes.EcoTemplate, "", "", "Eco Templates(s) Deleted [" + sDeleteArray.ToString() + "]");
                }
                else
                    sErr = "Unable to delete Ecosystem Template - " + iResults.ToString() + " Ecosystems reference it.";
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            return sErr;
        }
开发者ID:remotesyssupport,项目名称:cato,代码行数:43,代码来源:uiMethods.asmx.cs

示例9: wmDeleteSchedule

        public string wmDeleteSchedule(string sScheduleID)
        {
            dataAccess dc = new dataAccess();
            acUI.acUI ui = new acUI.acUI();
            string sSQL = null;
            string sErr = "";

            if (string.IsNullOrEmpty(sScheduleID))
                throw new Exception("Missing Schedule ID.");

            try
            {
                sSQL = "delete from action_plan where schedule_id = '" + sScheduleID + "'";
                if (!dc.sqlExecuteUpdate(sSQL, ref sErr))
                    throw new Exception(sErr);

                sSQL = "delete from action_schedule where schedule_id = '" + sScheduleID + "'";
                if (!dc.sqlExecuteUpdate(sSQL, ref sErr))
                    throw new Exception(sErr);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            // if we made it here, so save the logs
            ui.WriteObjectDeleteLog(acObjectTypes.EcoTemplate, "", "", "Schedule [" + sScheduleID + "] deleted.");

            return sErr;
        }
开发者ID:remotesyssupport,项目名称:cato,代码行数:30,代码来源:uiMethods.asmx.cs

示例10: wmDeleteEcosystems

        public string wmDeleteEcosystems(string sDeleteArray)
        {
            dataAccess dc = new dataAccess();
            acUI.acUI ui = new acUI.acUI();
            string sSQL = null;
            string sErr = "";

            if (sDeleteArray.Length == 0)
                return "";

            sDeleteArray = ui.QuoteUp(sDeleteArray);

            try
            {
                sSQL = "delete from ecosystem_object where ecosystem_id in (" + sDeleteArray.ToString() + ")";
                if (!dc.sqlExecuteUpdate(sSQL, ref sErr))
                    throw new Exception(sErr);

                sSQL = "delete from ecosystem where ecosystem_id in (" + sDeleteArray.ToString() + ")";
                if (!dc.sqlExecuteUpdate(sSQL, ref sErr))
                    throw new Exception(sErr);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            // if we made it here, so save the logs
            ui.WriteObjectDeleteLog(acObjectTypes.Ecosystem, "", "", "Ecosystems(s) Deleted [" + sDeleteArray.ToString() + "]");

            return sErr;
        }
开发者ID:remotesyssupport,项目名称:cato,代码行数:32,代码来源:uiMethods.asmx.cs

示例11: wmDeleteEcotemplateAction

        public string wmDeleteEcotemplateAction(string sActionID)
        {
            dataAccess dc = new dataAccess();
            acUI.acUI ui = new acUI.acUI();
            string sSQL = null;
            string sErr = "";

            if (sActionID.Length == 0)
                return "";

            try
            {
                sSQL = "delete from ecotemplate_action" +
                    " where action_id ='" + sActionID + "'";

                if (!dc.sqlExecuteUpdate(sSQL, ref sErr))
                    throw new Exception(sErr);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            // if we made it here, so save the logs
            ui.WriteObjectDeleteLog(acObjectTypes.EcoTemplate, "", "", "Action [" + sActionID + "] removed from EcoTemplate.");

            return sErr;
        }
开发者ID:remotesyssupport,项目名称:cato,代码行数:28,代码来源:uiMethods.asmx.cs

示例12: wmDeleteEcosystemObject

        public string wmDeleteEcosystemObject(string sEcosystemID, string sObjectType, string sObjectID)
        {
            dataAccess dc = new dataAccess();
            acUI.acUI ui = new acUI.acUI();
            string sSQL = null;
            string sErr = "";

            if (sObjectID.Length == 0)
                return "";

            try
            {
                sSQL = "delete from ecosystem_object" +
                    " where ecosystem_id ='" + sEcosystemID + "'" +
                    " and ecosystem_object_id ='" + sObjectID + "'" +
                    " and ecosystem_object_type ='" + sObjectType + "'";

                if (!dc.sqlExecuteUpdate(sSQL, ref sErr))
                    throw new Exception(sErr);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            // if we made it here, so save the logs
            ui.WriteObjectDeleteLog(acObjectTypes.Ecosystem, "", "", "Object [" + sObjectID + "] removed from Ecosystem [" + sEcosystemID + "]");

            return sErr;
        }
开发者ID:remotesyssupport,项目名称:cato,代码行数:30,代码来源:uiMethods.asmx.cs

示例13: wmDeleteActionPlan

        public string wmDeleteActionPlan(int iPlanID)
        {
            dataAccess dc = new dataAccess();
            acUI.acUI ui = new acUI.acUI();
            string sSQL = null;
            string sErr = "";

            if (iPlanID < 1)
                throw new Exception("Missing Action Plan ID.");

            try
            {
                sSQL = "delete from action_plan where plan_id = " + iPlanID.ToString();

                if (!dc.sqlExecuteUpdate(sSQL, ref sErr))
                    throw new Exception(sErr);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            // if we made it here, so save the logs
            ui.WriteObjectDeleteLog(acObjectTypes.EcoTemplate, "", "", "Action Plan [" + iPlanID.ToString() + "] deleted.");

            return sErr;
        }
开发者ID:remotesyssupport,项目名称:cato,代码行数:27,代码来源:uiMethods.asmx.cs

示例14: wmCreateTag

        public string wmCreateTag(string sTagName, string sDescription)
        {
            dataAccess dc = new dataAccess();
            acUI.acUI ui = new acUI.acUI();
            string sSQL = null;
            string sErr = null;

            try
            {
                sSQL = "select tag_name from lu_tags where tag_name = '" + sTagName + "'";
                string sTagExists = "";
                if (!dc.sqlGetSingleString(ref sTagExists, sSQL, ref sErr))
                {
                    throw new Exception(sErr);
                }
                else
                {
                    if (!string.IsNullOrEmpty(sTagExists))
                    {
                        return "Tag exists - choose another name.";
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            try
            {
                sSQL = "insert into lu_tags (tag_name, tag_desc)" +
                    " values ('" + sTagName + "'," +
                    "'" + sDescription + "')";

                if (!dc.sqlExecuteUpdate(sSQL, ref sErr))
                    throw new Exception(sErr);

                ui.WriteObjectAddLog(acObjectTypes.None, sTagName, sTagName, "Tag created.");
            }
            catch (Exception ex)
            {

                throw new Exception(ex.Message);
            }

            // no errors to here, so return an empty string
            return "";
        }
开发者ID:remotesyssupport,项目名称:cato,代码行数:48,代码来源:uiMethods.asmx.cs

示例15: wmReorderSteps

        public string wmReorderSteps(string sSteps)
        {
            dataAccess dc = new dataAccess();

            try
            {
                int i = 0;

                string[] aSteps = sSteps.Split(',');
                for (i = 0; i <= aSteps.Length - 1; i++)
                {
                    string sErr = "";
                    string sSQL = "update task_step" +
                            " set step_order = " + (i + 1) +
                            " where step_id = '" + aSteps[i] + "'";

                    //there will be no sSQL if there were no steps, so just skip it.
                    if (!string.IsNullOrEmpty(sSQL))
                    {
                        if (!dc.sqlExecuteUpdate(sSQL, ref sErr))
                        {
                            throw new Exception("Unable to update steps." + sErr);
                        }
                    }
                }

                //System.Threading.Thread.Sleep(2000);
                return "";
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
开发者ID:remotesyssupport,项目名称:cato,代码行数:34,代码来源:taskMethods.asmx.cs


注:本文中的dataAccess.sqlExecuteUpdate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。