예제 #1
0
        public Achievements(Details parent)
        {
            Parent = parent;

            Parent.Achievements = this;

            Ratings = new List<UserRating>();
        }
예제 #2
0
        public Achievements(Details parent, DataRow row)
            : this(parent)
        {
            Extract(row);

            foreach (DataRow ratingRow in new UtilityFunctions().
                RunQuery(
                    Transactions.GetUserRatings,
                    AddParameter(
                        Property.AchievementsId,
                        AchievementsId)).Rows)
            {
                new UserRating(this, ratingRow);
            }
        }
예제 #3
0
        private void InsertGroupMember(Details payingUser)
        {
            GroupMember currentMember = new GroupMember(
                (new DetailsCollection((List<Details>)Session[Local.SearchedUsers.ToString()])).Find(
                    userSelected.SelectedValue));

            currentMember.KitHire = kitHire.Checked;
            currentMember.Payer = payingUser;

            if (!Group.Parent.CanJoin)
            {
                ((MasterPageMobi)Master).OpenConfirmWindow(
                    WindowType.Error,
                    ErrorMessage.FlightFull,
                    false);

                return;
            }

            if (!Group.AddMember(currentMember))
            {
                ((MasterPageMobi)Master).OpenConfirmWindow(
                    WindowType.Error,
                    ErrorMessage.UserOnFlight,
                    false);

                return;
            }

            if(Group.GroupMembers.Count == 1)
            {
                // Add the group to a real group collection instead of the temp lists.
                Group.GroupMembers[0].UserDetails.Groups.Add(Group);

                // Remove group from temp list
                Group.GroupMembers[0].UserDetails.CreatedGroups.Remove(Group);
            }

            Session[Local.Group.ToString()] = Group;

            DataBindings();
            ((MasterPageMobi)Master).ResetAndRefresh();
        }
예제 #4
0
        private Details GetUserDetails()
        {
            DetailsUser = (Details)Session[Local.UserDetails.ToString()];
            if (DetailsUser != null && DetailsUser.User.IsOnline) return DetailsUser;

            MembershipUser user = (MembershipUser)Session[Local.ThisUser.ToString()];

            if (user == null)
            {
                user = Membership.GetUser();

                if (user == null || !user.IsOnline)
                {
                    ((Site1)Page.Master).Login(null, null);
                    ((Site1)Page.Master).CloseConfirmWindow();

                    return null;
                }
            }

            DetailsUser = PlaneCollection.Users.Find(x => x.User.ProviderUserKey.ToString() == user.ProviderUserKey.ToString());
            Session[Local.UserDetails.ToString()] = DetailsUser;

            return DetailsUser;
        }
예제 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DetailsUser = GetUserDetails();

            if (Page.IsPostBack) return;

            BindDropDownLists();
            SetDefaults();
        }
예제 #6
0
        protected void RegisterUser_CreatedUser(object sender, EventArgs e)
        {
            FormsAuthentication.SetAuthCookie(RegisterUser.UserName, false /* createPersistentCookie */);

            Details userDetails = new Details(Membership.GetUser(RegisterUser.UserName));

            userDetails.Balance = 0;
            userDetails.Forename = string.Empty;
            userDetails.Surname = string.Empty;
            userDetails.Address = string.Empty;
            userDetails.Town = string.Empty;
            userDetails.County = string.Empty;
            userDetails.Country = string.Empty;
            userDetails.Postcode = string.Empty;
            userDetails.Mobile = string.Empty;

            userDetails.ReApprovalAt = DateTime.Now.Date;
            userDetails.Approved = true;

            userDetails.Insert();

            Session[Local.ThisUser.ToString()] = userDetails.User;
            PlaneCollection.Users.Add(userDetails);
        }
예제 #7
0
파일: Medical.cs 프로젝트: sliplow/Skyline
 public Medical(Details parent, DataRow row)
     : this(parent)
 {
     Extract(row);
 }
