12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using Microsoft.AspNetCore.Mvc;
- using Microsoft.Data.SqlClient;
- namespace WebApplication1
- {
- public class GetListInfo
- {
- public static List<string> GetRegion()
- {
- Connecthion.SqlConnection.Open();
- SqlCommand sqlCommand = new SqlCommand("select NameRegion from Region", Connecthion.SqlConnection);
- List<string> list = new List<string>();
- SqlDataReader reader = sqlCommand.ExecuteReader();
- while (reader.Read())
- {
- list.Add(reader.GetString(0));
- }
- Connecthion.SqlConnection.Close();
- reader.Close();
- return list;
- }
- public static List<string> GetReciplentMessage()
- {
- Connecthion.SqlConnection.Open();
- SqlCommand sqlCommand = new SqlCommand("select RecipientMessage from RecipientMessage", Connecthion.SqlConnection);
- List<string> list = new List<string>();
- SqlDataReader reader = sqlCommand.ExecuteReader();
- while (reader.Read())
- {
- list.Add(reader.GetString(0));
- }
- Connecthion.SqlConnection.Close();
- reader.Close();
- return list;
- }
- [HttpPost]
- public void MyAction(string action)
- {
- Console.WriteLine("Негры");
- }
- }
- }
|