本文整理汇总了C#中CmsData.CMSDataContext.PopulateSpecialTag方法的典型用法代码示例。如果您正苦于以下问题:C# CMSDataContext.PopulateSpecialTag方法的具体用法?C# CMSDataContext.PopulateSpecialTag怎么用?C# CMSDataContext.PopulateSpecialTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CmsData.CMSDataContext
的用法示例。
在下文中一共展示了CMSDataContext.PopulateSpecialTag方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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"))
{
var id = Db.FetchLastQuery().Id;
var tag = Db.PopulateSpecialTag(id, DbUtil.TagTypeId_Query);
p.Add("@qtagid", tag.Id);
}
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", 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;
}
示例3: Email2
private void Email2(CMSDataContext db2, IQueryable<Person> q, int queuedBy, string fromAddr, string fromName, string subject,
string body)
{
var from = new MailAddress(fromAddr, fromName);
q = from p in q
where p.EmailAddress != null
where p.EmailAddress != ""
where (p.SendEmailAddress1 ?? true) || (p.SendEmailAddress2 ?? false)
select p;
var tag = db2.PopulateSpecialTag(q, DbUtil.TagTypeId_Emailer);
Util.IsInRoleEmailTest = TestEmail;
var queueremail = db2.People.Where(pp => pp.PeopleId == queuedBy).Select(pp => pp.EmailAddress).SingleOrDefault();
if(!queueremail.HasValue())
throw new Exception("QueuedBy PeopleId not found in model.Email");
Util.UserEmail = queueremail;
db2.SetCurrentOrgId(CurrentOrgId);
var emailqueue = db2.CreateQueue(queuedBy, from, subject, body, null, tag.Id, false);
emailqueue.Transactional = Transactional;
db2.SendPeopleEmail(emailqueue.Id);
}