示例#1
0
 public int AddBreeder(People breeder)
 {
     if (MyDogBreederList == null)
         MyDogBreederList = new List<People>();
     MyDogBreederList.Add(breeder);
     return MyDogBreederList.Count;
 }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!FoundSystemAdmin())
            {
                MembershipCreateStatus outstatus;
                MembershipUser newUser = Membership.CreateUser(AdminName, AdminPW, AdminEmail, PWQuestion, PWAnswer, true, out outstatus);
                if (!Roles.RoleExists(AdminRole))
                {
                    Roles.CreateRole(AdminRole);
                }
                Roles.AddUserToRole(AdminName, AdminRole);

                string strUser_ID = newUser.ProviderUserKey.ToString();
                Guid newUserId = new Guid(strUser_ID);
                //Guid newUserId = (Guid)newUser.ProviderUserKey;

                Addresses address = new Addresses();
                address.Address_1 = "Grasmere";
                address.Address_2 = "Findon Road";
                address.Address_Town = "Findon";
                address.Address_City = string.Empty;
                address.Address_County = "West Sussex";
                address.Address_Postcode = "BN14 0RD";

                Guid? address_ID = (Guid?)address.Insert_Address(newUserId);

                if (address_ID != null)
                {
                    People person = new People();
                    person.Person_Forename = "Daren";
                    person.Person_Surname = "Cantrell";
                    person.Address_ID = address_ID;
                    person.Person_Mobile = "07880 883089";
                    person.Person_Landline = "01903 877336";
                    person.Person_Email = AdminEmail;

                    Guid? person_ID = person.Insert_Person(newUserId);

                    if (person_ID != null)
                    {
                        UserPerson userPerson = new UserPerson();
                        userPerson.User_ID = newUserId;
                        userPerson.Person_ID = (Guid)person_ID;

                        Guid? user_Person_ID = userPerson.Insert_User_Person(newUserId);
                    }
                }
                RunOnceMessage.Text = string.Format("System Admin setup correctly {0}", "");
            }
            else
                RunOnceMessage.Text = string.Format("System Admin already setup {0}", "");
        }
示例#3
0
        public int AddOwner(People owner)
        {
            if (MyDogOwnerList == null)
                MyDogOwnerList = new List<People>();
            bool foundOwner = false;
            foreach (People o in MyDogOwnerList)
            {
                if (o.Person_ID == owner.Person_ID)
                    foundOwner = true;
            }
            if (!foundOwner)
                MyDogOwnerList.Add(owner);

            return MyDogOwnerList.Count;
        }
示例#4
0
        public List<People> GetPeopleByPerson_Surname(string person_Surname)
        {
            List<People> peopleList = new List<People>();
            PeopleBL people = new PeopleBL();
            tblPeople = people.GetPeopleByPerson_Surname(person_Surname);

            if (tblPeople != null && tblPeople.Count > 0)
            {
                foreach (sss.tblPeopleRow row in tblPeople)
                {
                    People person = new People(row.Person_ID);
                    peopleList.Add(person);
                }
            }

            return peopleList;
        }
示例#5
0
        public List<People> GetPeopleByAddress_ID(Guid address_ID)
        {
            List<People> peopleList = new List<People>();
            PeopleBL people = new PeopleBL();
            tblPeople = people.GetPeopleByAddress_ID(address_ID);

            if (tblPeople != null && tblPeople.Count > 0)
            {
                foreach (sss.tblPeopleRow row in tblPeople)
                {
                    People person = new People(row.Person_ID);
                    peopleList.Add(person);
                }
            }

            return peopleList;
        }