void Login() { try { if (txtUsername.Text == string.Empty) { XtraMessageBox.Show("İstifadəçi adı daxil edin"); return; } if (txtPassword.Text == string.Empty) { XtraMessageBox.Show("Şifrə daxil edin"); return; } object lookUpConnectionsCurrentRow = lookUpConnections.GetSelectedDataRow(); if (lookUpConnectionsCurrentRow == null) { return; } ConnectionConfiguration SelectedConfig = (lookUpConnectionsCurrentRow as ConnectionConfiguration); StaticData.CurrentConnectionConfiguration = SelectedConfig; Operation <UserView> operation = OperationHandler.LoginUser(new LoginData { Login = txtUsername.Text, PassHash = StaticData.Cryptor.Encrypt(txtPassword.Text) }); if (operation.Successful) { StaticData.CurrentUser = operation.Value; PrivateProfileStringHandler.SetPrivateProfileString("USERNAME", txtUsername.Text); Close(); } else { XtraMessageBox.Show(operation.Fail); } } catch (Exception ex) { XtraMessageBox.Show("Bağlantı alınmadı /n" + ex.Message); } }