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


C# acUI.acUI.GetSelectedCloudAccountID方法代码示例

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


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

示例1: wmCreateEcosystem

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

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

            try
            {
                string sNewID = ui.NewGUID();
                string sCloudAccountID = ui.GetSelectedCloudAccountID();

                if (string.IsNullOrEmpty(sCloudAccountID))
                    return "Unable to create - No Cloud Account selected.";
                if (string.IsNullOrEmpty(sEcotemplateID))
                    return "Unable to create - An Ecosystem Template is required..";

                sSQL = "insert into ecosystem (ecosystem_id, ecosystem_name, ecosystem_desc, account_id, ecotemplate_id)" +
                    " values ('" + sNewID + "'," +
                    " '" + sName + "'," +
                    (string.IsNullOrEmpty(sDescription) ? " null" : " '" + sDescription + "'") + "," +
                    " '" + sCloudAccountID + "'," +
                    " '" + sEcotemplateID + "'" +
                    ")";

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

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

                return sNewID;
            }
            catch (Exception ex)
            {

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

示例2: wmRunRepeatedly

        public void wmRunRepeatedly(string sTaskID, string sActionID, string sEcosystemID,
            string sMonths, string sDays, string sHours, string sMinutes, string sDaysOrWeeks,
            string sParameterXML, int iDebugLevel)
        {
            acUI.acUI ui = new acUI.acUI();

            try
            {
                string sCloudAccountID = ui.GetSelectedCloudAccountID();

                if (sTaskID.Length == 0 || sMonths.Length == 0 || sDays.Length == 0 || sHours.Length == 0 || sMinutes.Length == 0 || sDaysOrWeeks.Length == 0)
                    throw new Exception("Missing or invalid Schedule timing or Task ID.");

                //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.)
                sParameterXML = ui.unpackJSON(sParameterXML).Replace("'", "''");

                //we gotta peek into the XML and encrypt any newly keyed values
                PrepareAndEncryptParameterXML(ref sParameterXML);

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

                //figure out a label and a description
                string sDesc = "";
                string sLabel = wmGenerateScheduleLabel(sMonths, sDays, sHours, sMinutes, sDaysOrWeeks, ref sDesc);

                sSQL = "insert into action_schedule (schedule_id, task_id, action_id, ecosystem_id, account_id," +
                    " months, days, hours, minutes, days_or_weeks, label, descr, parameter_xml, debug_level)" +
                   	" values (" +
                    " '" + ui.NewGUID() + "'," +
                    " '" + sTaskID + "'," +
                    (!string.IsNullOrEmpty(sActionID) ? " '" + sActionID + "'" : "''") + "," +
                    (!string.IsNullOrEmpty(sEcosystemID) ? " '" + sEcosystemID + "'" : "''") + "," +
                    (!string.IsNullOrEmpty(sCloudAccountID) ? " '" + sCloudAccountID + "'" : "''") + "," +
                    " '" + sMonths + "'," +
                    " '" + sDays + "'," +
                    " '" + sHours + "'," +
                    " '" + sMinutes + "'," +
                    " '" + sDaysOrWeeks + "'," +
                    (!string.IsNullOrEmpty(sLabel) ? " '" + sLabel + "'" : "null") + "," +
                    (!string.IsNullOrEmpty(sDesc) ? " '" + sDesc + "'" : "null") + "," +
                    (!string.IsNullOrEmpty(sParameterXML) ? " '" + sParameterXML + "'" : "null") + "," +
                    (iDebugLevel > -1 ? iDebugLevel.ToString() : "null") +
                    ")";

                if (!dc.sqlExecuteUpdate(sSQL, ref sErr)) { throw new Exception(sErr); }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
开发者ID:remotesyssupport,项目名称:cato,代码行数:55,代码来源:uiMethods.asmx.cs

示例3: wmGetEcotemplateEcosystems

        public string wmGetEcotemplateEcosystems(string sEcoTemplateID)
        {
            dataAccess dc = new dataAccess();
            acUI.acUI ui = new acUI.acUI();

            string sSQL = null;
            string sErr = null;

            string sHTML = "";

            try
            {
                if (!string.IsNullOrEmpty(sEcoTemplateID))
                {
                    sSQL = "select ecosystem_id, ecosystem_name, ecosystem_desc" +
                        " from ecosystem" +
                        " where ecotemplate_id = '" + sEcoTemplateID + "'" +
                        " and account_id = '" + ui.GetSelectedCloudAccountID() + "'" +
                        " order by ecosystem_name";

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

                    if (dt.Rows.Count > 0)
                    {
                        sHTML += "<ul>";

                        foreach (DataRow dr in dt.Rows)
                        {
                            string sEcosystemID = dr["ecosystem_id"].ToString();
                            string sEcosystemName = dr["ecosystem_name"].ToString();
                            string sDesc = dr["ecosystem_desc"].ToString().Replace("\"", "").Replace("'", "");

                            sHTML += "<li class=\"ui-widget-content ui-corner-all\"" +
                                " ecosystem_id=\"" + sEcosystemID + "\"" +
                                "\">";
                            sHTML += "<div class=\"step_header_title ecosystem_name pointer\">" + sEcosystemName + "</div>";

                            sHTML += "<div class=\"step_header_icons\">";

                            //if there's a description, show a tooltip
                            if (!string.IsNullOrEmpty(sDesc))
                                sHTML += "<img src=\"../images/icons/info.png\" class=\"ecosystem_tooltip trans50\" title=\"" + sDesc + "\" />";

                            sHTML += "</div>";
                            sHTML += "<div class=\"clearfloat\"></div>";
                            sHTML += "</li>";
                        }

                        sHTML += "</ul>";
                    }
                }
                else
                {
                    throw new Exception("Unable to get Ecosystems - Missing EcoTemplate ID");
                }

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

示例4: wmRunLater

        public void wmRunLater(string sTaskID, string sActionID, string sEcosystemID, string sRunOn, string sParameterXML, int iDebugLevel)
        {
            acUI.acUI ui = new acUI.acUI();
            dataAccess dc = new dataAccess();

            try
            {
             				string sCloudAccountID = ui.GetSelectedCloudAccountID();

                if (sTaskID.Length == 0 || sRunOn.Length == 0)
                    throw new Exception("Missing Action Plan date or Task ID.");

                //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.)
                sParameterXML = ui.unpackJSON(sParameterXML).Replace("'", "''");

                //we gotta peek into the XML and encrypt any newly keyed values
                PrepareAndEncryptParameterXML(ref sParameterXML);

                string sSQL = null;
                string sErr = null;

                sSQL = "insert into action_plan (task_id, action_id, ecosystem_id, account_id," +
                    " run_on_dt, parameter_xml, debug_level, source)" +
                    " values (" +
                    " '" + sTaskID + "'," +
                    (!string.IsNullOrEmpty(sActionID) ? " '" + sActionID + "'" : "''") + "," +
                    (!string.IsNullOrEmpty(sEcosystemID) ? " '" + sEcosystemID + "'" : "''") + "," +
                    (!string.IsNullOrEmpty(sCloudAccountID) ? " '" + sCloudAccountID + "'" : "''") + "," +
                    " str_to_date('" + sRunOn + "', '%m/%d/%Y %H:%i')," +
                    (!string.IsNullOrEmpty(sParameterXML) ? " '" + sParameterXML + "'" : "null") + "," +
                    (iDebugLevel > -1 ? iDebugLevel.ToString() : "null") + "," +
                    " 'manual'" +
                    ")";

                if (!dc.sqlExecuteUpdate(sSQL, ref sErr)) { throw new Exception(sErr); }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
开发者ID:remotesyssupport,项目名称:cato,代码行数:43,代码来源:uiMethods.asmx.cs

示例5: GetAssociatedEcosystems

        private static void GetAssociatedEcosystems(ref DataTable dt, string sObjectType)
        {
            dataAccess dc = new dataAccess();
            acUI.acUI ui = new acUI.acUI();
            string sErr = "";

            if (dt.Rows.Count > 0)
            {
                //we'll add a column to the output data table
                dt.Columns.Add("Ecosystems");

                //ok, we have some results from AWS.  Let's see if any of them are tied to a ecosystem and if so... note it...
                //spin the AWS results

                //what's in the ecosystem_object table already?
                //get all the ecosystem objects into a table so we can merge it as needed...
                //get the actual rows
                //but only from the selected cloud account
                DataTable dtEcosystemObjects = new DataTable();
                string sSQL = "select do.ecosystem_object_id, d.ecosystem_id, d.ecosystem_name" +
                    " from ecosystem_object do" +
                    " join ecosystem d on do.ecosystem_id = d.ecosystem_id" +
                    " where d.account_id = '" + ui.GetSelectedCloudAccountID() + "'" +
                    " and do.ecosystem_object_type = '" + sObjectType + "'" +
                    " order by do.ecosystem_object_id";

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

                foreach (DataRow dr in dt.Rows)
                {
                    if (!string.IsNullOrEmpty(dr[0].ToString()))
                    {
                        string sResultList = "";

                        //aggregate all the id column values into one string
                        string sObjectID = ""; //Possibly a composite of several properties.
                        foreach (DataColumn col in dt.Columns)
                        {
                            if (col.ExtendedProperties["IsID"] != null)
                                sObjectID += dr[col.ColumnName].ToString();
                        }

                        //are there any ecosystem objects?
                        if (dtEcosystemObjects != null)
                        {
                            if (dtEcosystemObjects.Rows.Count > 0)
                            {
                                //make an array of any that match
                                DataRow[] drMatches;
                                drMatches = dtEcosystemObjects.Select("ecosystem_object_id = '" + sObjectID + "'");

                                //spin that array and add the names to a string
                                foreach (DataRow drMatch in drMatches)
                                {
                                    string sLink = " <span class=\"ecosystem_link pointer\" ecosystem_id=\"" + drMatch["ecosystem_id"].ToString() + "\">" + drMatch["ecosystem_name"].ToString() + "</span>";
                                    sResultList += (sResultList == "" ? sLink : "," + sLink);
                                }
                            }
                        }

                        //HARDCODED RULE ALERT!  we expect the list of ecosystems to go in the column called "Ecosystems"!
                        dr["Ecosystems"] = sResultList;
                    }
                }
            }
        }
开发者ID:you8,项目名称:cato,代码行数:67,代码来源:awsDiscovery.aspx.cs


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