public void SetData(TeamProfile profile)
        {
            this.profile = profile;
            if (profile == null || lblName == null)
            {
                return;
            }

            lblName.Text      = profile.SchoolName;
            lblPosts.Text     = LargeValueHelper.GetString(profile.Posts);
            lblSport.Text     = profile.SportName;
            lblRecord.Text    = profile.Wins + "W " + profile.Loss + "L " + profile.Ties + "T";
            lblRanking.Text   = profile.Ranking;
            lblPosts.Text     = LargeValueHelper.GetString(profile.Posts);
            lblFollowers.Text = LargeValueHelper.GetString(profile.Followers);
            if (profile.IsProfileAdmin)
            {
                btnAdmin.Text = "You are an admin of this profile";
            }

            isFollowing = profile.IsFollowing;
            Views.SetFollowed(btnFollow, isFollowing);

            if (!string.IsNullOrEmpty(profile.ProfileUrl))
            {
                ImageService.Instance.LoadUrl(profile.ProfileUrl).Transform(new CircleTransformation()).Retry(3, 300).Into(imgProfile);
            }
        }
 private void Client_TeamProfileInfos(StandardServerAskTeam infos)
 {
     if (!FormExecution.IsWindowOpen <TeamProfile>())
     {
         TeamProfile tp = new TeamProfile(this);
     }
     LoadTeamProfile?.Invoke(infos.ID, infos.Emblem, infos.Name, infos.Tag, infos.Wins, infos.Loses, infos.Rank, infos.LeaderID, infos.ColeaderID, infos.Members, infos.Score, infos.Stats);
 }
Exemple #3
0
 public void CreateTeamProfile(string name, HouseEnum house, CharacterClassEnum cast, string image)
 {
     if (!_dataService.IsFileExist(FileNames.TeamProfile))
     {
         TeamProfile profile = new TeamProfile(name, house, cast, image);
         _dataService.CreateFile(FileNames.TeamProfile);
         SaveToFile(profile);
     }
 }
Exemple #4
0
        public int TeamRow()
        {
            string      querry = "SELECT TeamId FROM TeamProfile ORDER BY TeamId DESC";
            DataTable   table  = DatabaseProvider.Instance.ExcuteQuerry(querry);
            DataRow     row    = table.Rows[0];
            TeamProfile team   = new TeamProfile(row);

            return(team.TeamId);
        }
