Inheritance: INotifyPropertyChanging, INotifyPropertyChanged
 partial void DeletePrincipalInvestigator(PrincipalInvestigator instance);
Example #2
0
        protected virtual void UpdateGrantInvestigators(Grant grant, XElement node)
        {
            IList<XElement> pis = node.Elements("PI").ToList();
            if (pis.Count > 0)
            {
                foreach (XElement pi in pis)
                {
                    if(String.IsNullOrWhiteSpace(pi.Element("PI_ID").Value))
                    {
                        continue;
                    }
                    int principalInvestigatorId = Convert.ToInt32(pi.Element("PI_ID").Value.Replace("(contact)", "").Trim());

                    PrincipalInvestigator investigator = GetPrincipalInvestigator(principalInvestigatorId);

                    if(investigator == null)
                    {
                        investigator = new PrincipalInvestigator
                                           {
                                               PrincipalInvestigatorId = Guid.NewGuid(),
                                               Name = pi.Element("PI_NAME").Value.SafeTrim(),
                                               PrincipalInvestigator_Id = principalInvestigatorId
                                           };

                        grant.GrantPrincipals.Add(new GrantPrincipal() { PrincipalInvestigator = investigator, GrantPrincipalId = Guid.NewGuid() });
                    }
                    else
                    {
                        grant.GrantPrincipals.Add(new GrantPrincipal() { PrincipalInvestigatorId = investigator.PrincipalInvestigatorId, GrantPrincipalId = Guid.NewGuid() });
                    }
                }
            }
        }
 partial void UpdatePrincipalInvestigator(PrincipalInvestigator instance);
 partial void InsertPrincipalInvestigator(PrincipalInvestigator instance);
Example #5
0
 partial void DeletePrincipalInvestigator(PrincipalInvestigator instance);
Example #6
0
 partial void UpdatePrincipalInvestigator(PrincipalInvestigator instance);
Example #7
0
 partial void InsertPrincipalInvestigator(PrincipalInvestigator instance);