コード例 #1
0
ファイル: MemberVM.cs プロジェクト: Easy-DDI-Organizer/EDO
 public MemberVM(Member member, string organizationName)
 {
     this.member = member;
     this.bakMember = null;
     this.organizationName = organizationName;
     this.bakOrganizationName = null;
 }
コード例 #2
0
ファイル: Group.cs プロジェクト: Easy-DDI-Organizer/EDO
        public Group()
        {
            InstanceId = IDUtils.NewGuid();
            Id = IDUtils.NewGuid();
            this.studyUnitRelPathNames = new List<string>();
            ConceptSchemeCompareTable = new CompareTable() { CompareType = CompareTable.CompareTypes.ConceptScheme };
            ConceptCompareTable = new CompareTable() { CompareType = CompareTable.CompareTypes.Concept };
            VariableCompareTable = new CompareTable() { CompareType = CompareTable.CompareTypes.Variable };
            PurposeId = IDUtils.NewGuid();
            ComparisonId = IDUtils.NewGuid();
            SharedStudyUnit = new StudyUnit(); //グループ内で共有する変数など
            SharedStudyUnit.Abstract.Title = SHARED_STUDY_UNIT_TITLE;
            Organization organization = new Organization();
            Member member = new Member();
            member.OrganizationId = organization.Id;
            SharedStudyUnit.AddMember(member);
            SharedStudyUnit.AddOrganization(organization);

            SharedStudyUnit.Samplings.Add(new Sampling());
            SharedStudyUnit.Samplings[0].MemberId = member.Id;
            SharedStudyUnit.Samplings[0].DateRange = new DateRange(DateTime.Today, DateTime.Today);
        }
コード例 #3
0
ファイル: DDI3Writer.cs プロジェクト: Easy-DDI-Organizer/EDO
 private XElement CreateIndividual(Member member)
 {
     ///// a:Individual Memberの生成
     XElement individual = new XElement(a + TAG_INDIVIDUAL,
         CreateIDAttribute(member.Id));
     //IndividualName?
     XElement individualName = new XElement(a + TAG_INDIVIDUAL_NAME);
     //First?
     individualName.Add(CreateNullable(a + TAG_FIRST, member.FirstName));
     //Last?
     individualName.Add(CreateNullable(a + TAG_LAST, member.LastName));
     individual.Add(EmptyToNull(individualName));
     //Position*
     XElement position = new XElement(a + TAG_POSITION);
     //Title
     position.Add(CreateNullable(a + TAG_TITLE, member.Position));
     individual.Add(EmptyToNull(position));
     //r:Description*
     individual.Add(CreateNullable(r + TAG_DESCRIPTION, Options.RoleLabel(member.RoleCode)));
     //Relation*
     individual.Add(
         new XElement(a + TAG_RELATION,
             CreateReferenceID(a + TAG_ORGANIZATION_REFERENCE, member.OrganizationId),
             new XElement(r + TAG_DESCRIPTION) //r:Description+
             ));
     return individual;
 }
コード例 #4
0
ファイル: DDI2IO.cs プロジェクト: Easy-DDI-Organizer/EDO
 protected static void SetupMemberName(string str, Member member)
 {
     List<string> elems = str.Split(',').Select(p => p.Trim()).ToList();
     if (elems.Count != 2)
     {
         return;
     }
     string lastName = elems[0];
     string firstName = elems[1];
     if (!string.IsNullOrEmpty(lastName))
     {
         member.LastName = lastName;
     }
     if (!string.IsNullOrEmpty(firstName))
     {
         member.FirstName = firstName;
     }
 }
コード例 #5
0
ファイル: MemberVM.cs プロジェクト: Easy-DDI-Organizer/EDO
 public void EndEdit()
 {
     if (!inEdit)
     {
         return;
     }
     inEdit = false;
     bakMember = null;
     bakOrganizationName = null;
     if (this.EndEditAction != null)
     {
         this.EndEditAction(this);
     }
     Memorize();
 }
コード例 #6
0
ファイル: MemberVM.cs プロジェクト: Easy-DDI-Organizer/EDO
 public void CancelEdit()
 {
     if (!inEdit)
     {
         return;
     }
     inEdit = false;
     this.LastName = bakMember.LastName;
     this.FirstName = bakMember.FirstName;
     this.Position = bakMember.Position;
     this.RoleCode = bakMember.RoleCode;
     this.OrganizationName = bakOrganizationName;
     bakMember = null;
 }
コード例 #7
0
ファイル: MemberVM.cs プロジェクト: Easy-DDI-Organizer/EDO
        public void BeginEdit()
        {
            if (inEdit)
            {
                return;
            }
            inEdit = true;

            bakMember = member.Clone() as Member;
            //            bakRole = role == null ? null : role.Clone() as Option;
            bakOrganizationName = organizationName;
        }
コード例 #8
0
ファイル: DDI3Reader.cs プロジェクト: Easy-DDI-Organizer/EDO
        public static Member CreateMember(XElement individualElem)
        {
            Member memberModel = new Member();
            string id = (string)individualElem.Attribute(ATTR_ID);
            if (id == null)
            {
                return null;
            }
            memberModel.Id = id;
            XElement nameElem = individualElem.Element(a + TAG_INDIVIDUAL_NAME);
            if (nameElem != null)
            {
                memberModel.FirstName = (string)nameElem.Element(a + TAG_FIRST);
                memberModel.LastName = (string)nameElem.Element(a + TAG_LAST);
            }
            XElement posElem = individualElem.Element(a + TAG_POSITION);
            if (posElem != null)
            {
                memberModel.Position = (string)posElem.Element(a + TAG_TITLE);
            }
            string role = (string)individualElem.Element(r + TAG_DESCRIPTION);
            if (role != null)
            {
                memberModel.RoleCode = Options.RoleCodeByLabel(role);
            }

            XElement refElem = individualElem.Descendants(a + TAG_ORGANIZATION_REFERENCE).FirstOrDefault();
            if (refElem != null)
            {
                string refId = (string)refElem.Element(r + TAG_ID);
                memberModel.OrganizationId = refId;
            }
            return memberModel;
        }
コード例 #9
0
ファイル: StudyUnit.cs プロジェクト: Easy-DDI-Organizer/EDO
 public void AddMember(Member member)
 {
     this.Members.Add(member);
 }
コード例 #10
0
ファイル: DDI2Reader.cs プロジェクト: Easy-DDI-Organizer/EDO
 private static void CreateOrganization(XElement elem, Member member, List<Organization> organizations)
 {
     string organizationName = (string)elem.Attribute(ATTR_AFFILIATION);
     if (string.IsNullOrEmpty(organizationName))
     {
         organizationName = Resources.UndefinedValue;
     }
     Organization organization = Organization.FindOrganizationByName(organizations, organizationName);
     if (organization == null)
     {
         organization = new Organization() { OrganizationName = organizationName };
         organizations.Add(organization);
     }
     member.OrganizationId = organization.Id;
 }
コード例 #11
0
ファイル: DDI2Reader.cs プロジェクト: Easy-DDI-Organizer/EDO
 private static Member CreateMember(XElement memberElem, string roleCode)
 {
     Member member = new Member();
     SetupMemberName(memberElem.Value, member);
     if (roleCode == null)
     {
         string role = (string)memberElem.Attribute(ATTR_ROLE);
         roleCode = Options.RoleCodeByLabel(role);
     }
     member.RoleCode = roleCode;
     return member;
 }