Exemple #5
0
        public UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath, TeamProfile item)
        {
            var cell = tableView.DequeueReusableCell("SchoolAthleteCell", indexPath) as SchoolAthleteCell;

            cell.SetData(item, indexPath.Row, (pos, btnFollow) =>
            {
                var model = teamProfileSource.Items[pos];
                Shared.Follower.ToggleFollow(btnFollow, model, model.Id, FeedType.Team);
            }, NavigationController);
            cell.SelectionStyle = UITableViewCellSelectionStyle.None;
            return(cell);
        }
 public void SetView(TeamProfile profile)
 {
     this.profile = profile;
     if (!string.IsNullOrEmpty(profile.TwitterUrl))
     {
         btnTwitter.Superview.Hidden = false;
     }
     if (!string.IsNullOrEmpty(profile.FacebookUrl))
     {
         btnFacebook.Superview.Hidden = false;
     }
     if (!string.IsNullOrEmpty(profile.InstagramUrl))
     {
         btnInstagram.Superview.Hidden = false;
     }
 }
        View GetTeamsView(TeamProfile item, int position, View convertView, ViewGroup parent)
        {
            View view = convertView;

            if (view == null)
            {
                view = Activity.LayoutInflater.Inflate(Resource.Layout.SportTeamsItem, null);
                view.FindViewById <Button>(Resource.Id.btnFollow).Click += (sender, e) =>
                {
                    var model = teamsAdapter.Items[(int)view.Tag];
                    Shared.Follower.FollowToggle(ActivityProgresDialog, sender as Button, model, model.Id, FeedType.Team);
                };

                view.FindViewById <ImageViewAsync>(Resource.Id.imgProfile).Click += (sender, e) =>
                {
                    var model = teamsAdapter.Items[(int)view.Tag];
                    Navigator.GoToTeamProflie(model.Id, false);
                };

                view.FindViewById <TextView>(Resource.Id.lblName).Click += (sender, e) =>
                {
                    var model = teamsAdapter.Items[(int)view.Tag];
                    Navigator.GoToTeamProflie(model.Id, false);
                };
            }
            view.Tag = position;

            view.FindViewById <TextView>(Resource.Id.lblName).Text     = item.SchoolName;
            view.FindViewById <TextView>(Resource.Id.lblSubtitle).Text = item.SportName;

            var profileImageView = view.FindViewById <ImageViewAsync>(Resource.Id.imgProfile);

            profileImageView.Tag?.CancelPendingTask(item.ProfileUrl);
            var task = ImageService.Instance.LoadUrl(item.ProfileUrl)
                       .Retry(3, 300)
                       .LoadingPlaceholder(Resource.Drawable.DefProfPic.ToString(), ImageSource.CompiledResource)
                       .Into(profileImageView);

            profileImageView.Tag = new ImageLoaderHelper(task);

            Views.SetFollowed(view.FindViewById <Button>(Resource.Id.btnFollow), item.IsFollowing);

            return(view);
        }
        void GetData()
        {
            var apiTask = new ServiceApi().GetTeamProfile(TeamId);

            apiTask.HandleError();
            apiTask.OnSucess(response =>
            {
                profile = response.Result;
                aboutController.SetView(profile);
                rankingsController.SetView(profile);
                lblTitle.UserInteractionEnabled = true;

                lblName.Text        = response.Result.SchoolName;
                lblTitle.Text       = response.Result.SchoolName;
                lblSport.Text       = response.Result.SportName;
                lblBottomSport.Text = response.Result.SportName;

                lblPosts.Text     = LargeValueHelper.GetString(response.Result.Posts);
                lblFollowers.Text = LargeValueHelper.GetString(response.Result.Followers);
                lblRecord.Text    = $"{profile.Wins}W {profile.Loss}L {profile.Ties}T";
                lblRanking.Text   = profile.Ranking;

                var color = ColorHelper.GetColor(profile.PrimaryColor, btnBack.Superview.BackgroundColor);
                btnBack.Superview.BackgroundColor = color;
                btnProfile.Superview.Superview.BackgroundColor = color;

                //btnAdmin.SetTitle("Become an Admin of this profile", UIControlState.Normal);
                Views.SetFollowed(btnFollow, response.Result.IsFollowing);

                if (!string.IsNullOrEmpty(response.Result.ProfileUrl))
                {
                    ImageService.Instance.LoadUrl(response.Result.ProfileUrl).Retry(3, 300).Into(imgProfile);
                }

                if (profile.IsProfileAdmin)
                {
                    btnAdmin.SetTitle("You are an admin of this profile", UIControlState.Normal);
                }
            });
        }
Exemple #9
0
 public TeamProfileDTO(TeamProfile profile) : base(profile.Icon, profile.Image, profile.NumberOfWins, profile.TotalGames)
 {
 }
 public void TeamProfile_OnClick()
 {
     TeamProfile.GetComponent <Image>().sprite   = ButtonPic[1];
     PlayerProfile.GetComponent <Image>().sprite = ButtonPic[0];
 }
Exemple #11
0
 public void SetData(TeamProfile profile)
 {
     this.profile = profile;
     SetView();
 }
Exemple #12
0
 public ProfileQr(TeamProfile teamProfile)
 {
     Name  = teamProfile.Name;
     Score = teamProfile.Score;
 }
 public void SetData(TeamProfile item, int position, Action <int, UIButton> followClicked, UINavigationController navigationController)
 {
     SetView(item.ProfileUrl, item.SchoolName, item.SportName, false, position, followClicked, item.IsFollowing, navigationController, item.Id);
 }
Exemple #14
0
 public void SetView(TeamProfile profile)
 {
     this.profile   = profile;
     lblRecord.Text = profile.Wins + "W " + profile.Loss + "L " + profile.Ties + "T";
     btnRankings.SetTitle("Check the latest " + profile.SportName + " rankings", UIControlState.Normal);
 }