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

C# CmsData.Person类代码示例

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

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



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

示例1: Email

 public void Email(MailAddress fromAddress, Person p, List<MailAddress> addmail, string subject, string body, bool redacted)
 {
     var emailqueue = new EmailQueue
     {
         Queued = DateTime.Now,
         FromAddr = fromAddress.Address,
         FromName = fromAddress.DisplayName,
         Subject = subject,
         Body = body,
         QueuedBy = Util.UserPeopleId,
         Redacted = redacted,
         Transactional = true
     };
     EmailQueues.InsertOnSubmit(emailqueue);
     string addmailstr = null;
     if (addmail != null)
         addmailstr = addmail.EmailAddressListToString();
     emailqueue.EmailQueueTos.Add(new EmailQueueTo
     {
         PeopleId = p.PeopleId,
         OrgId = CurrentOrgId,
         AddEmail = addmailstr,
         Guid = Guid.NewGuid(),
     });
     SubmitChanges();
     SendPersonEmail(emailqueue.Id, p.PeopleId);
 }
开发者ID:GSBCfamily,项目名称:bvcms,代码行数:27,代码来源:Emailer.cs


示例2: PersonFamilyModel

 public PersonFamilyModel(int id)
 {
     person = DbUtil.Db.LoadPersonById(id);
     Pager = new PagerModel2(Count);
     Pager.pagesize = 10;
     Pager.ShowPageSize = false;
 }
开发者ID:rossspoon,项目名称:bvcms,代码行数:7,代码来源:FamilyModel.cs


示例3: CreateTask

 public void CreateTask(int forPeopleId, Person p, string description)
 {
     var t = p.AddTaskAbout(db, forPeopleId, description);
     db.SubmitChanges();
     db.Email(db.Setting("AdminMail", "[email protected]"), db.LoadPersonById(forPeopleId),
         "TASK: " + description,
         Task.TaskLink(db, description, t.Id) + "<br/>" + p.Name);
 }
开发者ID:stevesloka,项目名称:bvcms,代码行数:8,代码来源:Person.cs


示例4: MemberInfo

 public MemberInfo(int id)
     : this()
 {
     person = Db.LoadPersonById(id);
     if (person == null)
         return;
     this.CopyPropertiesFrom(person);
 }
开发者ID:hkouns,项目名称:bvcms,代码行数:8,代码来源:MemberInfo.cs


示例5: UpdateMemberNotes

        public void UpdateMemberNotes()
        {
            person = DbUtil.Db.LoadPersonById(PeopleId);
            this.CopyPropertiesTo(person);

            DbUtil.Db.SubmitChanges();
            DbUtil.LogActivity($"Updated Growth: {person.Name}");
        }
开发者ID:stevesloka,项目名称:bvcms,代码行数:8,代码来源:MemberNotesModel.cs


示例6: CreateTask

 // List of api functions to call from Python
 public void CreateTask(int forPeopleId, Person p, string description)
 {
     DbUtil.LogActivity("Adding Task about: {0}".Fmt(p.Name));
     var t = p.AddTaskAbout(Db, forPeopleId, description);
     Db.SubmitChanges();
     Db.Email(DbUtil.SystemEmailAddress, DbUtil.Db.LoadPersonById(forPeopleId),
         "TASK: " + description,
         Task.TaskLink(Db, description, t.Id) + "<br/>" + p.Name);
 }
开发者ID:rossspoon,项目名称:bvcms,代码行数:10,代码来源:PythonEvents.cs


示例7: MessageReplacements

 public static string MessageReplacements(CMSDataContext db, Person p, string DivisionName, string OrganizationName, string Location, string message)
 {
     message = message.Replace("{first}", p.PreferredName, ignoreCase: true);
     message = message.Replace("{name}", p.Name, ignoreCase: true);
     message = message.Replace("{division}", DivisionName, ignoreCase: true);
     message = message.Replace("{org}", OrganizationName, ignoreCase: true);
     message = message.Replace("{location}", Location, ignoreCase: true);
     message = message.Replace("{cmshost}", db.CmsHost, ignoreCase: true);
     return message;
 }
开发者ID:rossspoon,项目名称:bvcms,代码行数:10,代码来源:APIOrganization.cs


