• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# CmsData.CMSDataContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CmsData.CMSDataContext的典型用法代码示例。如果您正苦于以下问题:C# CMSDataContext类的具体用法?C# CMSDataContext怎么用?C# CMSDataContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CMSDataContext类属于CmsData命名空间,在下文中一共展示了CMSDataContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: UseBootstrap

 public bool UseBootstrap(CMSDataContext db)
 {
     if (usebootstrap.HasValue)
         return usebootstrap.Value;
     var org = db.LoadOrganizationById(OrgId);
     return (usebootstrap = org.UseBootstrap) ?? false;
 }
开发者ID:vs06,项目名称:bvcms,代码行数:7,代码来源:Transaction.cs


示例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;
		}
开发者ID:stevesloka,项目名称:bvcms,代码行数:7,代码来源:Image.cs


示例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;
            }
        }
开发者ID:hkouns,项目名称:bvcms,代码行数:34,代码来源:QueryFunctions.cs


示例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
             */
        }
开发者ID:stevesloka,项目名称:bvcms,代码行数:27,代码来源:Transaction.cs


示例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;
 }
开发者ID:vs06,项目名称:bvcms,代码行数:7,代码来源:UploadPeopleModel.cs


示例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;
 }
开发者ID:GSBCfamily,项目名称:bvcms,代码行数:27,代码来源:Meeting.cs


示例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);
 }
开发者ID:clearfunction,项目名称:bvcms,代码行数:7,代码来源:UploadAddressesModel.cs


示例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();
 }
开发者ID:alexserdyuk,项目名称:bvcms,代码行数:28,代码来源:Organization.cs


示例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();
        }
开发者ID:stevesloka,项目名称:bvcms,代码行数:31,代码来源:OrganizationMember.cs


示例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;
        }
开发者ID:clearfunction,项目名称:bvcms,代码行数:34,代码来源:OrganizationMember.cs


示例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();
 }
开发者ID:vs06,项目名称:bvcms,代码行数:7,代码来源:Views.cs


示例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;
        }
开发者ID:clearfunction,项目名称:bvcms,代码行数:26,代码来源:ManagedGiving.cs


示例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);
 }
开发者ID:vanutama,项目名称:bvcms,代码行数:25,代码来源:CompareClass.cs


示例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();
 }
开发者ID:stevesloka,项目名称:bvcms,代码行数:7,代码来源:LongRunningOp.cs


示例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;
 }
开发者ID:stevesloka,项目名称:bvcms,代码行数:7,代码来源:LongRunningOp.cs


示例16: UploadPeopleModel

 public UploadPeopleModel(CMSDataContext Db, int PeopleId, bool noupdate)
 {
     this.Db = Db;
     Db2 = DbUtil.Create(Db.Host);
     this.PeopleId = PeopleId;
     this.noupdate = noupdate;
 }
开发者ID:GSBCfamily,项目名称:bvcms,代码行数:7,代码来源:UploadPeopleModel.cs


示例17: RunScript

        public static string RunScript(CMSDataContext db, string script)
        {
            if (!script.HasValue())
                return "no VitalStats script";

            var qf = new QueryFunctions(db);
            var engine = Python.CreateEngine();
            var ms = new MemoryStream();
            var sw = new StreamWriter(ms);
            engine.Runtime.IO.SetOutput(ms, sw);
            engine.Runtime.IO.SetErrorOutput(ms, sw);
            var sc = engine.CreateScriptSourceFromString(script);
            try
            {
                var code = sc.Compile();
                var scope = engine.CreateScope();
                scope.SetVariable("q", qf);
                scope.SetVariable("db", db);
                code.Execute(scope);
                ms.Position = 0;
                var sr = new StreamReader(ms);
                return sr.ReadToEnd();
            }
            catch (Exception ex)
            {
                return "VitalStats script error: " + ex.Message;
            }
        }
开发者ID:hkouns,项目名称:bvcms,代码行数:28,代码来源:QueryFunctions.cs


