本文整理汇总了C#中CmsData.CMSDataContext.FetchLastQuery方法的典型用法代码示例。如果您正苦于以下问题:C# CMSDataContext.FetchLastQuery方法的具体用法?C# CMSDataContext.FetchLastQuery怎么用?C# CMSDataContext.FetchLastQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CmsData.CMSDataContext
的用法示例。
在下文中一共展示了CMSDataContext.FetchLastQuery方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RunScriptSql
private string RunScriptSql(CMSDataContext db, string parameter, string body, DynamicParameters p)
{
if (!CanRunScript(body))
return "Not Authorized to run this script";
if (body.Contains("@qtagid", ignoreCase:true))
{
var id = db.FetchLastQuery().Id;
var tag = db.PopulateSpecialTag(id, DbUtil.TagTypeId_Query);
int? qtagid = tag.Id;
p.Add("@qtagid", qtagid);
ViewBag.Type = "SqlReport";
}
else if (body.Contains("@CurrentOrgId", ignoreCase:true))
{
var oid = DbUtil.Db.CurrentOrgId0;
p.Add("@CurrentOrgId", oid);
if(oid > 0)
{
var name = DbUtil.Db.LoadOrganizationById(oid).FullName2;
ViewBag.Name2 = name;
ViewBag.Type = "SqlReport";
}
}
else if (body.Contains("@OrgIds", ignoreCase: true))
{
var oid = DbUtil.Db.CurrentOrgId0;
p.Add("@OrgIds", oid.ToString());
ViewBag.Type = "OrgSearchSqlReport";
if (body.Contains("--class=StartEndReport"))
{
p.Add("@MeetingDate1", DateTime.Now.AddDays(-90));
p.Add("@MeetingDate2", DateTime.Now);
}
}
else
ViewBag.Type = "SqlReport";
if (body.Contains("@userid", ignoreCase:true))
p.Add("@userid", Util.UserId);
p.Add("@p1", parameter ?? "");
return body;
}
示例2: RunScriptSql
private string RunScriptSql(CMSDataContext Db, string parameter, string body, DynamicParameters p)
{
if (!CanRunScript(body))
return "Not Authorized to run this script";
if (body.Contains("@qtagid"))
{
var id = Db.FetchLastQuery().Id;
var tag = Db.PopulateSpecialTag(id, DbUtil.TagTypeId_Query);
p.Add("@qtagid", tag.Id);
}
p.Add("@p1", parameter ?? "");
return body;
}