Пример #1
0
        public role AddRole(society soc, String Profession, String Description,
            DateTime StartedDate,
            String Affect,
            String Locn, String Country, String skills_list)
        {
            role r = null;
            int index = roleExists(Profession, StartedDate);
            if (index == -1)
            {
                r = new role();
                roles.Add(r);
            }
            else
            {
                r = (role)roles[index];
            }
            r.Profession = new profession(Profession);
            r.Description = Description;
            r.Affect = Affect;
            r.SetAcquiredDate(StartedDate);

            if (skills_list != "")
            {
                String[] skills_str = skills_list.Split(',');
                for (int i = 0; i < skills_str.Length; i++)
                {
                    String s = skills_str[i];
                    r.Skills.Add(new skill(s.Trim()));
                }
            }

            int locn_index = soc.LocationExists(Locn, Country);
            if (locn_index > -1)
                r.Locn = (location)soc.locations[locn_index];
            else
                r.Locn = soc.AddLocation(Locn, Country, "");

            return (r);
        }
Пример #2
0
 public personalityLocation AddLocation(society soc,
     String Name, String Country,
     float Latitude, float longitude,
     String Type, String Affect,
     DateTime Date)
 {
     location locn = soc.AddLocation(Name, Country, Type);
     personalityLocation plocn = new personalityLocation();
     plocn.Locn = locn;
     plocn.Date = Date;
     plocn.Affect = Affect;
     locations.Add(plocn);
     return (plocn);
 }