private void SetUser(decimal userId) { if (userId == 0) { return; } Dac dac = new Dac(); Dictionary <string, object> values = dac.Select("User", "Id", userId).Result; UserNameTextBox.Text = (string)values["UserName"]; }
private void SelectUserButton_Click(object sender, EventArgs e) { UserListForm userListForm = new UserListForm(ShowMode.Select); if (userListForm.ShowDialog() == DialogResult.OK) { Dac dac = new Dac(); Dictionary <string, object> values = dac.Select("User", "Id", userListForm.SelectedUserId).Result; UserNameTextBox.Text = (string)values["UserName"]; this.userId = userListForm.SelectedUserId; } }
private void SetUIFromUserId(decimal userId) { if (userId == 0) { return; } Dac dac = new Dac(); IDictionary <string, object> values = dac.Select("User", "Id", userId).Result; UserNameTextBox.Text = values["UserName"].ToString(); UserIdTextBox.Text = values["Id"].ToString(); NameTextBox.Text = values["Name"].ToString(); DescriptionTextBox.Text = values["Description"].ToString(); FollowingCountTextBox.Text = values["FriendsCount"].ToString(); FollowersCountTextBox.Text = values["FollowersCount"].ToString(); LanguageTextBox.Text = values["Language"].ToString(); LocationTextBox.Text = values["Location"].ToString(); WebSiteTextBox.Text = values["Url"].ToString(); ProtectedCheckBox.Checked = values["Protected"].ToString() == "1"; ProfileImagePictureBox.ImageLocation = values["ProfileImageUrl400x400"].ToString(); SetComboBoxSelected(UserCategoryComboBox, values["UserCategoryId"]); }