本文整理汇总了C#中acUI.acUI.QuoteUp方法的典型用法代码示例。如果您正苦于以下问题:C# acUI.acUI.QuoteUp方法的具体用法?C# acUI.acUI.QuoteUp怎么用?C# acUI.acUI.QuoteUp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类acUI.acUI
的用法示例。
在下文中一共展示了acUI.acUI.QuoteUp方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteClouds
public static string DeleteClouds(string sDeleteArray)
{
dataAccess dc = new dataAccess();
acUI.acUI ui = new acUI.acUI();
string sSql = null;
string sErr = "";
if (sDeleteArray.Length < 36)
return "";
sDeleteArray = ui.QuoteUp(sDeleteArray);
DataTable dt = new DataTable();
// get a list of ids that will be deleted for the log
sSql = "select cloud_id, cloud_name, provider from clouds where cloud_id in (" + sDeleteArray + ")";
if (!dc.sqlGetDataTable(ref dt, sSql, ref sErr))
throw new Exception(sErr);
try
{
dataAccess.acTransaction oTrans = new dataAccess.acTransaction(ref sErr);
sSql = "delete from clouds where cloud_id in (" + sDeleteArray + ")";
oTrans.Command.CommandText = sSql;
if (!oTrans.ExecUpdate(ref sErr))
throw new Exception(sErr);
//refresh the cloud account list in the session
if (!ui.PutCloudAccountsInSession(ref sErr))
throw new Exception(sErr);
oTrans.Commit();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
//reget the cloud providers class in the session
ui.SetCloudProviders(ref sErr);
if (!string.IsNullOrEmpty(sErr))
throw new Exception("Error: Unable to load Cloud Providers XML." + sErr);
// if we made it here, so save the logs
foreach (DataRow dr in dt.Rows)
{
ui.WriteObjectDeleteLog(Globals.acObjectTypes.Cloud, dr["cloud_id"].ToString(), dr["cloud_name"].ToString(), dr["provider"].ToString() + " Cloud Deleted.");
}
return sErr;
}
示例2: DeleteCredentials
public static string DeleteCredentials(string sDeleteArray)
{
dataAccess dc = new dataAccess();
acUI.acUI ui = new acUI.acUI();
string sSql = null;
string sErr = "";
if (sDeleteArray.Length < 36)
return "";
sDeleteArray = ui.QuoteUp(sDeleteArray);
DataTable dt = new DataTable();
// get a list of credential_ids that will be deleted for the log
sSql = "select credential_name,credential_id from asset_credential where credential_id in (" + sDeleteArray.ToString() + ") " +
"and credential_id not in (select distinct credential_id from asset where credential_id is not null)";
if (!dc.sqlGetDataTable(ref dt, sSql, ref sErr))
{
throw new Exception(sErr);
}
try
{
dataAccess.acTransaction oTrans = new dataAccess.acTransaction(ref sErr);
//delete asset_credential
sSql = "delete from asset_credential where credential_id in (" + sDeleteArray.ToString() + ") " +
"and credential_id not in (select distinct credential_id from asset where credential_id is not null)";
oTrans.Command.CommandText = sSql;
if (!oTrans.ExecUpdate(ref sErr))
{
throw new Exception(sErr);
}
oTrans.Commit();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
// if we made it here, so save the logs
foreach (DataRow dr in dt.Rows)
{
ui.WriteObjectDeleteLog(Globals.acObjectTypes.Credential, dr["credential_id"].ToString(), dr["credential_name"].ToString(), "Credential Deleted");
}
return sErr;
}
示例3: DeleteAccounts
public static string DeleteAccounts(string sDeleteArray)
{
dataAccess dc = new dataAccess();
acUI.acUI ui = new acUI.acUI();
string sSql = null;
string sErr = "";
if (sDeleteArray.Length < 36)
return "";
sDeleteArray = ui.QuoteUp(sDeleteArray);
DataTable dt = new DataTable();
// get a list of ids that will be deleted for the log
sSql = "select account_id, account_name, provider, login_id from cloud_account where account_id in (" + sDeleteArray + ")";
if (!dc.sqlGetDataTable(ref dt, sSql, ref sErr))
throw new Exception(sErr);
try
{
dataAccess.acTransaction oTrans = new dataAccess.acTransaction(ref sErr);
sSql = "delete from cloud_account where account_id in (" + sDeleteArray + ")";
oTrans.Command.CommandText = sSql;
if (!oTrans.ExecUpdate(ref sErr))
throw new Exception(sErr);
//refresh the cloud account list in the session
if (!ui.PutCloudAccountsInSession(ref sErr))
throw new Exception(sErr);
oTrans.Commit();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
// if we made it here, so save the logs
foreach (DataRow dr in dt.Rows)
{
ui.WriteObjectDeleteLog(Globals.acObjectTypes.CloudAccount, dr["account_id"].ToString(), dr["account_name"].ToString(), dr["provider"].ToString() + " Account for LoginID [" + dr["login_id"].ToString() + "] Deleted");
}
return sErr;
}
示例4: DeleteDomains
public static string DeleteDomains(string sDeleteArray)
{
acUI.acUI ui = new acUI.acUI();
string sSql = null;
string sErr = "";
if (sDeleteArray.Length < 36)
return "";
sDeleteArray = ui.QuoteUp(sDeleteArray);
try
{
dataAccess.acTransaction oTrans = new dataAccess.acTransaction(ref sErr);
//delete domains
sSql = "delete from ldap_domain where ldap_domain in (" + sDeleteArray.ToString() + ")";
oTrans.Command.CommandText = sSql;
if (!oTrans.ExecUpdate(ref sErr))
{
throw new Exception(sErr);
}
oTrans.Commit();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
// if we made it here, so save the logs
ui.WriteObjectDeleteLog(Globals.acObjectTypes.Domain, sDeleteArray.ToString(), sDeleteArray.ToString(), "Domain(s) Deleted");
return sErr;
}
示例5: wmExportTasks
public string wmExportTasks(string sTaskArray)
{
acUI.acUI ui = new acUI.acUI();
ImportExport.ImportExportClass ie = new ImportExport.ImportExportClass();
string sErr = "";
//pretty much just call the ImportExport function
try
{
//what are we gonna call the final file?
string sUserID = ui.GetSessionUserID();
string sFileName = sUserID + "_backup";
string sPath = Server.MapPath("~/temp/");
if (sTaskArray.Length < 36)
return "";
sTaskArray = ui.QuoteUp(sTaskArray);
if (!ie.doBatchTaskExport(sPath, sTaskArray, sFileName, ref sErr))
{
throw new Exception("Unable to export Tasks." + sErr);
}
if (sErr == "")
return sFileName + ".zip";
else
return sErr;
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
示例6: wmDeleteTasks
public string wmDeleteTasks(string sDeleteArray)
{
dataAccess dc = new dataAccess();
acUI.acUI ui = new acUI.acUI();
string sSql = null;
string sErr = "";
string sTaskNames = "";
if (sDeleteArray.Length < 36)
return "";
sDeleteArray = ui.QuoteUp(sDeleteArray);
//NOTE: right now this plows ALL versions. There is an enhancement to possibly 'retire' a task, or
//only delete certain versions.
try
{
// what about the instance tables?????
// bugzilla 1290 Tasks that have history (task_instance table) can not be deleted
// exclude them from the list and return a message noting the task(s) that could not be deleted
// first we need a list of tasks that will not be deleted
sSql = "select task_name from task t " +
"where t.original_task_id in (" + sDeleteArray.ToString() + ") " +
"and t.task_id in (select ti.task_id from tv_task_instance ti where ti.task_id = t.task_id)";
if (!dc.csvGetList(ref sTaskNames, sSql, ref sErr, true))
throw new Exception(sErr);
// list of tasks that will be deleted
//we have an array of 'original_task_id'.
//we need an array or task_id
//build one.
sSql = "select t.task_id from task t " +
"where t.original_task_id in (" + sDeleteArray.ToString() + ") " +
"and t.task_id not in (select ti.task_id from tv_task_instance ti where ti.task_id = t.task_id)";
string sTaskIDs = "";
if (!dc.csvGetList(ref sTaskIDs, sSql, ref sErr, true))
throw new Exception(sErr);
// if any tasks can be deleted
if (sTaskIDs.Length > 1)
{
dataAccess.acTransaction oTrans = new dataAccess.acTransaction(ref sErr);
//oTrans.Command.CommandText = "delete from task_asset_attribute where task_id in (" + sTaskIDs + ")";
//if (!oTrans.ExecUpdate(ref sErr))
// throw new Exception(sErr);
oTrans.Command.CommandText = "delete from task_step_user_settings" +
" where step_id in" +
" (select step_id from task_step where task_id in (" + sTaskIDs + "))";
if (!oTrans.ExecUpdate(ref sErr))
throw new Exception(sErr);
oTrans.Command.CommandText = "delete from task_step where task_id in (" + sTaskIDs + ")";
if (!oTrans.ExecUpdate(ref sErr))
throw new Exception(sErr);
oTrans.Command.CommandText = "delete from task_codeblock where task_id in (" + sTaskIDs + ")";
if (!oTrans.ExecUpdate(ref sErr))
throw new Exception(sErr);
oTrans.Command.CommandText = "delete from task where task_id in (" + sTaskIDs + ")";
if (!oTrans.ExecUpdate(ref sErr))
throw new Exception(sErr);
oTrans.Commit();
ui.WriteObjectDeleteLog(Globals.acObjectTypes.Task, "Multiple", "Original Task IDs", sDeleteArray.ToString());
}
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
// if the sTaskNames contains any names, then send back a message that these were not deleted because of history records.
if (sTaskNames.Length > 0)
{
return "Task(s) (" + sTaskNames + ") have history rows and could not be deleted.";
}
else
{
return sErr;
}
}
示例7: wmDeleteTags
public string wmDeleteTags(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 object_tags where tag_name in (" + sDeleteArray.ToString() + ")";
if (!dc.sqlExecuteUpdate(sSQL, ref sErr))
throw new Exception(sErr);
sSQL = "delete from lu_tags where tag_name 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.None, sDeleteArray.ToString(), sDeleteArray.ToString(), "Tag(s) Deleted");
return sErr;
}
示例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;
}
示例9: 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;
}