Esempio n. 1
0
        private void CreateTeams()
        {
            using (TaskboardEntities db = new TaskboardEntities())
            {
                for (int i = 0; i < dataAmount / 100; i++)
                {
                    try
                    {
                        if (creatorIndexes.Contains(i % 8))
                        {
                            string       uEmail = this.userEmails[i % 8] + i + emailDomain;
                            int          uId    = db.USER.FirstOrDefault(x => x.email == uEmail).id;
                            SqlParameter userId = new SqlParameter("@userId", uId);
                            SqlParameter title  = new SqlParameter("@teamName", this.teamNames[i % 8]);

                            db.Database.ExecuteSqlCommand("[Team.Create] @userId, @teamName", userId, title);
                        }
                    }

                    catch
                    {
                        continue;
                    }
                }
            }
        }
Esempio n. 2
0
        private void AddBoards()
        {
            using (TaskboardEntities db = new TaskboardEntities())
            {
                List <int> creatorsId = db.TEAM_USER.Where(x => x.role == "CREATOR").Select(u => u.id).ToList();

                for (int j = 0; j < creatorsId.Count; j++)
                {
                    for (int i = 0; i < dataAmount / 1000; i++)
                    {
                        try
                        {
                            SqlParameter userId    = new SqlParameter("@userId", creatorsId[j]);
                            SqlParameter title     = new SqlParameter("@title", boardNames[i % 8]);
                            SqlParameter projectId = new SqlParameter("@projectId", i);
                            SqlParameter teamId    = new SqlParameter("@teamId", i);

                            db.Database.ExecuteSqlCommand("[Board.Create] @userId, @title, @projectId, @teamId", new[] { userId, title, projectId, teamId });
                        }

                        catch
                        {
                            continue;
                        }
                    }
                }
            }
        }
Esempio n. 3
0
        private void AddUsersToTeam()
        {
            using (TaskboardEntities db = new TaskboardEntities())
            {
                List <int> creatorsId = db.TEAM_USER.Where(x => x.role == "CREATOR").Select(u => u.id).ToList();

                for (int j = 0; j < creatorsId.Count; j++)
                {
                    for (int i = 0; i < dataAmount / 100; i++)
                    {
                        try
                        {
                            SqlParameter userId    = new SqlParameter("@creatorId", creatorsId[j]);
                            SqlParameter teamId    = new SqlParameter("@teamId", i);
                            SqlParameter userEmail = new SqlParameter("@userEmail", this.userEmails[i % 8] + i + emailDomain);

                            var result = db.Database.ExecuteSqlCommand("[Team.AddUserToTeam] @creatorId, @teamId, @userEmail", new[] { userId, teamId, userEmail });
                        }

                        catch
                        {
                            continue;
                        }
                    }
                }
            }
        }
Esempio n. 4
0
        private void LoginUsers()
        {
            using (TaskboardEntities db = new TaskboardEntities())
            {
                for (int i = 0; i < dataAmount / 100; i++)
                {
                    try
                    {
                        SqlParameter email    = new SqlParameter("@email", this.userEmails[i % 8] + i + emailDomain);
                        SqlParameter password = new SqlParameter("@password", this.password);
                        db.Database.ExecuteSqlCommand("[User.Login] @email, @password", new[] { email, password });
                    }

                    catch
                    {
                        continue;
                    }
                }
            }
        }
Esempio n. 5
0
        private void RegisterUsers()
        {
            using (TaskboardEntities db = new TaskboardEntities())
            {
                for (int i = 0; i < dataAmount / 100; i++)
                {
                    try
                    {
                        string       mail     = $"{this.userEmails[i % 8]}{i}{emailDomain}";
                        SqlParameter email    = new SqlParameter("@email", mail);
                        SqlParameter password = new SqlParameter("@password", this.password);
                        SqlParameter name     = new SqlParameter("@name", this.userNames[i % 8]);
                        db.Database.ExecuteSqlCommand("[User.Register] @email, @password, @name", new[] { email, password, name });
                    }

                    catch
                    {
                        continue;
                    }
                }
            }
        }