public static void AcceptInvoice(int claimId) { using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["db"].ConnectionString)) { using (SqlCommand command = connection.CreateCommand()) { command.CommandType = CommandType.StoredProcedure; command.CommandText = "income.dbo.up_RegPaymentsFromBankInvoices"; using (OperationDurationLimit.ShortOperation(command)) { connection.Open(); using (SqlDataReader reader = command.ExecuteReader()) { } } } } //отправка сообщений { var reservation = BookingProvider.GetReservationState(UrlLanguage.CurrentLanguage, claimId); Task[] tasks = new Task[] { Task.Factory.StartNew(() => new SimpleEmailService().SendEmail <ReservationState>(reservation.customer.mail, "payment", reservation.customer.language, reservation)), Task.Factory.StartNew(() => new SmsSender().SendMessage <ReservationState>(reservation.customer.phone, "payment", reservation.customer.language, reservation)) }; Task.WaitAll(tasks); } }