Пример #1
0
        private void ViewAllMembers()
        {
            var db      = new OOPCSEntities();
            var members = db.Members.ToArray();

            this.grdViewAllMember.DataSource = members;
        }
Пример #2
0
        public MemberView(Member member)
        {
            this.id       = member.id;
            this.Fullname = member.Fullname;
            this.Gender   = member.Gender == true ? "Nam" : "Nữ"; //đúng la nam, ngược lại là nữ
            if (member.Birthday != null)
            {
                this.Birthday = String.Format("{0}/{1}/{2}",
                                              member.Birthday.Value.Day,
                                              member.Birthday.Value.Month,
                                              member.Birthday.Value.Year);
            }
            if (member.Status.HasValue)
            {
                this.Status = member.Status.Value == true ? "living" : "Decease";
            }
            this.Birthplace = member.Birthplace;
            this.Living     = member.Living;
            this.Occupation = member.Occupation;
            var db = new OOPCSEntities();

            if (member.Father_id.HasValue)
            {
                var father = db.Members.Find(member.Father_id.Value);
            }
            if (member.Mother_id.HasValue)
            {
                var mother = db.Members.Find(member.Mother_id.Value);
            }
            if (member.Spouse_id.HasValue)
            {
                var spouse = db.Members.Find(member.Spouse_id.Value);
            }
        }
Пример #3
0
        private void ViewAllMembers()
        {
            var db          = new OOPCSEntities();
            var members     = db.Members.ToArray();
            var memberViews = new MemberView[members.Length];

            for (int i = 0; i < members.Length; i++)
            {
                memberViews[i] = new MemberView(members[i]);
            }
            this.grdMembers.DataSource = members;
        }