예제 #8
0
        private static void GenerateAchievement(Details details)
        {
            Achievements achievements = new Achievements(details);
            achievements.JumpNumber = new Random().Next(5001);
            achievements.IsMilitary = Convert.ToBoolean(new Random().Next(2));
            achievements.APANumber = new Random().Next(5001);
            achievements.BPANumber = new Random().Next(1000000, 2000000);
            achievements.FAINumber = GetLicense(achievements) + new Random().Next(100000, 200000);
            achievements.PackingCert = Convert.ToBoolean(new Random().Next(2));

            achievements.TrainingMethod = Achievements.TrainingMethodCollection[new Random().Next(Achievements.TrainingMethodCollection.Count)];

            Random ratingRandom = new Random();
            for (int counter = 0; counter < new Random().Next(GroupType.RatingCollection.Count); counter++)
            {
                UserRating userRating = new UserRating(achievements);

                Rating rating = GroupType.RatingCollection[ratingRandom.Next(GroupType.RatingCollection.Count)];
                while (achievements.Ratings.Exists(x => x.Rating == rating))
                {
                    rating = GroupType.RatingCollection[ratingRandom.Next(GroupType.RatingCollection.Count)];
                }

                userRating.Rating = rating;

                userRating.IsCoach = Convert.ToBoolean(new Random().Next(2));
            }
        }
예제 #9
0
 public NextOfKin(Details parent, DataRow row)
     : this(parent)
 {
     Extract(row);
 }
예제 #10
0
 public Equipment(Details parent, DataRow row)
     : this(parent)
 {
     Extract(row);
 }
예제 #11
0
        public Equipment(Details parent)
        {
            Parent = parent;

            Parent.Equipments.Add(this);
        }
예제 #12
0
        private static void GenerateNextOfKin(Details details)
        {
            Random firstNameRnd = new Random();
            Random surNameRnd = new Random();
            Random houseNoRnd = new Random();
            Random roadPt1Rnd = new Random();
            Random roadPt2Rnd = new Random();

            Random townsRnd = new Random();
            Random countiesRnd = new Random();
            Random countriesRnd = new Random();
            Random postCodeRnd = new Random();

            Random phoneHomeRnd = new Random();
            Random phoneWorkRnd = new Random();
            Random mobileRnd = new Random();

            for (int counter = 0; counter < new Random().Next(5); counter++)
            {
                NextOfKin nextOfKin = new NextOfKin(details);

                nextOfKin.Forename = Firstnames[firstNameRnd.Next(Firstnames.Count)];
                nextOfKin.Surname = Surnames[surNameRnd.Next(Surnames.Count)];
                nextOfKin.Address = houseNoRnd.Next(1, 251) + " " +
                    RoadPart1[roadPt1Rnd.Next(RoadPart1.Count)] + " " +
                    RoadPart2[roadPt2Rnd.Next(RoadPart2.Count)];

                nextOfKin.Town = Towns[townsRnd.Next(Towns.Count)];
                nextOfKin.County = Counties[countiesRnd.Next(Counties.Count)];
                nextOfKin.Country = Countries[countriesRnd.Next(Countries.Count)];
                nextOfKin.Postcode = PostCodes[postCodeRnd.Next(PostCodes.Count)] + new Random().Next(1, 21)
                    + " " + new Random().Next(1, 21) + PostCodes[postCodeRnd.Next(PostCodes.Count)];

                nextOfKin.PhoneHome = "02" + phoneHomeRnd.Next(100000000, 1000000000).ToString();
                nextOfKin.PhoneWork = "02" + phoneWorkRnd.Next(100000000, 1000000000).ToString();
                nextOfKin.Mobile = "07" + mobileRnd.Next(100000000, 1000000000).ToString();
            }
        }
예제 #13
0
 private static void GenerateMedical(Details details)
 {
     Medical medical = new Medical(details);
     medical.DoctorForename = Firstnames[new Random().Next(Firstnames.Count)];
     medical.DoctorSurname = Surnames[new Random().Next(Surnames.Count)];
     medical.ExpiryDate = DateTime.Now.AddYears(new Random().Next(6));
 }
