private async void AddConnectToDb(AddConnect add) { BMTools.BmDebug.Debug.SaveCall().InfoAsync(add.GetName); if (CheckExist(add.GetName)) { MessageBox.Show(@"Name exist"); return; } await _unitOfWork.ConnectRepository.AddAsync(new Connect { Host = add.GetHost, Name = add.GetName, Password = add.GetPassword, Port = add.GetPort, ServiceName = add.GetService, UserId = add.GetUserId, DateAdd = DateTime.Now, LastUsed = DateTime.Now }); await _unitOfWork.CommitAsync(); LoadList(); }
private void addToolStripMenuItem_Click(object sender, EventArgs e) { var add = new AddConnect(); if (add.ShowDialog() == DialogResult.OK) { AddConnectToDb(add); } }