示例8: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     var id = this.QueryString<int>("id");
     person = DbUtil.Db.People.Single(p => p.PeopleId == id);
     if (person.Picture == null)
         person.Picture = new Picture();
     if (!IsPostBack)
         HiddenField1.Value = "large";
     if (DbUtil.Db.UserPreference("newlook3", "false").ToBool() && DbUtil.Db.UserPreference("newpeoplepage", "false").ToBool())
         HyperLink2.NavigateUrl = "~/Person2/" + id.ToString();
     else
         HyperLink2.NavigateUrl = "~/Person2/" + id.ToString();
     HyperLink2.Text = "Return to: " + person.Name;
 }
开发者ID:vs06,项目名称:bvcms,代码行数:14,代码来源:UploadPicture.aspx.cs


示例9: FieldEqual

 public bool FieldEqual(Person p, string field, string value)
 {
     if (value is string)
         value = ((string)value).TrimEnd();
     if (!Util.HasProperty(p, field))
         return false;
     var o = Util.GetProperty(p, field);
     if (o is string)
         o = ((string)o).TrimEnd();
     var p2 = new Person();
     Util.SetPropertyFromText(p2, field, value);
     var o2 = Util.GetProperty(p2, field);
     if (o == o2)
         return true;
     if (o.IsNull() && o2.IsNotNull())
         return false;
     return o.Equals(o2);
 }
开发者ID:vs06,项目名称:bvcms,代码行数:18,代码来源:PersonModel.cs


示例10: AddPerson

        public void AddPerson(Person p, int entrypoint)
        {
            Family f;
            if (p == null)
                f = new Family
                {
                    AddressLineOne = AddressLineOne,
                    AddressLineTwo = AddressLineTwo,
                    CityName = City,
                    StateCode = State,
                    ZipCode = ZipCode,
                    CountryName = Country,
                    HomePhone = Phone.GetDigits().Truncate(20),
                };
            else
                f = p.Family;
            DbUtil.Db.SubmitChanges();

            var position = DbUtil.Db.ComputePositionInFamily(age, married == 20 , f.FamilyId) ?? 10;
            _person = Person.Add(f, position,
                null, FirstName.Trim(), null, LastName.Trim(), DateOfBirth, married == 20, gender ?? 0,
                    OriginCode.Enrollment, entrypoint);
            person.EmailAddress = EmailAddress.Trim();
            person.SendEmailAddress1 = true;
            person.CampusId = DbUtil.Db.Setting("DefaultCampusId", "").ToInt2();
            person.CellPhone = Phone.GetDigits().Truncate(20);

            if (count == 0)
                person.Comments = "Added during online registration because record was not found";
            else if(count > 1)
                person.Comments = "Added during online registration because there was more than 1 match";

            DbUtil.Db.SubmitChanges();
            DbUtil.Db.Refresh(RefreshMode.OverwriteCurrentValues, person);
            PeopleId = person.PeopleId;
            Log("AddPerson");
        }
开发者ID:vanutama,项目名称:bvcms,代码行数:37,代码来源:AddNew.cs


示例11: detach_People

		private void detach_People(Person entity)
		{
			this.SendPropertyChanging();
			entity.BaptismType = null;
		}
开发者ID:stevesloka,项目名称:bvcms,代码行数:5,代码来源:BaptismType.cs


