Skip to content

Commit

Permalink
Merge pull request #22 from netsho/set_transaction_adding_passsword
Browse files Browse the repository at this point in the history
Set transaction adding password
  • Loading branch information
netsho committed Jul 7, 2024
2 parents 5f50185 + f086587 commit 75c29e4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
4 changes: 4 additions & 0 deletions pwdvault/Forms/AddPassword.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

using System.Transactions;
using pwdvault.Models;
using pwdvault.Services;
using pwdvault.Controllers;
Expand Down Expand Up @@ -90,6 +92,7 @@ private void TxtBoxPwd_TextChanged(object sender, EventArgs e)
/// </summary>
private async Task AddPasswordDb()
{
using TransactionScope transaction = new ();
try
{
Cursor = Cursors.WaitCursor;
Expand All @@ -108,6 +111,7 @@ private async Task AddPasswordDb()
Cursor = Cursors.Default;
MessageBox.Show($"{appPassword.AppName}'s password successfully added.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
Close();
transaction.Complete();
}
catch (Exception ex)
{
Expand Down
31 changes: 16 additions & 15 deletions pwdvault/Forms/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 75c29e4

Please sign in to comment.