public async Task <bool> TestConnection(string subName) { DAL.DirtbagDAL dirtbag = new DAL.DirtbagDAL(); var curSettings = await GetSettings(subName); return(await dirtbag.TestConnection(curSettings, subName)); }
public async Task<bool> TestConnection(Models.DirtbagSettings newSettings, string subName ) { Models.DirtbagSettings curSettings = await GetSettings( subName ); DAL.DirtbagDAL dirtbag = new DAL.DirtbagDAL(); if( curSettings == null || curSettings.DirtbagUrl != newSettings.DirtbagUrl ) { //no current settings OR url changed, don't allow using saved password. return await dirtbag.TestConnection( newSettings, subName ); } else if(string.IsNullOrWhiteSpace( newSettings.DirtbagPassword)) { //url did NOT change, and password wasn't updated return await dirtbag.TestConnection( curSettings.DirtbagUrl, newSettings.DirtbagUsername, curSettings.DirtbagPassword, subName ); } else { return await dirtbag.TestConnection( newSettings, subName ); } }
public async Task <bool> TestConnection(Models.DirtbagSettings newSettings, string subName) { Models.DirtbagSettings curSettings = await GetSettings(subName); DAL.DirtbagDAL dirtbag = new DAL.DirtbagDAL(); if (curSettings == null || curSettings.DirtbagUrl != newSettings.DirtbagUrl) { //no current settings OR url changed, don't allow using saved password. return(await dirtbag.TestConnection(newSettings, subName)); } else if (string.IsNullOrWhiteSpace(newSettings.DirtbagPassword)) { //url did NOT change, and password wasn't updated return(await dirtbag.TestConnection(curSettings.DirtbagUrl, newSettings.DirtbagUsername, curSettings.DirtbagPassword, subName)); } else { return(await dirtbag.TestConnection(newSettings, subName)); } }
public async Task<bool> TestConnection(string subName ) { DAL.DirtbagDAL dirtbag = new DAL.DirtbagDAL(); var curSettings = await GetSettings( subName ); return await dirtbag.TestConnection( curSettings, subName ); }