示例12: AddPerson

        internal void AddPerson(int originid, int? entrypointid, int? campusid)
        {
            Family f;
            string na = "na";
            if (FamilyId > 0)
                f = family;
            else
                f = new Family
                        {
                            HomePhone = homephone.GetDigits(),
                            AddressLineOne = address.Disallow(na),
                            AddressLineTwo = address2,
                            CityName = city.Disallow(na),
                            StateCode = state.Disallow(na),
                            ZipCode = zip.Disallow(na),
                            CountryName = country,
                        };

            if (goesby != null)
                goesby = goesby.Trim();
            var position = PositionInFamily.Child;
            if (!birthday.HasValue)
                position = PositionInFamily.PrimaryAdult;
            if (age >= 18)
                if (f.People.Count(per =>
                                   per.PositionInFamilyId == PositionInFamily.PrimaryAdult)
                    < 2)
                    position = PositionInFamily.PrimaryAdult;
                else
                    position = PositionInFamily.SecondaryAdult;

            _Person = Person.Add(f, position,
                                 null, first.Trim(), goesby, last.Trim(), dob, false, gender,
                                 originid, entrypointid);
            if (title.HasValue())
                person.TitleCode = title;
            person.EmailAddress = email.Disallow(na);
            person.MaritalStatusId = marital;
            person.SuffixCode = suffix;
            person.MiddleName = middle;
            if (campusid == 0)
                campusid = null;
            person.CampusId = Util.PickFirst(campusid.ToString(), DbUtil.Db.Setting("DefaultCampusId", "")).ToInt2();
            if (person.CampusId == 0)
                person.CampusId = null;

            person.CellPhone = phone.GetDigits();
            DbUtil.Db.SubmitChanges();
            DbUtil.LogActivity("OldUI AddPerson {0}".Fmt(person.PeopleId));
            DbUtil.Db.Refresh(RefreshMode.OverwriteCurrentValues, person);
            PeopleId = person.PeopleId;
        }
开发者ID:hkouns,项目名称:bvcms,代码行数:52,代码来源:SearchPersonModel.cs


示例13: attach_People

 private void attach_People(Person entity)
 {
     this.SendPropertyChanging();
     entity.MemberLetterStatus = this;
 }
开发者ID:rossspoon,项目名称:bvcms,代码行数:5,代码来源:MemberLetterStatus.cs


示例14: attach_People

		private void attach_People(Person entity)
		{
			this.SendPropertyChanging();
			entity.Family = this;
		}
开发者ID:stevesloka,项目名称:bvcms,代码行数:5,代码来源:Family.cs


示例15: detach_People

		private void detach_People(Person entity)
		{
			this.SendPropertyChanging();
			entity.Family = null;
		}
开发者ID:stevesloka,项目名称:bvcms,代码行数:5,代码来源:Family.cs


示例16: UpdateField

 private void UpdateField(Person p, string[] a, string prop, string s, object value)
 {
     if (names.ContainsKey(s))
         if (value != null)
             p.UpdateValue(psb, prop, value);
 }
开发者ID:GSBCfamily,项目名称:bvcms,代码行数:6,代码来源:UploadPeopleModel.cs


示例17: GetAttendance

        private Paragraph GetAttendance(Person p)
        {
            var q = from a in p.Attends
                    where a.AttendanceFlag
                    orderby a.MeetingDate.Date descending
                    group a by a.MeetingDate.Date
                    into g
                    select g.Key;
            var list = q.ToList();

            var attstr = new StringBuilder("\n");
            var dt = Util.Now;
            var yearago = dt.AddYears(-1);
            while (dt > yearago)
            {
                var dt2 = dt.AddDays(-7);
                var indicator = ".";
                foreach (var d in list)
                {
                    if (d < dt2)
                        break;
                    if (d <= dt)
                    {
                        indicator = "P";
                        break;
                    }
                }
                attstr.Insert(0, indicator);
                dt = dt2;
            }
            var ph = new Paragraph(attstr.ToString(), monofont);
            ph.SetLeading(0, 1.2f);

            attstr = new StringBuilder();
            foreach (var d in list.Take(8))
                attstr.Insert(0, $"{d:d}  ");
            if (list.Count > 8)
            {
                attstr.Insert(0, "...  ");
                var q2 = q.OrderBy(d => d).Take(Math.Min(list.Count - 8, 3));
                foreach (var d in q2.OrderByDescending(d => d))
                    attstr.Insert(0, $"{d:d}  ");
            }
            ph.Add(new Chunk(attstr.ToString(), smallfont));
            return ph;
        }
开发者ID:stevesloka,项目名称:bvcms,代码行数:46,代码来源:FamilyResult.cs


示例18: detach_EnvPeople

		private void detach_EnvPeople(Person entity)
		{
			this.SendPropertyChanging();
			entity.EnvelopeOption = null;
		}
开发者ID:stevesloka,项目名称:bvcms,代码行数:5,代码来源:EnvelopeOption.cs