예제 #14
0
        private static void GenerateEquipment(Details details)
        {
            Random containerRnd = new Random();
            Random mainCanopyRnd = new Random();
            Random reserveCanopyRnd = new Random();
            Random skyHookRnd = new Random();
            Random AADRnd = new Random();
            Random repackByDateRnd = new Random();
            Random approvedRnd = new Random();

            for (int counter = 0; counter < new Random().Next(5); counter++)
            {
                Equipment equipment = new Equipment(details);

                equipment.Container = Container[containerRnd.Next(Container.Count)];
                equipment.MainCanopy = MainCanopy[mainCanopyRnd.Next(MainCanopy.Count)];
                equipment.ReserveCanopy = ReserveCanopy[reserveCanopyRnd.Next(ReserveCanopy.Count)];
                equipment.Skyhook = Convert.ToBoolean(skyHookRnd.Next(2));
                equipment.AAD = AAD[AADRnd.Next(AAD.Count)];
                equipment.RepackByDate = DateTime.Now.AddMonths(repackByDateRnd.Next(7));
                equipment.Approved = Convert.ToBoolean(approvedRnd.Next(2));
            }
        }
예제 #15
0
        private void InsertGroupMember(Details payingUser)
        {
            GroupMember currentMember = new GroupMember(
                (new DetailsCollection((List<Details>)Session[Local.SearchedUsers.ToString()])).Find(
                    userSelected.SelectedValue));

            currentMember.KitHire = kitHire.Checked;
            currentMember.Payer = payingUser;

            if (!Group.Parent.CanJoin)
            {
                ((Site1)Master).OpenConfirmWindow(
                    WindowType.Error,
                    ErrorMessage.FlightFull,
                    false);

                return;
            }

            if (!Group.AddMember(currentMember))
            {
                ((Site1)Master).OpenConfirmWindow(
                    WindowType.Error,
                    ErrorMessage.UserOnFlight,
                    false);

                return;
            }

            Session[Local.Group.ToString()] = Group;

            DataBindings();
            ((Site1)Master).ResetAndRefresh();
        }
예제 #16
0
        public NextOfKin(Details parent)
        {
            Parent = parent;

            Parent.NextOfKins.Add(this);
        }
예제 #17
0
파일: Medical.cs 프로젝트: sliplow/Skyline
        public Medical(Details parent)
        {
            Parent = parent;

            Parent.Medicals.Add(this);
        }
예제 #18
0
 public GroupMember(Details membershipUser)
 {
     UserDetails = membershipUser;
 }
예제 #19
0
        private static Details CreateUser(DateTime reApproveAt)
        {
            string forename = Firstnames[new Random().Next(Firstnames.Count)];
            string surname = Surnames[new Random().Next(Surnames.Count)];

            while (PlaneCollection.Users.Exists(x => x.User.UserName == forename + surname))
            {
                forename = Firstnames[new Random().Next(Firstnames.Count)];
                surname = Surnames[new Random().Next(Surnames.Count)];
            }

            Details details = new Details(
                Membership.CreateUser(
                    forename + surname,
                    "testing",
                    "*****@*****.**"));

            details.Balance = 2000;
            details.Forename = forename;
            details.Surname = surname;
            details.Address = new Random().Next(1, 251) + " " +
                RoadPart1[new Random().Next(RoadPart1.Count)] + " " +
                RoadPart2[new Random().Next(RoadPart2.Count)];

            details.Town = Towns[new Random().Next(Towns.Count)];
            details.County = Counties[new Random().Next(Counties.Count)];
            details.Country = Countries[new Random().Next(Countries.Count)];

            Random postcodeRnd = new Random();
            details.Postcode = PostCodes[postcodeRnd.Next(PostCodes.Count)] + new Random().Next(1, 21) + " ";
            details.Postcode += new Random().Next(1, 21) + PostCodes[postcodeRnd.Next(PostCodes.Count)];

            details.DateOfBirth = new DateTime(
                new Random().Next(1920, 1998),
                new Random().Next(1, 13),
                new Random().Next(1, 28));

            details.Weight = new Random().Next(60, 101);
            details.Height = new Random().Next(120, 201);
            details.PhoneHome = "02" + new Random().Next(100000000, 999999999).ToString();
            details.PhoneWork = "02" + new Random().Next(100000000, 999999999).ToString();
            details.Mobile = "07" + new Random().Next(100000000, 999999999).ToString();

            details.Approved = true;
            details.ReApprovalAt = reApproveAt;

            details.Occupation =  Details.OccupationCollection[
                new Random().Next(Details.OccupationCollection.Count)];

            PlaneCollection.Users.Add(details);

            return details;
        }