示例18: Save

        public void Save(CMSDataContext Db, bool increment = false, string owner = null)
        {
            var q = (from e in Db.Queries
                     where e.QueryId == Id
                     select e).FirstOrDefault();

            if (q == null)
            {
                q = new Query
                {
                    QueryId = Id,
                    Owner = Util.UserName,
                    Created = DateTime.Now,
                    Ispublic = IsPublic,
                    Name = Description
                };
                Db.Queries.InsertOnSubmit(q);
            }
            if(increment)
                q.LastRun = DateTime.Now;

            if (Description != q.Name)
            {
                var same = (from v in Db.Queries
                            where !v.Ispublic
                            where v.Owner == Util.UserName
                            where v.Name == Description
                            orderby v.LastRun descending
                            select v).FirstOrDefault();
                if (same != null)
                    same.Text = ToXml();
                else
                {
                    var c = Clone();
                    var cq = new Query
                    {
                        QueryId = c.Id,
                        Owner = Util.UserName,
                        Created = q.Created,
                        Ispublic = q.Ispublic,
                        Name = q.Name,
                        Text = c.ToXml(),
                        RunCount = q.RunCount,
                        CopiedFrom = q.CopiedFrom,
                        LastRun = q.LastRun
                    };
                    Db.Queries.InsertOnSubmit(cq);
                }
            }
            q.Name = Description;
            q.LastRun = DateTime.Now;
            if(owner.HasValue())
                q.Owner = owner;
            q.Ispublic = IsPublic;
            if (increment)
                q.RunCount = q.RunCount + 1;
            q.Text = ToXml();
            Db.SubmitChanges();
        }
开发者ID:stevesloka,项目名称:bvcms,代码行数:59,代码来源:Serialize2.cs


示例19: RegisterHelpers

        public static void RegisterHelpers(CMSDataContext db)
        {
            Handlebars.RegisterHelper("BottomBorder", (writer, context, args) => { writer.Write(CssStyle.BottomBorder); });
            Handlebars.RegisterHelper("AlignTop", (writer, context, args) => { writer.Write(CssStyle.AlignTop); });
            Handlebars.RegisterHelper("AlignRight", (writer, context, args) => { writer.Write(CssStyle.AlignRight); });
            Handlebars.RegisterHelper("DataLabelStyle", (writer, context, args) => { writer.Write(CssStyle.DataLabelStyle); });
            Handlebars.RegisterHelper("LabelStyle", (writer, context, args) => { writer.Write(CssStyle.LabelStyle); });
            Handlebars.RegisterHelper("DataStyle", (writer, context, args) => { writer.Write(CssStyle.DataStyle); });

            Handlebars.RegisterHelper("ServerLink", (writer, context, args) => { writer.Write(db.ServerLink().TrimEnd('/')); });
            Handlebars.RegisterHelper("FmtZip", (writer, context, args) => { writer.Write(args[0].ToString().FmtZip()); });
            Handlebars.RegisterHelper("IfEqual", (writer, options, context, args) =>
            {
                if (IsEqual(args))
                    options.Template(writer, (object)context);
                else
                    options.Inverse(writer, (object)context);
            });
            Handlebars.RegisterHelper("IfNotEqual", (writer, options, context, args) =>
            {
                if (!IsEqual(args))
                    options.Template(writer, (object)context);
                else
                    options.Inverse(writer, (object)context);
            });
            Handlebars.RegisterHelper("GetToken", (writer, context, args) =>
            {
                var s = args[0].ToString();
                var n = args[1].ToInt();
                var ntoks = args.Length > 2 ? args[2].ToInt() : 2;
                var sep = args.Length > 3 ? args[3].ToString() : " ";
                var a = s.SplitStr(sep, ntoks);
                writer.Write(a[n].trim());
            });

            // Format helper in form of:  {{Fmt value "fmt"}}
            // ex. {{Fmt Total "C"}}
            // fmt is required. Uses standard/custom dotnet format strings
            Handlebars.RegisterHelper("Fmt", (writer, context, args) =>
            {
                var fmt = $"{{0:{args[1]}}}";
                writer.Write(fmt, args[0]);
            });

            // FmtPhone helper in form of:  {{FmtPhone phone# "prefix"}}
            Handlebars.RegisterHelper("FmtPhone", (writer, context, args) => { writer.Write(args[0].ToString().FmtFone($"{args[1]}")); });

            Handlebars.RegisterHelper("ReplaceCode", (writer, context, args) =>
            {
                EmailReplacements r = context.Replacements as EmailReplacements
                    ?? (context.Replacements = new EmailReplacements(db));
                var code = args[0].ToString();
                var p = db.LoadPersonById(args[1].ToInt());
                int? oid = null;
                if(args.Length == 3)
                    oid = args[2].ToInt2();
                writer.Write(r.RenderCode(code, p, oid));
            });
        }
开发者ID:bvcms,项目名称:bvcms,代码行数:59,代码来源:Handlebars.cs


示例20: ParseSettings

 public static Settings ParseSettings(string s, CMSDataContext Db, int OrgId)
 {
     var settings = ParseSettings(s);
     settings.Db = Db;
     settings.OrgId = OrgId;
     settings.org = Db.LoadOrganizationById(OrgId);
     return settings;
 }
开发者ID:vanutama,项目名称:bvcms,代码行数:8,代码来源:ReadWriteText.cs



注:本文中的CmsData.CMSDataContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CmsData.EmailQueueTo类代码示例发布时间:2022-05-24
下一篇:
C# Lib.RepoInfo类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap