private void SetInfo(PlayerInfo info) { PlayerInfo = info; txtFName.Text = info.FirstName; txtLName.Text = info.LastName; txtPName.Text = info.PatronymicName; cbxCountry.Items.Clear(); cbxCountry.Items.AddRange(Globals.Countries.ToArray()); cbxCountry.Text = info.Country; txtCity.Text = info.City; txtEMail.Text = info.EMail; txtPhone.Text = info.Phone; txtNName.Text = info.NickName; #if STANDARD || FEDITION_PLUS || STANDARD_PLUS || FEDITION foreach (Control control in pnlRating.Controls) { if (control is GameRatingControl) { GameRatingControl rating_control = control as GameRatingControl; PlayerRatingInfo rating = DatabaseManager.CurrentDb.GetPlayerBeginRating(rating_control.GameId, info.Id); if (rating != null) { rating_control.IsActive = rating.IsActive; rating_control.RatingBegin = rating.RatingBegin; } } } #else form.pnlRating.Visible = false; #endif }
private void SaveInfo() { PlayerInfo.FirstName = txtFName.Text; PlayerInfo.LastName = txtLName.Text; PlayerInfo.PatronymicName = txtPName.Text; PlayerInfo.Country = cbxCountry.Text; PlayerInfo.City = txtCity.Text; PlayerInfo.EMail = txtEMail.Text; PlayerInfo.Phone = txtPhone.Text; PlayerInfo.NickName = txtNName.Text; DatabaseManager.CurrentDb.PlayerInfoSave(PlayerInfo); PlayerRatingInfo rating = new PlayerRatingInfo(); rating.PlayerId = PlayerInfo.Id; foreach (Control control in pnlRating.Controls) { if (control is GameRatingControl) { GameRatingControl rating_control = control as GameRatingControl; rating.IsActive = rating_control.IsActive; rating.GameType = rating_control.GameId; rating.RatingBegin = rating_control.RatingBegin; DatabaseManager.CurrentDb.PlayerBeginRatingUpdate(rating); } } }
public fPlayerInfo() { InitializeComponent(); LocalizeComponents(); cbxCountry.BackColor = WindowSkin.Palette.TextBackColor; int top = 0; foreach (TypeOfSport sport in Globals.Games.Values) { GameRatingControl control = new GameRatingControl(); control.GameId = sport.Id; control.GameName = sport.Name; control.Location = new Point(0, top); control.Width = pnlRating.Width - 20; top += control.Height; pnlRating.Controls.Add(control); } }