示例19: UpdatePerson

        private void UpdatePerson(Person p, PersonInfo m, bool isNew)
        {
            var psb = new List<ChangeDetail>();
            var fsb = new List<ChangeDetail>();
            var keys = Request.Form.AllKeys.ToList();

            if (!m.home.HasValue() && m.cell.HasValue())
                m.home = m.cell;

            if (keys.Contains("zip") || keys.Contains("addr"))
            {
                var result = AddressVerify.LookupAddress(m.addr, p.PrimaryAddress2, null, null, m.zip.Zip5());
                if (result.found != false && !result.error.HasValue() && result.Line1 != "error")
                {
                    UpdateField(fsb, p.Family, "AddressLineOne", result.Line1);
                    UpdateField(fsb, p.Family, "AddressLineTwo", result.Line2);
                    UpdateField(fsb, p.Family, "CityName", result.City);
                    UpdateField(fsb, p.Family, "StateCode", result.State);
                    UpdateField(fsb, p.Family, "ZipCode", result.Zip.GetDigits().Truncate(10));
                    var rc = DbUtil.Db.FindResCode(result.Zip, null);
                    UpdateField(fsb, p.Family, "ResCodeId", rc.ToString());
                }
                else
                {
                    if (keys.Contains("addr"))
                        UpdateField(fsb, p.Family, "AddressLineOne", m.addr);
                    UpdateField(fsb, p.Family, "ZipCode", m.zip.Zip5());
                    UpdateField(fsb, p.Family, "CityName", null);
                    UpdateField(fsb, p.Family, "StateCode", null);
                }
            }

            if (keys.Contains("home"))
                UpdateField(fsb, p.Family, "HomePhone", m.home.GetDigits());
            if (keys.Contains("goesby"))
                UpdateField(psb, p, "NickName", Trim(m.goesby));
            if (keys.Contains("first"))
                UpdateField(psb, p, "FirstName", Trim(m.first));
            if (keys.Contains("last"))
                UpdateField(psb, p, "LastName", Trim(m.last));
            if (keys.Contains("dob"))
            {
                DateTime dt;
                DateTime.TryParse(m.dob, out dt);
                if (p.BirthDate != dt)
                    UpdateField(psb, p, "DOB", m.dob);
            }
            if (keys.Contains("email"))
                UpdateField(psb, p, "EmailAddress", Trim(m.email));
            if (keys.Contains("cell"))
                UpdateField(psb, p, "CellPhone", m.cell.GetDigits());
            if (keys.Contains("marital"))
                UpdateField(psb, p, "MaritalStatusId", m.marital);
            if (keys.Contains("gender"))
                UpdateField(psb, p, "GenderId", m.gender);

            var rr = p.GetRecReg();
            if (keys.Contains("allergies"))
                if (m.allergies != rr.MedicalDescription)
                    p.SetRecReg().MedicalDescription = m.allergies;
            if (keys.Contains("grade"))
                if (m.AskGrade)
                    if (m.grade.ToInt2() != p.Grade)
                        p.Grade = m.grade.ToInt2();
            if (m.AskEmFriend)
            {
                if (keys.Contains("parent"))
                    if (m.parent != rr.Mname)
                        p.SetRecReg().Mname = m.parent;
                if (keys.Contains("emfriend"))
                    if (m.emfriend != rr.Emcontact)
                        p.SetRecReg().Emcontact = m.emfriend;
                if (keys.Contains("emphone"))
                    if (m.emphone != rr.Emphone)
                        p.SetRecReg().Emphone = m.emphone.Truncate(50);
            }
            if (isNew)
            {
                if (keys.Contains("campusid"))
                    if (m.campusid > 0)
                        UpdateField(psb, p, "CampusId", m.campusid);
            }
            if (m.AskChurch)
                if (keys.Contains("activeother"))
                    if (m.activeother.ToBool() != rr.ActiveInAnotherChurch)
                        p.SetRecReg().ActiveInAnotherChurch = m.activeother.ToBool();
            if (m.AskChurchName)
                if (keys.Contains("churchname"))
                    UpdateField(psb, p, "OtherPreviousChurch", Trim(m.churchname));

            p.LogChanges(DbUtil.Db, psb);
            p.Family.LogChanges(DbUtil.Db, fsb, p.PeopleId, Util.UserPeopleId ?? 0);
            DbUtil.Db.SubmitChanges();
            if (DbUtil.Db.Setting("NotifyCheckinChanges", "true").ToBool() && (psb.Count > 0 || fsb.Count > 0))
            {
                var sb = new StringBuilder();
                foreach (var c in psb)
                    sb.AppendFormat("<tr><td>{0}</td><td>{1}</td><td>{2}</td></tr>\n", c.Field, c.Before, c.After);
                foreach (var c in fsb)
                    sb.AppendFormat("<tr><td>{0}</td><td>{1}</td><td>{2}</td></tr>\n", c.Field, c.Before, c.After);
//.........这里部分代码省略.........
开发者ID:stevesloka,项目名称:bvcms,代码行数:101,代码来源:APICheckin2Controller.cs


示例20: AddPerson

        public ActionResult AddPerson(string data)
        {
            // Authenticate first
            var result = AuthenticateUser();
            if (!result.IsValid) return AuthorizationError(result);

            // Check Role
            if (!CMSRoleProvider.provider.IsUserInRole(AccountModel.UserName2, "Attendance"))
                return BaseMessage.createErrorReturn("Attendance role is required to take attendance for organizations.");

            BaseMessage dataIn = BaseMessage.createFromString(data);
            MobilePostAddPerson mpap = JsonConvert.DeserializeObject<MobilePostAddPerson>(dataIn.data);
            mpap.clean();

            var p = new Person();

            p.CreatedDate = Util.Now;
            p.CreatedBy = Util.UserId;

            p.MemberStatusId = MemberStatusCode.JustAdded;
            p.AddressTypeId = 10;

            p.FirstName = mpap.firstName;
            p.LastName = mpap.lastName;
            p.Name = "";

            if (mpap.goesBy.Length > 0)
                p.NickName = mpap.goesBy;

            if (mpap.birthday != null)
            {
                p.BirthDay = mpap.birthday.Value.Day;
                p.BirthMonth = mpap.birthday.Value.Month;
                p.BirthYear = mpap.birthday.Value.Year;
            }

            p.GenderId = mpap.genderID;
            p.MaritalStatusId = mpap.maritalStatusID;

            Family f;

            if (mpap.familyID > 0)
            {
                f = DbUtil.Db.Families.First(fam => fam.FamilyId == mpap.familyID);
            }
            else
            {
                f = new Family();

                if (mpap.homePhone.Length > 0)
                    f.HomePhone = mpap.homePhone;

                if (mpap.address.Length > 0)
                    f.AddressLineOne = mpap.address;

                if (mpap.address2.Length > 0)
                    f.AddressLineTwo = mpap.address2;

                if (mpap.city.Length > 0)
                    f.CityName = mpap.city;

                if (mpap.state.Length > 0)
                    f.StateCode = mpap.state;

                if (mpap.zipcode.Length > 0)
                    f.ZipCode = mpap.zipcode;

                if (mpap.country.Length > 0)
                    f.CountryName = mpap.country;

                DbUtil.Db.Families.InsertOnSubmit(f);
            }

            f.People.Add(p);

            p.PositionInFamilyId = PositionInFamily.Child;

            if (mpap.birthday != null && p.GetAge() >= 18)
            {
                if (f.People.Count(per => per.PositionInFamilyId == PositionInFamily.PrimaryAdult) < 2)
                    p.PositionInFamilyId = PositionInFamily.PrimaryAdult;
                else
                    p.PositionInFamilyId = PositionInFamily.SecondaryAdult;
            }

            p.OriginId = OriginCode.Visit;
            p.FixTitle();

            if (mpap.eMail.Length > 0)
                p.EmailAddress = mpap.eMail;

            if (mpap.cellPhone.Length > 0)
                p.CellPhone = mpap.cellPhone;

            if (mpap.homePhone.Length > 0)
                p.HomePhone = mpap.homePhone;

            p.MaritalStatusId = mpap.maritalStatusID;
            p.GenderId = mpap.genderID;

//.........这里部分代码省略.........
开发者ID:vanutama,项目名称:bvcms,代码行数:101,代码来源:MobileAPIController.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Classes.NodeView类代码示例发布时间:2022-05-24
下一篇:
C# CmsData.Organization类代码示例发布时间: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