本文整理汇总了C#中Params.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Params.Add方法的具体用法?C# Params.Add怎么用?C# Params.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Params
的用法示例。
在下文中一共展示了Params.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: doExecute
protected override void doExecute() {
base.doExecute();
EBioException ebioex = null;
if (this.FBioDesc == null)
throw new EBioException(String.Format("Описание объекта {0} не найдено на сервере.", this.bioCode));
var vDS = this.FBioDesc.DocumentElement;
if (vDS == null)
throw new EBioException(String.Format("В описании объекта {0} не найден раздел <store>.", this.bioCode));
var v_hashCodeOfFile = Params.FindParamValue(this.QParams, CS_HASH_CODE_WEB_PARAM) as String;
if (String.IsNullOrEmpty(v_hashCodeOfFile))
throw new EBioException(String.Format("В параметрах запроса должен присутствовать параметр {0}.", CS_HASH_CODE_WEB_PARAM));
var rqst = this.BioRequest<BioRequest>();
var vConn = this.BioSession.Cfg.dbSession.GetConnection();
try {
try {
var cursor = new CJSCursor(vConn, vDS, this.bioCode);
var ajaxRequestTimeOut = Utl.Convert2Type<int>(Params.FindParamValue(this.QParams, "ajaxrqtimeout"));
var vMon = SQLGarbageMonitor.GetSQLGarbageMonitor(this.Context);
vMon.RegisterSQLCmd(cursor, (SQLCmd vSQLCmd, ref Boolean killQuery, ref Boolean killSession, Boolean vAjaxTimeoutExceeded) => {
if (Equals(cursor, vSQLCmd)) {
killQuery = !this.Context.Response.IsClientConnected || vAjaxTimeoutExceeded;
killSession = killQuery;
}
}, ajaxRequestTimeOut);
try {
var prms = new Params();
prms.Add("p_hash_code", v_hashCodeOfFile);
prms.Add(new Param(CS_FILE_NAME_PARAM, null, typeof(String), ParamDirection.Output));
prms.Add(new Param(CS_FILE_PARAM, null, typeof(Byte[]), ParamDirection.Output));
cursor.DoExecuteSQL(prms, 120);
this._sendFileToClient(prms);
} catch (Exception ex) {
throw EBioException.CreateIfNotEBio(ex);
} finally {
vMon.RemoveItem(cursor);
}
} catch (Exception ex) {
vConn.Close();
vConn.Dispose();
throw EBioException.CreateIfNotEBio(ex);
}
} catch (Exception ex) {
ebioex = new EBioException("Ошибка выполнения на сервере. Сообщение: " + ex.Message, ex);
}
if (ebioex != null) {
this.Context.Response.Write(new BioResponse() { Success = false, BioParams = this.bioParams, Ex = ebioex }.Encode());
}
}
示例2: extractPKItem
private Params extractPKItem(String pBioSelItem, CJSCursor pCur) {
Params vRslt = new Params();
String vBioSelItem = pBioSelItem;
this.killTrailerChars(ref vBioSelItem, '(', ')');
String[] vBioSelItemVals = Utl.SplitString(vBioSelItem, ")-(");
for(int i = 0; i < vBioSelItemVals.Length; i++) {
String vKey = "" + (i + 1);
if(pCur.PKFields.ContainsKey(vKey)) {
Field vPKFld = (Field)pCur.PKFields[vKey];
vRslt.Add(vPKFld.FieldName, vBioSelItemVals[i], vPKFld);
}
}
return vRslt;
}
示例3: regConnect
public void regConnect(String user,
String sessionID,
String sessionRemoteIP,
String sessionRemoteHost,
String sessionRemoteClient,
TRemoteConnectionStatus status) {
var v_prms = new Params();
v_prms.Add("pUser", user);
v_prms.Add("pSessionID", sessionID);
v_prms.Add("pSessionRemoteIP", sessionRemoteIP);
v_prms.Add("pSessionRemoteHost", sessionRemoteHost);
v_prms.Add("pSessionRemoteClient", sessionRemoteClient);
v_prms.Add("pStatus", this.decConStat(status));
var v_sql = String.Format("begin {0}.reg_connection(:pUser, :pSessionID," +
":pSessionRemoteIP, :pSessionRemoteHost, :pSessionRemoteClient, :pStatus); end;", BIO_LOGIN_PKG);
SQLCmd.ExecuteScript(this.dbSession, v_sql, v_prms, DEFAULT_SQL_TIMEOUT);
}
示例4: extractPKS
private Params extractPKS(String pBioSelection, CJSCursor pCur) {
Params vRslt = new Params();
String vRsltStr = null;
Regex vr = new Regex("\"pks\" *: *.+}", RegexOptions.IgnoreCase);
Match m = vr.Match(pBioSelection);
if(m.Success) {
String[] vPrts = Utl.SplitString(m.Value, ':');
if(vPrts.Length == 2)
vRsltStr = vPrts[1].Trim().Substring(0, vPrts[1].Length - 1);
}
if(vRsltStr != null) {
killTrailerChars(ref vRsltStr, '[', ']');
String[] vRows = Utl.SplitString(vRsltStr, ',');
for(int i = 0; i < vRows.Length; i++ ) {
String vStrItem = vRows[i];
vStrItem = vStrItem.Trim();
this.killTrailerChars(ref vStrItem, '"', '"');
Params vPKRow = this.extractPKItem(vStrItem, pCur);
vRslt.Add("ROW_ID", vStrItem, vPKRow);
}
}
return vRslt;
}
示例5: doOnGetQueue
/// <summary>
/// Формируем список отчетов в очереди
/// </summary>
/// <param name="userUID"></param>
/// <param name="remoteIP"></param>
/// <returns></returns>
protected override XmlDocument doOnGetQueue(String userUID, String remoteIP) {
var v_rslt = dom4cs.NewDocument("queue").XmlDoc;
if (v_rslt.DocumentElement != null) {
v_rslt.DocumentElement.SetAttribute("usr", userUID);
v_rslt.DocumentElement.SetAttribute("remote_ip", remoteIP);
v_rslt.DocumentElement.SetAttribute("count", "0");
}
const string sql = "select * from table(xlr.rqueue_xml(null,:p_usr_uid))";
var v_prms = new Params();
v_prms.Add("p_usr_uid", userUID);
var v_cur = new SQLCmd(this.cfg.dbSession);
v_cur.Init(sql, v_prms);
v_cur.Open(120);
var v_sb = new StringBuilder();
try{
var v_cnt = 0;
while (v_cur.Next()) {
v_sb.AppendLine(v_cur.DataReader.GetString(0));
v_cnt++;
}
if (v_sb.Length > 0) {
if (v_rslt.DocumentElement != null) {
v_rslt.DocumentElement.InnerXml = v_sb.ToString();
v_rslt.DocumentElement.SetAttribute("count", "" + v_cnt);
}
}
} finally {
v_cur.Close();
}
return v_rslt;
}
示例6: doOnRestartReportInst
/// <summary>
/// Перезапуск отчета
/// </summary>
/// <param name="rptUID"></param>
/// <param name="userUID"></param>
/// <param name="remoteIP"></param>
protected override void doOnRestartReportInst(String rptUID, String userUID, String remoteIP) {
const string sql = "begin xlr.restart_rpt(:p_rpt_uid, :p_usr_uid, :p_remote_ip); end;";
var v_prms = new Params();
v_prms.Add("p_rpt_uid", rptUID);
v_prms.Add("p_usr_uid", userUID);
v_prms.Add("p_remote_ip", remoteIP);
SQLCmd.ExecuteScript(this.cfg.dbSession, sql, v_prms, 120);
}
示例7: doOnAddReportResult2DB
/// <summary>
/// Тут засовываем в очередь файл готового отчета
/// </summary>
/// <param name="rptUID"></param>
/// <param name="fileName"></param>
protected override void doOnAddReportResult2DB(String rptUID, String fileName) {
const string sql = "begin xlr.save_rpt_file(:p_rpt_uid, :p_file_name, :p_file); end;";
var v_prms = new Params();
v_prms.Add("p_rpt_uid", rptUID);
v_prms.Add("p_file_name", Path.GetFileName(fileName));
byte[] v_buffer = null;
Utl.ReadBinFileInBuffer(fileName, ref v_buffer);
v_prms.Add("p_file", v_buffer);
SQLCmd.ExecuteScript(this.cfg.dbSession, sql, v_prms, 120);
}
示例8: doOnGetReportResult
/// <summary>
/// Тут вытаскиваем из очереди файл готового отчета
/// </summary>
/// <param name="rptUID"></param>
/// <param name="userUID"></param>
/// <param name="remoteIP"></param>
/// <param name="fileName"></param>
/// <param name="buff"></param>
protected override void doOnGetReportResult(String rptUID, String userUID, String remoteIP, ref String fileName, ref Byte[] buff) {
const string sql = "SELECT a.rpt_result_fn, a.rpt_result_len, a.rpt_result" +
" FROM rpt$queue_rslts a"+
" WHERE a.rpt_uid = :rpt_uid";
var v_prms = new Params();
v_prms.Add("rpt_uid", rptUID);
var v_cur = new SQLCmd(this.cfg.dbSession);
v_cur.Init(sql, v_prms);
v_cur.Open(120);
try {
if (v_cur.Next()) {
fileName = (String)v_cur.DataReader.GetValue(0);
var v_szAct = v_cur.DataReader.GetDecimal(1);
var v_szActInt = (int)v_szAct;
buff = new byte[v_szActInt];
v_cur.DataReader.GetBytes(2, 0, buff, 0, v_szActInt);
}
} finally {
v_cur.Close();
}
}
示例9: Login
public override void Login(String login) {
this.CurUser = null;
var v_sql = String.Format("begin {0}.check_login(:login, :usr_uid); end;", BIO_LOGIN_PKG);
var v_prms = new Params();
v_prms.Add("login", login);
v_prms.Add(new Param("usr_uid", (String)null, typeof(String), ParamDirection.Output));
SQLCmd.ExecuteScript(this.dbSession, v_sql, v_prms, DEFAULT_SQL_TIMEOUT);
var v_usrUID = Params.FindParamValue(v_prms, "usr_uid") as String;
v_sql = String.Format("select * from table({0}.get_usr(:usr_uid))", BIO_LOGIN_PKG);
var v_cur = SQLCursor.CreateAndOpenCursor(this.dbSession, v_sql, new Params(new Param("usr_uid", v_usrUID)), DEFAULT_SQL_TIMEOUT);
try {
if (v_cur.IsActive && v_cur.Next()) {
this.CurUser = new BioUser();
enumHelper.ForEachPropertyInfo(this.CurUser.GetType(), p => {
var fld = enumHelper.GetAttributeByInfo<DbFieldAttribute>(p);
if (fld != null) {
var val = v_cur.GetOraValue(fld.Name);
try {
p.SetValue(this.CurUser, val, null);
} catch (Exception ex) {
throw new Exception(String.Format("Ошибка при восстановлении значения поля [{0}] из [{1}]({2}). Сообщение: {3}", p.Name, val, fld.Name, ex.Message), ex);
}
}
});
} else {
throw new EBioException { ErrorCode = 20401 };
}
} finally {
v_cur.Close();
}
}
示例10: DoDelete
/*
/// <summary>
/// Удаляет запись по признаку первичного ключа.
/// </summary>
/// <exception cref="EBioException">Возбуждается, когда операция завершилась с ошибкой.</exception>
public void DoDelete(Params @params) {
this.doExecute(@params, "delete");
}
/// <summary>
/// Добавляет/Изменяет запись по признаку первичного ключа.
/// </summary>
/// <exception cref="EBioException">Возбуждается, когда операция завершилась с ошибкой.</exception>
public void DoInsertUpdate(Params @params) {
this.doExecute(@params, "insertupdate");
}
*/
private Params _buildPostParams(JsonStoreMetadata metadata, JsonStoreRow row, Params bioParams) {
Params v_rslt = new Params();
for (int i = 0; i < metadata.Fields.Count; i++)
v_rslt.Add(metadata.Fields[i].Name.ToLower(), row.Values[i]);
v_rslt = v_rslt.Merge(bioParams, false);
return v_rslt;
}
示例11: doOnMarkRQCmdState
/// <summary>
/// Добавляем состояние к отчету
/// </summary>
/// <param name="rptUID"></param>
/// <param name="cmd"></param>
protected override void doOnMarkRQCmdState(String rptUID, QueueCmd cmd) {
//throw new NotImplementedException();
const string sql = "begin xlr.mark_cmd_done(:p_rpt_uid, :p_cmd); end;";
var v_prms = new Params();
v_prms.Add("p_rpt_uid", rptUID);
v_prms.Add("p_cmd", (int)cmd);
SQLCmd.ExecuteScript(this.cfg.dbSession, sql, v_prms, 120);
}
示例12: doOnGetUsrRoles
/// <summary>
/// Возвращаем список ролей пользователя - строка перечень через ";"
/// </summary>
/// <param name="userUID"></param>
/// <returns></returns>
protected override String doOnGetUsrRoles(String userUID) {
const string sql = "begin :rslt := xlr.usr_roles(:p_usr_uid); end;";
var v_prms = new Params();
v_prms.Add("p_usr_uid", userUID);
v_prms.Add(new Param("rslt", null, typeof(String), 1000, ParamDirection.InputOutput));
SQLCmd.ExecuteScript(this.cfg.dbSession, sql, v_prms, 120);
return v_prms.ValueAsStringByName("rslt", true);
}
示例13: doOnAddQueueState
/// <summary>
/// Добавляем состояние к отчету
/// </summary>
/// <param name="rptUID"></param>
/// <param name="newState"></param>
/// <param name="newStateDesc"></param>
/// <param name="userUID"></param>
/// <param name="remoteIP"></param>
protected override void doOnAddQueueState(String rptUID, RemoteProcState newState, String newStateDesc, String userUID, String remoteIP) {
const string sql = "begin xlr.set_rpt_state(:p_rpt_uid, :p_rpt_state, :p_state_desc, :p_usr_uid, :p_remote_ip); end;";
var v_prms = new Params();
v_prms.Add("p_rpt_uid", rptUID);
v_prms.Add("p_rpt_state", (int)newState);
v_prms.Add("p_state_desc", newStateDesc);
v_prms.Add("p_usr_uid", userUID);
v_prms.Add("p_remote_ip", remoteIP);
SQLCmd.ExecuteScript(this.cfg.dbSession, sql, v_prms, 120);
}
示例14: GetSingleRow
public Params GetSingleRow(Int32 timeout){
Params vResult = null;
CXLRDataFactory v_dataFactory = this.Owner.Owner.DataFactory;//CXLRDataFactory.createDataFactory(this.Owner.Cfg, this.Owner.DataFactoryTypeName);
try {
v_dataFactory.Open(this.Owner.Owner.currentDbConnection, this.Owner.Cfg, timeout);
if (v_dataFactory.Next()) {
vResult = new Params();
for (int i = 0; i < v_dataFactory.ColCount; i++) {
vResult.Add(v_dataFactory.ColName(i), v_dataFactory.Values[i].ToString());
}
}
}finally{
}
return vResult;
}
示例15: testReport2
static void testReport2() {
DataTable tbl = new DataTable();
tbl.Columns.Add(new DataColumn { ColumnName = "ID", DataType = typeof(Int32) });
tbl.Columns.Add(new DataColumn { ColumnName = "ORGNAME", DataType = typeof(String) });
tbl.Rows.Add(1, "org 1");
//tbl.Rows.Add(1, "org 2");
CXLReportDSConfigs v_dss = new CXLReportDSConfigs();
v_dss.Add(new CXLReportDSConfig {
alias = "cdsRpt",
rangeName = "rngRpt",
outerDataTable = tbl
});
Params prms = new Params();
prms.Add("org_type", "p");
String vrsltFileName = CXLReport.BuildReportSync(new CXLReportConfig {
title = "Заголовок отчета",
subject = "Описание отчета",
templateAdv = @"report100(rpt).xls",
inPrms = prms,
filenameFmt = "{$code}_{$now}",
dss = v_dss,
debug = true
});
}