private void ShareButton_Click(object sender, EventArgs e) { String shareUserName = ShareUserNameTB.Text; IAccountSettings result = userGoogleAccounts.SingleOrDefault(x => x.Name == ShareAccountsComboBox.SelectedItem.ToString()); if (SettingsManager.GetDetailsForAccount(loggedUser, result.ID) != null) { googleSheetsAccountSettings = (GoogleSheetsAccountSettings)SettingsManager.GetDetailsForAccount(loggedUser, result.ID); } if (shareUserName != String.Empty && shareUserName != loggedUser.UserLogin) { Boolean res = loggedUser.ShareTheSettingAccount(googleSheetsAccountSettings, shareUserName, PermitChangesCB.Checked); if (res) { RefreshSettings(); groupBox5.Visible = false; ShareUserNameTB.Text = null; } else { label12.Text = "Please try later"; } } else { MessageBox.Show("Error!"); label12.Text = "Invalid user name!"; } }
private void saveSharedAccountButton_Click(object sender, EventArgs e) { String shareUserName = shareUserNameBox.Text.Trim(); if (shareUserName != String.Empty && shareUserName != loggedUser.UserLogin) { Boolean result = loggedUser.ShareTheSettingAccount(userTrelloFullAccount, shareUserName, makeUserOwnerCheckBox.Checked); if (result) { RefreshSettingsAccountList(); ClearAllForm(); shearingGroupBox.Hide(); } else { labelSharedAccountError.Text = "Please try later"; labelSharedAccountError.Visible = true; } } else { labelSharedAccountError.Text = "Envalid user name!"; labelSharedAccountError.Visible = true; } }
private void btnSaveSharedAccount_Click(object sender, EventArgs e) { String shareUserName = txtShareUserName.Text.Trim(); if (shareUserName != String.Empty && shareUserName != loggedUser.UserLogin) { Boolean result = loggedUser.ShareTheSettingAccount(userDBFullAccount, shareUserName, chboxMakeUserOwner.Checked); if (result) { RefreshSettingsAccountList(); ClearAllForm(); panelNewShareAccount.Hide(); } else { lblSharedAccountError.Text = "Please try later"; lblSharedAccountError.Show(); } } else { lblSharedAccountError.Text = "Envalid user name!"; lblSharedAccountError.Show(); } }