예제 #1
0
		public void AddHistory(PersonInfo p)
		{
			if (InvokeRequired) {
				Invoke(new Action<PersonInfo>(AddHistory), new[] { p });
				return;
			}
			history.Items.Insert(0, p);
		}
예제 #2
0
		public void ShowFamily(XDocument x)
		{
			xdoc = x;
			this.Focus();
			Program.FamilyId = x.Root.Attribute("familyid").Value.ToInt();

			list = new List<PersonInfo>();
			if (x.Descendants("member").Count() == 0) {
				ClearControls();
				var lab = new Label();
				lab.Font = pfont;
				lab.Location = new Point(15, 200);
				lab.AutoSize = true;
				pgup.Visible = false;
				pgdn.Visible = false;
				lab.Text = "Not Found, try another phone number, or 411?";
				this.Controls.Add(lab);
				Return.Text = "Try Again";
				controls.Add(lab);
				return;
			} else {
				Return.Text = "Return";
			}

			foreach (var e in x.Descendants("member")) {
				var a = new PersonInfo {
					pid = e.Attribute("id").Value.ToInt(),
					first = e.Attribute("first").Value,
					last = e.Attribute("last").Value,
					dob = e.Attribute("dob").Value,

					goesby = e.Attribute("goesby").Value,
					email = e.Attribute("email").Value,
					addr = e.Attribute("addr").Value,
					zip = e.Attribute("zip").Value,
					home = e.Attribute("home").Value.FmtFone(),
					cell = e.Attribute("cell").Value.FmtFone(),
					gender = e.Attribute("gender").Value.ToInt(),
					marital = e.Attribute("marital").Value.ToInt(),
					Row = list.Count,
					HasPicture = bool.Parse(e.Attribute("haspicture").Value),
					MemberStatus = e.Attribute("memberstatus").Value,
					access = e.Attribute("access").Value,
					notes = e.Value,
					visitcount = e.Attribute("visitcount").Value.ToInt(),
				};
				list.Add(a);
			}
			ShowPage(1);
		}