Example #1
0
 // Kliento duomenu redagavimas
 public void EditClientData(bool personalNumExist, long personalNumber)
 {
     using (SqlConnection sqlConnection = new SqlConnection(connectionStr))
     {
         if (personalNumExist)
         {
             var clientData = functionsForClient.EditData();
             sqlConnection.Open();
             using SqlCommand command = new SqlCommand($"UPDATE clients SET address = @address, city = @city" +
                 $" WHERE personalNumber = @personalNumber",
                 sqlConnection);
             command.Parameters.AddWithValue("@address", clientData.Item1);
             command.Parameters.AddWithValue("@city", clientData.Item2);
             command.Parameters.AddWithValue("@personalNumber", personalNumber);
             command.ExecuteNonQuery();
             sqlConnection.Close();
         }
     }
 }