本文整理汇总了C#中CmsData.Family类的典型用法代码示例。如果您正苦于以下问题:C# Family类的具体用法?C# Family怎么用?C# Family使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Family类属于CmsData命名空间,在下文中一共展示了Family类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AddPerson
public ActionResult AddPerson(int id, PersonInfo m)
{
if (!Authenticate())
return Content("not authorized");
DbUtil.LogActivity("checkin AddPerson {0} {1} ({2})".Fmt(m.first, m.last, m.dob));
CmsData.Family f;
if (id > 0)
f = DbUtil.Db.Families.Single(fam => fam.FamilyId == id);
else
f = new CmsData.Family();
var position = PositionInFamily.Child;
if (Util.Age0(m.dob) >= 18)
if (f.People.Count(per =>
per.PositionInFamilyId == PositionInFamily.PrimaryAdult)
< 2)
position = PositionInFamily.PrimaryAdult;
else
position = PositionInFamily.SecondaryAdult;
var p = Person.Add(f, position,
null, m.first, m.goesby, m.last, m.dob, false, m.gender,
OriginCode.Visit, null);
UpdatePerson(p, m, isNew: true);
return Content(f.FamilyId.ToString() + "." + p.PeopleId);
}
开发者ID:rossspoon,项目名称:bvcms,代码行数:28,代码来源:APICheckin2Controller.cs
示例2: CheckInFamilyInfo
public CheckInFamilyInfo(Family family)
{
last = family.HeadOfHousehold.LastName;
homePhone = family.HomePhone;
address = family.AddressLineOne;
address2 = family.AddressLineTwo;
city = family.CityName;
state = family.StateCode;
zip = family.ZipCode;
country = family.CountryName;
}
开发者ID:GSBCfamily,项目名称:bvcms,代码行数:13,代码来源:CheckInFamilyInfo.cs
示例3: AddPerson
public ActionResult AddPerson(int id, PersonInfo m)
{
if (!AccountModel.AuthenticateMobile())
return Content("not authorized");
CmsData.Family f;
if (m.addtofamilyid > 0)
f = DbUtil.Db.Families.First(fam => fam.People.Any(pp => pp.PeopleId == m.addtofamilyid));
else
f = new CmsData.Family();
if (m.goesby == "(Null)")
m.goesby = null;
var position = PositionInFamily.Child;
if (m.dob.Age0() >= 18)
if (f.People.Count(per =>
per.PositionInFamilyId == PositionInFamily.PrimaryAdult)
< 2)
position = PositionInFamily.PrimaryAdult;
else
position = PositionInFamily.SecondaryAdult;
var p = Person.Add(f, position,
null, Trim(m.first), Trim(m.goesby), Trim(m.last), m.dob, false, m.gender,
OriginCode.Visit, null);
var z = DbUtil.Db.ZipCodes.SingleOrDefault(zc => zc.Zip == m.zip.Zip5());
if (!m.home.HasValue() && m.cell.HasValue())
m.home = m.cell;
if (m.addtofamilyid == 0)
{
p.Family.HomePhone = m.home.GetDigits();
p.Family.AddressLineOne = m.addr;
p.Family.CityName = z != null ? z.City : null;
p.Family.StateCode = z != null ? z.State : null;
p.Family.ZipCode = m.zip;
}
p.EmailAddress = Trim(m.email);
if (m.cell.HasValue())
p.CellPhone = m.cell.GetDigits();
p.MaritalStatusId = m.marital;
p.GenderId = m.gender;
DbUtil.Db.SubmitChanges();
DbUtil.LogActivity("iPhone AddPerson {0}".Fmt(p.PeopleId));
var meeting = DbUtil.Db.Meetings.Single(mm => mm.MeetingId == id);
Attend.RecordAttendance(p.PeopleId, id, true);
DbUtil.Db.UpdateMeetingCounters(id);
return new RollListResult(meeting, p.PeopleId);
}
开发者ID:hkouns,项目名称:bvcms,代码行数:50,代码来源:APIiPhoneController.cs
示例4: UpdateField
private void UpdateField(List<ChangeDetail> fsb, Family f, string prop, string value)
{
f.UpdateValue(fsb, prop, value);
}
开发者ID:stevesloka,项目名称:bvcms,代码行数:4,代码来源:APICheckin2Controller.cs
示例5: SetField
private void SetField(Family f, string[] a, string prop, string s, object value)
{
if (names.ContainsKey(s))
if (value != null)
Util.SetProperty(f, prop, value);
}
开发者ID:GSBCfamily,项目名称:bvcms,代码行数:6,代码来源:UploadPeopleModel.cs
示例6: UpdateField
private void UpdateField(Family f, string[] a, string prop, string s)
{
if (names.ContainsKey(s))
if (a[names[s]].HasValue())
f.UpdateValue(fsb, prop, a[names[s]]);
}
开发者ID:GSBCfamily,项目名称:bvcms,代码行数:6,代码来源:UploadPeopleModel.cs
示例7: Add
public static Person Add(Family fam, int position, Tag tag, string firstname, string nickname, string lastname, string dob, bool Married, int gender, int originId, int? EntryPointId)
{
return Add(fam, position, tag, firstname, nickname, lastname, dob, Married ? 20 : 10, gender, originId, EntryPointId);
}
开发者ID:alexserdyuk,项目名称:bvcms,代码行数:4,代码来源:Person.cs
示例8: AddPerson
public void AddPerson(Person p, int entrypoint)
{
Family f;
if (p == null)
f = new Family
{
AddressLineOne = address,
AddressLineTwo = address2,
CityName = city,
StateCode = state,
ZipCode = zip,
CountryName = country,
HomePhone = homephone,
};
else
f = p.Family;
_Person = Person.Add(f, PositionInFamily.Child,
null, first.Trim(), null, last.Trim(), dob, married == 20, gender ?? 0,
OriginCode.Enrollment, entrypoint);
person.EmailAddress = email.Trim();
person.SendEmailAddress1 = true;
person.SuffixCode = suffix;
person.MiddleName = middle;
person.CampusId = DbUtil.Db.Setting("DefaultCampusId", "").ToInt2();
if (person.Age >= 18)
person.PositionInFamilyId = PositionInFamily.PrimaryAdult;
person.CellPhone = phone.GetDigits();
DbUtil.Db.SubmitChanges();
DbUtil.LogActivity("OnlineReg AddPerson {0}".Fmt(person.PeopleId));
DbUtil.Db.Refresh(RefreshMode.OverwriteCurrentValues, person);
PeopleId = person.PeopleId;
}
开发者ID:hkouns,项目名称:bvcms,代码行数:34,代码来源:OnlineRegPersonModel.cs
示例9: UpdateField
private void UpdateField(StringBuilder fsb, Family f, string prop, string value)
{
f.UpdateValue(fsb, prop, value);
}
开发者ID:rossspoon,项目名称:bvcms,代码行数:4,代码来源:APICheckin2Controller.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();
if (Campus.ToInt() > 0)
person.CampusId = Campus.ToInt();
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:stevesloka,项目名称:bvcms,代码行数:39,代码来源:AddNew.cs
示例11: UpdateValue
private void UpdateValue(Family f, string field, object value)
{
var o = Util.GetProperty(f, field);
if (o == null && value == null)
return;
if (o != null && o.Equals(value))
return;
fsb.AppendFormat("<tr><td>{0}</td><td>{1}</td><td>{2}</td></tr>\n", field, o, value ?? "(null)");
Util.SetProperty(f, field, value);
}
开发者ID:rossspoon,项目名称:bvcms,代码行数:10,代码来源:AddressInfo.cs
示例12: Add
public static Person Add(CMSDataContext Db, bool SendNotices, Family fam, int position, Tag tag, string firstname, string nickname, string lastname, string dob, int MarriedCode, int gender, int originId, int? EntryPointId, bool testing = false)
{
var p = new Person();
p.CreatedDate = Util.Now;
p.CreatedBy = Util.UserId;
Db.People.InsertOnSubmit(p);
p.PositionInFamilyId = position;
p.AddressTypeId = 10;
if (firstname.HasValue())
p.FirstName = firstname.Trim().ToProper().Truncate(25);
else
p.FirstName = "";
if (nickname.HasValue())
p.NickName = nickname.Trim().ToProper().Truncate(15);
if (lastname.HasValue())
p.LastName = lastname.Trim().ToProper().Truncate(30);
else
p.LastName = "?";
p.GenderId = gender;
if (p.GenderId == 99)
p.GenderId = 0;
p.MaritalStatusId = MarriedCode;
DateTime dt;
if (Util.DateValid(dob, out dt))
{
while (dt.Year < 1900)
dt = dt.AddYears(100);
if (dt > Util.Now)
dt = dt.AddYears(-100);
p.BirthDay = dt.Day;
p.BirthMonth = dt.Month;
p.BirthYear = dt.Year;
if (p.GetAge() < 18 && MarriedCode == 0)
p.MaritalStatusId = MaritalStatusCode.Single;
}
else if (DateTime.TryParse(dob, out dt))
{
p.BirthDay = dt.Day;
p.BirthMonth = dt.Month;
if (Regex.IsMatch(dob, @"\d+[-/]\d+[-/]\d+"))
{
p.BirthYear = dt.Year;
while (p.BirthYear < 1900)
p.BirthYear += 100;
if (p.GetAge() < 18 && MarriedCode == 0)
p.MaritalStatusId = MaritalStatusCode.Single;
}
}
p.MemberStatusId = MemberStatusCode.JustAdded;
if (fam == null)
{
fam = new Family();
Db.Families.InsertOnSubmit(fam);
p.Family = fam;
}
else
fam.People.Add(p);
var PrimaryCount = fam.People.Where(c => c.PositionInFamilyId == PositionInFamily.PrimaryAdult).Count();
if (PrimaryCount > 2 && p.PositionInFamilyId == PositionInFamily.PrimaryAdult)
p.PositionInFamilyId = PositionInFamily.SecondaryAdult;
if (tag != null)
tag.PersonTags.Add(new TagPerson { Person = p });
p.OriginId = originId;
p.EntryPointId = EntryPointId;
p.FixTitle();
if (!testing)
Db.SubmitChanges();
if (SendNotices)
{
if (Util.UserPeopleId.HasValue
&& Util.UserPeopleId.Value != Db.NewPeopleManagerId
&& HttpContext.Current.User.IsInRole("Access")
&& !HttpContext.Current.User.IsInRole("OrgMembersOnly")
&& !HttpContext.Current.User.IsInRole("OrgLeadersOnly"))
Task.AddNewPerson(p.PeopleId);
else
Db.Email(Util.SysFromEmail, Db.GetNewPeopleManagers(),
"Just Added Person on " + Db.Host, "{0} ({1})".Fmt(p.Name, p.PeopleId));
}
return p;
}
开发者ID:hkouns,项目名称:bvcms,代码行数:90,代码来源:Person.cs
示例13: 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 = AddressInfo.Address1.Disallow(na),
AddressLineTwo = AddressInfo.Address2,
CityName = AddressInfo.City.Disallow(na),
StateCode = AddressInfo.State.Value.Disallow(na),
ZipCode = AddressInfo.Zip.Disallow(na),
CountryName = AddressInfo.Country.Value,
};
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 = CmsData.Person.Add(f, position,
null, First.Trim(), GoesBy, Last.Trim(), dob, false, Gender.Value.ToInt(),
originid, entrypointid);
if (Title.Value.HasValue())
person.TitleCode = Title.Value;
person.EmailAddress = Email.Disallow(na);
person.MaritalStatusId = Marital.Value.ToInt();
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.Db.Refresh(RefreshMode.OverwriteCurrentValues, person);
PeopleId = person.PeopleId;
}
开发者ID:rossspoon,项目名称:bvcms,代码行数:51,代码来源:SearchPersonModel.cs
示例14: detach_FamiliesHeaded2
private void detach_FamiliesHeaded2(Family entity)
{
this.SendPropertyChanging();
entity.HeadOfHouseholdSpouse = null;
}
开发者ID:GSBCfamily,项目名称:bvcms,代码行数:5,代码来源:Person.cs
示例15: SplitFamily
public void SplitFamily(CMSDataContext db)
{
var f = new Family
{
CreatedDate = Util.Now,
CreatedBy = Util.UserId1,
AddressLineOne = PrimaryAddress,
AddressLineTwo = PrimaryAddress2,
CityName = PrimaryCity,
StateCode = PrimaryState,
ZipCode = PrimaryZip,
HomePhone = Family.HomePhone
};
var oldf = this.FamilyId;
f.People.Add(this);
db.Families.InsertOnSubmit(f);
db.SubmitChanges();
}
开发者ID:alexserdyuk,项目名称:bvcms,代码行数:18,代码来源:Person.cs
示例16: Split
public ContentResult Split(int id)
{
var p = DbUtil.Db.LoadPersonById(id);
var f = new Family
{
CreatedDate = Util.Now,
CreatedBy = Util.UserId1,
AddressLineOne = p.PrimaryAddress,
AddressLineTwo = p.PrimaryAddress2,
CityName = p.PrimaryCity,
StateCode = p.PrimaryState,
ZipCode = p.PrimaryZip,
HomePhone = p.Family.HomePhone
};
f.People.Add(p);
DbUtil.Db.Families.InsertOnSubmit(f);
DbUtil.Db.SubmitChanges();
DbUtil.LogActivity("Splitting Family for {0}".Fmt(p.Name));
if (p == null)
return Content("/");
return Content("/Person2/" + id);
}
开发者ID:vs06,项目名称:bvcms,代码行数:22,代码来源:FamilyController.cs
示例17: AddPerson
internal void AddPerson(int originid, int? entrypointid, int? campusid)
{
Family f;
if (FamilyId > 0)
f = Family;
else
{
f = new Family();
AddressInfo.CopyPropertiesTo(f);
f.ResCodeId = AddressInfo.ResCode.Value.ToInt2();
f.HomePhone = HomePhone.GetDigits();
}
NickName = NickName?.Trim();
var position = DbUtil.Db.ComputePositionInFamily(Age ?? -1, MaritalStatus.Value == "20", FamilyId) ?? 10;
FirstName = FirstName.Trim();
if (FirstName == "na")
FirstName = "";
person = Person.Add(f, position,
null, FirstName.Trim(), NickName, LastName.Trim(), DOB, false, Gender.Value.ToInt(),
originid, entrypointid);
this.CopyPropertiesTo(Person);
Person.CellPhone = CellPhone.GetDigits();
if (campusid == 0)
campusid = null;
Person.CampusId = Util.PickFirst(campusid.ToString(), DbUtil.Db.Setting("DefaultCampusId", "")).ToInt2();
if (Person.CampusId == 0)
Person.CampusId = null;
DbUtil.Db.SubmitChanges();
DbUtil.LogActivity($"AddPerson {person.PeopleId}");
DbUtil.Db.Refresh(RefreshMode.OverwriteCurrentValues, Person);
PeopleId = Person.PeopleId;
}
开发者ID:GSBCfamily,项目名称:bvcms,代码行数:37,代码来源:PendingPersonModel.cs
示例18: attach_Families
private void attach_Families(Family entity)
{
this.SendPropertyChanging();
entity.Picture = this;
}
开发者ID:hkouns,项目名称:bvcms,代码行数:5,代码来源:Picture.cs
示例19: DoUpload
public bool DoUpload(string text, bool testing = false)
{
var rt = Db2.UploadPeopleRuns.OrderByDescending(mm => mm.Id).First();
var csv = new CsvReader(new StringReader(text), false, '\t');
var list = csv.ToList();
var list0 = list.First().Select(kk => kk).ToList();
names = list0.ToDictionary(i => i.TrimEnd(),
i => list0.FindIndex(s => s == i), StringComparer.OrdinalIgnoreCase);
if (names.ContainsKey("campus"))
{
var campuslist = (from li in list.Skip(1)
where li.Length == names.Count
group li by li[names["campus"]]
into campus
where campus.Key.HasValue()
select campus.Key).ToList();
var dbc = from c in campuslist
join cp in Db.Campus on c equals cp.Description into j
from cp in j.DefaultIfEmpty()
select new {cp, c};
var clist = dbc.ToList();
if (clist.Count > 0)
{
var maxcampusid = 0;
if (Db.Campus.Any())
maxcampusid = Db.Campus.Max(c => c.Id);
foreach (var i in clist)
if (i.cp == null)
{
var cp = new Campu {Description = i.c, Id = ++maxcampusid};
if (!testing)
Db.Campus.InsertOnSubmit(cp);
}
}
}
var now = DateTime.Now;
if (!testing)
Db.SubmitChanges();
Campuses = Db.Campus.ToDictionary(cp => cp.Description, cp => cp.Id);
var q = (from li in list.Skip(1)
where li.Length == names.Count
group li by li[names["familyid"]]
into fam
select fam).ToList();
rt.Count = q.Sum(ff => ff.Count());
Db2.SubmitChanges();
var standardnames = new List<string>
{
"familyid", "title", "first", "last", "goesby", "altname", "gender", "marital", "maidenName",
"address", "address2", "city", "state", "zip", "position", "birthday", "cellphone", "homephone",
"workphone", "email", "email2", "suffix", "middle", "joindate", "dropdate", "baptismdate", "weddingdate",
"memberstatus", "employer", "occupation"
};
var orgs = new Dictionary<string, int>();
var membertypes = new Dictionary<string, int>();
foreach (var fam in q)
{
Family f = null;
FindPerson3 pid;
Person p = null;
foreach (var a in fam)
{
var potentialdup = false;
var first = a[names["first"]];
var last = a[names["last"]];
DateTime dt;
DateTime? dob = null;
if (names.ContainsKey("birthday"))
if (DateTime.TryParse(a[names["birthday"]], out dt))
{
dob = dt;
if (dob.Value < SqlDateTime.MinValue)
dob = null;
}
string email = null;
string cell = null;
string homephone = null;
if (names.ContainsKey("email"))
email = a[names["email"]].Trim();
if (names.ContainsKey("cellphone"))
cell = a[names["cellphone"]].GetDigits();
if (names.ContainsKey("homephone"))
homephone = a[names["homephone"]].GetDigits();
pid = Db.FindPerson3(first, last, dob, email, cell, homephone, null).FirstOrDefault();
if (noupdate && pid != null)
{
if (!testing)
{
var pd = Db.LoadPersonById(pid.PeopleId.Value);
pd.AddEditExtraBool("FoundDup", true);
}
potentialdup = true;
pid = null;
//.........这里部分代码省略.........
开发者ID:GSBCfamily,项目名称:bvcms,代码行数:101,代码来源:UploadPeopleModel.cs
示例20: detach_Families
private void detach_Families(Family entity)
{
this.SendPropertyChanging();
entity.Picture = null;
}
开发者ID:hkouns,项目名称:bvcms,代码行数:5,代码来源:Picture.cs
注:本文中的CmsData.Family类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论