示例#1
0
    public void SetPlayerTeam(string teamName)
    {
        TeamId teamNameId = TeamId.NoId;

        if (teamName == "SantaOnkel")
        {
            teamNameId = TeamId.SantaOnkel;
        }
        else if (teamName == "SnakeMan")
        {
            teamNameId = TeamId.SnakeMan;
        }
        else
        {
            Debug.Log("String did not contain valid team name in enum TeamID");
            return;
        }

        if (!inputEnabled)
        {
            return;
        }

        Debug.Log("Team name" + teamNameId.ToString() + " player index:" + playerIndex);

        PlayerConfigurationManager.Instance.SetPlayerTeam(playerIndex, teamNameId);
        Debug.Log("PM instance set player blalbal done");

        readyPanel.SetActive(true);
        readyButton.Select();
        menuPanel.SetActive(false);
    }
        protected virtual Uri BuildDetailsUri(TeamId team)
        {
            var builder = new UriBuilder();

            builder.Scheme = "http";
            builder.Host   = Hostname;
            builder.Path   = "/team.php";
            builder.Query  = "team=" + team.ToString();
            return(builder.Uri);
        }
示例#3
0
        public void BindData(BindType bindType)
        {
            var queryArgument = new QueryArgument(UserContext.DataBaseInfo)
            {
                Key       = TeamId.ToString(),
                filter1   = Type,
                filter4   = bindType == BindType.List ? Constants.RetriveList : Constants.RetriveForm,
                FilterKey = Constants.TableWFComponents
            };
            var teamMasters = _controlPanel.GetTeams(queryArgument);

            if (teamMasters != null)
            {
                if (bindType == BindType.Form)
                {
                    var firstOrDefault = teamMasters.FirstOrDefault();
                    if (firstOrDefault == null)
                    {
                        return;
                    }
                    TeamId     = firstOrDefault.ComponentId;
                    TeamName   = firstOrDefault.ComponentDesp;
                    Categories = WebControls.SetCheckboxListSelectedItem(Categories, firstOrDefault.Relation1.SplitTo <string>(new string[] { Constants.DelimeterSinglePipe }).ToList());

                    Users = WebControls.SetCheckboxListSelectedItem(Users, firstOrDefault.wfComponentSubs.Select(x => x.WFCSCode).ToList());
                    uplForm.Update();
                }
                else
                {
                    var team = teamMasters.ToList();
                    if (UserContext.UserProfile.Designation.Id.Trim() != "SA")
                    {
                        if (teamMasters.Any())
                        {
                            team = teamMasters.Where(x => x.ComponentId.Trim() != "13").ToList();
                        }
                    }
                    GridViewTable.DataSource = team;
                    if (_newPageIndex >= 0)
                    {
                        GridViewTable.PageIndex = _newPageIndex;
                    }
                    GridViewTable.DataSource = team;
                    GridViewTable.DataBind();
                    UplView.Update();
                }
            }
        }
 public Guid CreateGuidFromSHA256Hash()
 {
     return(CreateGuidFromSHA256Hash(Encoding.UTF8.GetBytes(CreatedDateUTC.ToString() + ParticipantId.ToString() + TeamId.ToString())));
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     RegisterClientScriptBlock("loadTeam", String.Format("<script type=\"text/javascript\">LoadUserTeam('{0}');</script>", TeamId.ToString()));
 }
示例#6
0
        private bool isValidCrew()
        {
            // duplicate check on crews
            bool ret = true;

            if (string.IsNullOrEmpty(textBoxCrewNumber.Text.Trim()))
            {
                errorProvider1.SetError(textBoxCrewNumber, "Crew number cannot be empty");
                ret = false;
            }


            if (PilotId <= 0)
            {
                // only Navigator selected
                errorProvider1.SetError(comboBoxPilot, "Pilot cannot be empty");
                ret = false;
            }

            if (PilotId == NavigatorId && PilotId > 0)
            {
                //same person as pilot and as navigator
                errorProvider1.SetError(comboBoxPilot, "Pilot and Navigator cannot be the same person");
                ret = false;
            }

            if (PilotId > 0)
            {
                // compare to listdata, must have different TeamId
                if (ListTeamIdPilNavNames.Any(o => o.EndsWith(getPilNavNames(Pilot, Navigator)) && !(o.StartsWith(TeamId.ToString()))))
                {
                    // we have a duplicate team
                    errorProvider1.SetError(comboBoxPilot, "A duplicate team with the same names already exists");
                    ret = false;
                }
            }

            if (ret)
            {
                errorProvider1.Clear();
            }
            return(ret);
        }