本文整理汇总了C#中CmsData.CMSDataContext类的典型用法代码示例。如果您正苦于以下问题:C# CMSDataContext类的具体用法?C# CMSDataContext怎么用?C# CMSDataContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CMSDataContext类属于CmsData命名空间,在下文中一共展示了CMSDataContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UseBootstrap
public bool UseBootstrap(CMSDataContext db)
{
if (usebootstrap.HasValue)
return usebootstrap.Value;
var org = db.LoadOrganizationById(OrgId);
return (usebootstrap = org.UseBootstrap) ?? false;
}
示例2: FetchBytes
public static byte[] FetchBytes(CMSDataContext Db, int? iid)
{
var image = ImageData.DbUtil.Db.Images.SingleOrDefault(i => i.Id == iid);
if (image == null)
return null;
return image.Bits;
}
示例3: VitalStats
public static string VitalStats(CMSDataContext Db)
{
var qf = new QueryFunctions(Db);
var script = Db.Content("VitalStats");
if (script == null)
return "no VitalStats script";
#if DEBUG2
var options = new Dictionary<string, object>();
options["Debug"] = true;
var engine = Python.CreateEngine(options);
var paths = engine.GetSearchPaths();
paths.Add(path);
engine.SetSearchPaths(paths);
var sc = engine.CreateScriptSourceFromFile(HttpContext.Current.Server.MapPath("/MembershipAutomation2.py"));
#else
var engine = Python.CreateEngine();
var sc = engine.CreateScriptSourceFromString(script.Body);
#endif
try
{
var code = sc.Compile();
var scope = engine.CreateScope();
code.Execute(scope);
dynamic VitalStats = scope.GetVariable("VitalStats");
dynamic m = VitalStats();
return m.Run(qf);
}
catch (Exception ex)
{
return "VitalStats script error: " + ex.Message;
}
}
示例4: ResolvePrevDaysVirtualCheckRejects
public static void ResolvePrevDaysVirtualCheckRejects(CMSDataContext db, DateTime start, DateTime end)
{
var gateway = DbUtil.Db.Gateway();
var response = gateway.GetReturnedChecks(start, end);
//var ds = gw.VirtualCheckRejects(dt);
//var items = from r in ds.Tables[0].AsEnumerable()
// let rejectdt = r["reject_date"].ToDate() ?? DateTime.MinValue
// where rejectdt > DateTime.MinValue
// select new
// {
// rejectdt,
// trantype = r["trantype"],
// amt = r["rejedt_amount"].ToString().ToDecimal(),
// tranid = r["customer_number"].ToInt(),
// rejectcode = r["reject_code"].ToString(),
// message = r["correction_info"].ToString(),
// };
/*
* Create a new transaction to reverse the original
* If the transaction was for online giving or recurring giving, then reverse the contribution.
* If the transaction contained an extra donation, then reverse that contribution.
* Send an email to the payor.
* Send an email notification to the online notify list for the associated organization
*/
}
示例5: UploadPeopleModel
public UploadPeopleModel(CMSDataContext Db, int PeopleId, bool noupdate, string connectionstring)
{
this.Db = Db;
Db2 = new CMSDataContext(connectionstring);
this.PeopleId = PeopleId;
this.noupdate = noupdate;
}
示例6: FetchOrCreateMeeting
public static Meeting FetchOrCreateMeeting(CMSDataContext Db, int OrgId, DateTime dt, bool? noautoabsents = null)
{
var meeting = (from m in Db.Meetings
where m.OrganizationId == OrgId && m.MeetingDate == dt
select m).FirstOrDefault();
if (meeting == null)
{
var acr = (from s in Db.OrgSchedules
where s.OrganizationId == OrgId
where s.SchedTime.Value.TimeOfDay == dt.TimeOfDay
where s.SchedDay == (int)dt.DayOfWeek
select s.AttendCreditId).SingleOrDefault();
meeting = new Meeting
{
OrganizationId = OrgId,
MeetingDate = dt,
CreatedDate = Util.Now,
CreatedBy = Util.UserId1,
GroupMeetingFlag = false,
AttendCreditId = acr ?? 1,
NoAutoAbsents = noautoabsents
};
Db.Meetings.InsertOnSubmit(meeting);
Db.SubmitChanges();
}
return meeting;
}
示例7: UploadAddressesModel
public UploadAddressesModel(CMSDataContext db, int peopleId)
{
this.db = db;
userpeopleid = peopleId;
var spec = db.Setting("NcoaColumns", "PeopleId=1,Addr1=4,Addr2=5,City=6,State=7,Zip=8,MoveDate=10");
NcoaCols = spec.Split(',').Select(vv => vv.Split('=')).ToDictionary(vv => vv[0], vv => vv[1].ToInt()-1);
}
示例8: AddAsPreviousMember
public static void AddAsPreviousMember(CMSDataContext db, int oid, int pid, string orgname, int mbrid, DateTime joindt, DateTime dropdt, int userid)
{
db.EnrollmentTransactions.InsertOnSubmit(
new EnrollmentTransaction
{
OrganizationId = oid,
PeopleId = pid,
OrganizationName = orgname,
MemberTypeId = mbrid,
TransactionDate = joindt,
TransactionTypeId = 1,
CreatedBy = userid,
CreatedDate = Util.Now,
});
db.EnrollmentTransactions.InsertOnSubmit(
new EnrollmentTransaction
{
OrganizationId = oid,
PeopleId = pid,
OrganizationName = orgname,
MemberTypeId = mbrid,
TransactionDate = dropdt,
TransactionTypeId = 5,
CreatedBy = userid,
CreatedDate = Util.Now,
});
db.SubmitChanges();
}
示例9: FastDrop
public void FastDrop(CMSDataContext db, DateTime dropdate, string orgname)
{
if (!EnrollmentDate.HasValue)
EnrollmentDate = CreatedDate;
var droptrans = new EnrollmentTransaction
{
OrganizationId = OrganizationId,
PeopleId = PeopleId,
MemberTypeId = MemberTypeId,
OrganizationName = orgname,
TransactionDate = dropdate,
TransactionTypeId = 5, // drop
CreatedBy = Util.UserId1,
CreatedDate = Util.Now,
Pending = Pending,
AttendancePercentage = AttendPct,
InactiveDate = InactiveDate,
UserData = UserData,
Request = Request,
ShirtSize = ShirtSize,
Grade = Grade,
Tickets = Tickets,
RegisterEmail = RegisterEmail,
Score = Score,
};
db.EnrollmentTransactions.InsertOnSubmit(droptrans);
db.OrgMemMemTags.DeleteAllOnSubmit(this.OrgMemMemTags);
db.OrganizationMembers.DeleteOnSubmit(this);
db.SubmitChanges();
}
示例10: AddOrgMember
public static OrganizationMember AddOrgMember(CMSDataContext db, int organizationId, int peopleId, int memberTypeId, DateTime enrollmentDate, string name)
{
var om = new OrganizationMember
{
OrganizationId = organizationId,
PeopleId = peopleId,
MemberTypeId = memberTypeId,
EnrollmentDate = enrollmentDate,
CreatedDate = Util.Now,
SkipInsertTriggerProcessing = true
};
var et = new EnrollmentTransaction
{
OrganizationId = om.OrganizationId,
PeopleId = om.PeopleId,
MemberTypeId = om.MemberTypeId,
OrganizationName = name,
TransactionDate = enrollmentDate,
EnrollmentDate = enrollmentDate,
TransactionTypeId = 1,
// join
CreatedBy = Util.UserId1,
CreatedDate = Util.Now,
AttendancePercentage = om.AttendPct,
SkipInsertTriggerProcessing = true
};
db.OrganizationMembers.InsertOnSubmit(om);
db.EnrollmentTransactions.InsertOnSubmit(et);
db.SubmitChanges();
return om;
}
示例11: GetStandardExtraValues
public static List<Value> GetStandardExtraValues(CMSDataContext db, string table, bool nocache = false)
{
return (from vv in GetViews(db, nocache).List
where vv.Table == table
from v in vv.Values
select v).ToList();
}
示例12: DoAllGiving
public static int DoAllGiving(CMSDataContext Db)
{
var gateway = Db.Setting("TransactionGateway", "");
int count = 0;
if (gateway.HasValue())
{
var q = from rg in Db.ManagedGivings
where rg.NextDate < Util.Now.Date
//where rg.PeopleId == 819918
select rg;
foreach (var rg in q)
rg.NextDate = rg.FindNextDate(Util.Now.Date);
var rgq = from rg in Db.ManagedGivings
where rg.NextDate == Util.Now.Date
select new
{
rg,
rg.Person,
rg.Person.RecurringAmounts,
};
foreach (var i in rgq)
count += i.rg.DoGiving(Db);
}
return count;
}
示例13: Expression
internal Expression Expression(QueryBuilderClause qbc, ParameterExpression parm, CMSDataContext Db)
{
var c = new Condition()
{
Age = qbc.Age,
Campus = qbc.Campus,
Comparison = qbc.Comparison,
DateValue = qbc.DateValue,
CodeIdValue = qbc.CodeIdValue,
Days = qbc.Days,
Division = qbc.Division,
EndDate = qbc.EndDate,
ConditionName = qbc.Field,
Organization = qbc.Organization,
OrgType = qbc.OrgType,
Program = qbc.Program,
Quarters = qbc.Quarters,
Schedule = qbc.Schedule,
StartDate = qbc.StartDate,
Tags = qbc.Tags,
TextValue = qbc.TextValue,
SavedQuery = qbc.SavedQueryIdDesc
};
return c.GetExpression(parm, Db, qbc.SetIncludeDeceased, qbc.SetParentsOf);
}
示例14: RemoveExistingLop
public void RemoveExistingLop(CMSDataContext db, int id, string op)
{
var exlop = FetchLongRunningOp(db, id, op);
if (exlop != null)
db.LongRunningOps.DeleteOnSubmit(exlop);
db.SubmitChanges();
}
示例15: FetchLongRunningOp
public static LongRunningOp FetchLongRunningOp(CMSDataContext db, int id, string op)
{
var lop = db.LongRunningOps.SingleOrDefault(m => m.Id == id && m.Operation == op);
if(lop != null)
lop.host = db.Host;
return lop;
}