private void DgvCompanyFilesCellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { //Get the selected company file CompanyFile companyFile = ((CompanyFile[])dgvCompanyFiles.DataSource)[e.RowIndex]; //Get configuration that matches server where file is IApiConfiguration config = companyFile.Uri.GetLeftPart(UriPartial.Path).ToLower().Contains(LocalApiUrl) ? _configurationLocal : _configurationCloud; //Get the credentials for the database var frmLogin = new LoginForm(); frmLogin.ShowDialog(this); if (frmLogin.Username.Length > 0) { ICompanyFileCredentials credentials = new CompanyFileCredentials(frmLogin.Username, frmLogin.Password); //load the Invoice List var frmInvoiceList = new InvoiceListForm(); frmInvoiceList.Initialise(config, companyFile, credentials, _oAuthKeyService); frmInvoiceList.Show(); } }
private void DgvCompanyFilesCellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { //Get the selected company file CompanyFile companyFile = ((CompanyFile[]) dgvCompanyFiles.DataSource)[e.RowIndex]; //Get configuration that matches server where file is IApiConfiguration config = companyFile.Uri.GetLeftPart(UriPartial.Path).ToLower().Contains(LocalApiUrl) ? _configurationLocal : _configurationCloud; //Get the credentials for the database var frmLogin = new LoginForm(); frmLogin.ShowDialog(this); if (frmLogin.Username.Length > 0) { ICompanyFileCredentials credentials = new CompanyFileCredentials(frmLogin.Username, frmLogin.Password); //load the Invoice List var frmInvoiceList = new InvoiceListForm(); frmInvoiceList.Initialise(config, companyFile, credentials, _oAuthKeyService); frmInvoiceList.Show(); } }