private void AddCallsignToGroup(string callsign, int groupID)
        {
            Business.GroupRole currentUserGroupRole = GetCurrentUserGroupRole(groupID);

            if (currentUserGroupRole != Business.GroupRole.AssistantSquadLeader && currentUserGroupRole != Business.GroupRole.SquadLeader && currentUserGroupRole != Business.GroupRole.ZoneLead)
            {
                throw new Exception("Access denied.");
            }

            using (var db = new DataAccess.CSSDataContext())
            {
                var group = db.Groups.FirstOrDefault(p => p.Id == groupID);

                if (group == null)
                {
                    throw new Exception("Invalid groupID");
                }

                var alias = db.Alias.FirstOrDefault(p => p.Callsign == callsign);

                if (alias == null)
                {
                    throw new Exception("Invalid callsign");
                }

                var targetRole = db.GroupRoles.FirstOrDefault(p => p.Name == "Pilot");

                if (targetRole == null)
                {
                    throw new Exception("No pilot role.");
                }

                DataAccess.Group_Alias_GroupRole gagrTarget = new DataAccess.Group_Alias_GroupRole()
                {
                    AliasId     = alias.Id,
                    GroupId     = group.Id,
                    GroupRoleId = targetRole.Id
                };

                db.Group_Alias_GroupRoles.InsertOnSubmit(gagrTarget);

                // If the group name is the Moderators group, then add the Moderator role to the group member.
                if (group.Name.Equals("Moderators", StringComparison.InvariantCultureIgnoreCase) == true)
                {
                    var moderatorRole = db.Roles.FirstOrDefault(p => p.Name == "Moderator");
                    var loginRole     = db.Login_Roles.FirstOrDefault(p => p.LoginId == alias.LoginId && p.RoleId == moderatorRole.Id);
                    if (loginRole == null)
                    {
                        db.Login_Roles.InsertOnSubmit(new DataAccess.Login_Role()
                        {
                            LoginId = alias.LoginId,
                            RoleId  = moderatorRole.Id
                        });
                    }
                }

                // If the group is ACS, then bank the original alias, and swap the alias to an ACS_COM_XXX hider.
                if (group.Tag.Equals("acs", StringComparison.InvariantCultureIgnoreCase) == true)
                {
                    BankAlias(db, alias);
                }

                db.SubmitChanges();
            }

            Response.Redirect("~/Squads/Default.aspx?groupID=" + groupID, true);
        }
        private void AddCallsignToGroup(string callsign, int groupID)
        {
            Business.GroupRole currentUserGroupRole = GetCurrentUserGroupRole(groupID);

            if (currentUserGroupRole != Business.GroupRole.AssistantSquadLeader && currentUserGroupRole != Business.GroupRole.SquadLeader && currentUserGroupRole != Business.GroupRole.ZoneLead)
                throw new Exception("Access denied.");

            using (var db = new DataAccess.CSSDataContext())
            {
                var group = db.Groups.FirstOrDefault(p => p.Id == groupID);

                if (group == null)
                    throw new Exception("Invalid groupID");

                var alias = db.Alias.FirstOrDefault(p => p.Callsign == callsign);

                if (alias == null)
                    throw new Exception("Invalid callsign");

                var targetRole = db.GroupRoles.FirstOrDefault(p => p.Name == "Pilot");

                if (targetRole == null)
                    throw new Exception("No pilot role.");

                DataAccess.Group_Alias_GroupRole gagrTarget = new DataAccess.Group_Alias_GroupRole()
                {
                    AliasId = alias.Id,
                    GroupId = group.Id,
                    GroupRoleId = targetRole.Id
                };

                db.Group_Alias_GroupRoles.InsertOnSubmit(gagrTarget);

                // If the group name is the Moderators group, then add the Moderator role to the group member.
                if (group.Name.Equals("Moderators", StringComparison.InvariantCultureIgnoreCase) == true)
                {
                    var moderatorRole = db.Roles.FirstOrDefault(p => p.Name == "Moderator");
                    var loginRole = db.Login_Roles.FirstOrDefault(p => p.LoginId == alias.LoginId && p.RoleId == moderatorRole.Id);
                    if (loginRole == null)
                    {
                        db.Login_Roles.InsertOnSubmit(new DataAccess.Login_Role()
                        {
                            LoginId = alias.LoginId,
                            RoleId = moderatorRole.Id
                        });
                    }
                }

                // If the group is ACS, then bank the original alias, and swap the alias to an ACS_COM_XXX hider.
                if (group.Tag.Equals("acs", StringComparison.InvariantCultureIgnoreCase) == true)
                {
                    BankAlias(db, alias);

                }

                db.SubmitChanges();
            }

            Response.Redirect("~/Squads/Default.aspx?groupID=" + groupID, true);
        }