public GoogleSheetsSettingDialog(UserProvider.UserDTO user, List <IAccountSettings> accounts, List <IAccountSettings> sharedAccounts) { InitializeComponent(); groupBox2.Visible = false; groupBox3.Visible = false; groupBox4.Visible = false; groupBox5.Visible = false; ((Control)this.tabPage2).Enabled = false; this.MappingDataView.EditMode = DataGridViewEditMode.EditOnEnter; this.loggedUser = user; this.userGoogleAccounts = SettingsManager.GetAllUserAccountsInSource(accounts, Sources.GoogleSheets); this.sharedUserGSAccounts = SettingsManager.GetAllUserAccountsInSource(sharedAccounts, Sources.GoogleSheets); foreach (var item in userGoogleAccounts) { AccountsNameComboBox.Items.Add(item.Name); } foreach (var item in sharedUserGSAccounts) { ShareAccountsComboBox.Items.Add(item.Name); } }
public TrelloSettingDialog(UserProvider.UserDTO user, List <IAccountSettings> accounts, List <IAccountSettings> sharedAccounts) { InitializeComponent(); this.loggedUser = user; this.userTrelloAccounts = SettingsManager.GetAllUserAccountsInSource(accounts, Sources.Trello); this.sharedUserTrelloAccounts = SettingsManager.GetAllUserAccountsInSource(sharedAccounts, Sources.Trello); PrepareDialog(); }
public static Boolean DeleteAccount(this UserProvider.UserDTO currentUser, IAccountSettings accountToDelete, Boolean DeleteForAllUsers) { Boolean succeed = false; ServiceAccountDTO targetAccountToDelete = accountToDelete.ConvertToDAO(accountToDelete); succeed = services.DeleteAccount(currentUser.UserID, targetAccountToDelete, DeleteForAllUsers); return(succeed); }
public static Boolean CreateNewAccount(this UserProvider.UserDTO currentUser, IAccountSettings newAccount) { Boolean succeed = false; ServiceAccountDTO targetnewAccount = newAccount.ConvertToDAO(newAccount); succeed = services.CreateNewAccount(currentUser.UserID, targetnewAccount); return(succeed); }
public static Boolean ShareTheSettingAccount(this UserProvider.UserDTO currentUser, IAccountSettings accountToShare, String shareUserName, Boolean owner) { Boolean succeed = false; ServiceAccountDTO targetAccountToShare = accountToShare.ConvertToDAO(accountToShare); succeed = services.ShareTheSettingAccount(currentUser.UserID, targetAccountToShare, shareUserName, owner); return(succeed); }
public static IAccountSettings GetDetailsForAccount(this UserProvider.UserDTO currentUser, Int32 accountId, Boolean owner = true) { ServiceAccountDTO serviceAcc = services.GetUserAccountsByUserIDAndAccountId(currentUser.UserID, accountId); IAccountSettings targetAcc = GetCurrentInstance(serviceAcc); targetAcc = targetAcc.ConvertFromDAO(serviceAcc); targetAcc.Owner = owner; return(targetAcc); }
public SettingsDialog(UserProvider.UserDTO loggedUser) { InitializeComponent(); this.loggedUser = loggedUser; this.userAccounts = loggedUser.GetAllUserAccounts(); this.sharedUserAccounts = loggedUser.GetAllSharedUserAccounts(); dbSetingDialog = new DBSettingDialog(loggedUser, userAccounts, sharedUserAccounts); trelloSettingDialog = new TrelloSettingDialog(loggedUser, userAccounts, sharedUserAccounts); gsSettingDialog = new GoogleSheetsSettingDialog(loggedUser, userAccounts, sharedUserAccounts); excelSettingsDialog = new ExcelSettingsDialog(loggedUser, userAccounts, sharedUserAccounts); }
/// <summary> /// Get user setting for each adapter. Where current user is owner. /// </summary> /// <param name="currentUser"> Logged user.</param> /// <returns></returns> public static List <IAccountSettings> GetAllUserAccounts(this UserProvider.UserDTO currentUser) { ServiceAccountDTO[] allAcc = services.GetAllUserAccountsByUserID(currentUser.UserID); List <IAccountSettings> targetAccs = new List <IAccountSettings>(); foreach (ServiceAccountDTO account in allAcc) { IAccountSettings acc = GetCurrentInstance(account); if (acc != null) { acc = acc.ConvertFromDAO(account); acc.Owner = true; targetAccs.Add(acc); } } return(targetAccs); }