|
@@ -1,97 +0,0 @@
|
|
|
-/*
|
|
|
-using Microsoft.Data.SqlClient;
|
|
|
-using System.Data;
|
|
|
-
|
|
|
-namespace WebApplication1
|
|
|
-{
|
|
|
- public class GetListInfo
|
|
|
- {
|
|
|
- public static List<string> GetRegion()
|
|
|
- {
|
|
|
- Connection.SqlConnection.Open();
|
|
|
- SqlCommand sqlCommand = new SqlCommand("select NameRegion from Region", Connection.SqlConnection);
|
|
|
-
|
|
|
- List<string> list = new List<string>();
|
|
|
- SqlDataReader reader = sqlCommand.ExecuteReader();
|
|
|
- while (reader.Read())
|
|
|
- {
|
|
|
- list.Add(reader.GetString(0));
|
|
|
- }
|
|
|
- Connection.SqlConnection.Close();
|
|
|
- reader.Close();
|
|
|
- return list;
|
|
|
- }
|
|
|
- public static List<string> GetReciplentMessage()
|
|
|
- {
|
|
|
- Connection.SqlConnection.Open();
|
|
|
- SqlCommand sqlCommand = new SqlCommand("select RecipientMessage from RecipientMessage", Connection.SqlConnection);
|
|
|
- List<string> list = new List<string>();
|
|
|
- SqlDataReader reader = sqlCommand.ExecuteReader();
|
|
|
- while (reader.Read())
|
|
|
- {
|
|
|
- list.Add(reader.GetString(0));
|
|
|
- }
|
|
|
- Connection.SqlConnection.Close();
|
|
|
- reader.Close();
|
|
|
- return list;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- public static bool UserUpdate(string email, string Area, string city, string street, string housenymber, string HouseBody, string appartament, string surname, string name, string patronomic, string phone, string socialstatus)
|
|
|
- {
|
|
|
- Connection.SqlConnection.Open();
|
|
|
- SqlCommand cmd = new SqlCommand($"insert into [User] values ('{email}','{Area}','{city}','{street}','{housenymber}','{HouseBody}','{appartament}','{surname}','{name}','{patronomic}','{phone}','{socialstatus}')", Connection.SqlConnection);
|
|
|
- if (cmd.ExecuteNonQuery() > 0)
|
|
|
- {
|
|
|
- Connection.SqlConnection.Close();
|
|
|
- return true;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- Connection.SqlConnection.Close();
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- public static bool FileUpdate(byte[] file, string filetype)
|
|
|
- {
|
|
|
- if(file == null )
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- Connection.SqlConnection.Open();
|
|
|
- var cmd = new SqlCommand("INSERT INTO [File] ([File], FileType) VALUES (@file, @filetype)", Connection.SqlConnection);
|
|
|
-
|
|
|
- cmd.Parameters.Add("@file", SqlDbType.VarBinary).Value = file;
|
|
|
- cmd.Parameters.Add("@filetype", SqlDbType.VarChar).Value = filetype;
|
|
|
-
|
|
|
- if (cmd.ExecuteNonQuery() > 0)
|
|
|
- {
|
|
|
- Connection.SqlConnection.Close() ;
|
|
|
- return true;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- Connection.SqlConnection.Close();
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- public static bool AppealUpdate(string region, string index, string RecipientMessage, string text)
|
|
|
- {
|
|
|
- Connection.SqlConnection.Open();
|
|
|
- SqlCommand cmd = new SqlCommand($"insert into [Appeal] values ((select Region.idRegion from Region where NameRegion = '{region}'),'{index}',(select IdRecipientMessage from RecipientMessage where RecipientMessage = '{RecipientMessage}' ),'{text}',(SELECT MAX([File].IdFile) FROM [File]),(SELECT MAX(id_user) from [User]))",Connection.SqlConnection);
|
|
|
- cmd.ExecuteScalar();
|
|
|
- Connection.SqlConnection.Close();
|
|
|
- return true;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-}
|
|
|
-*/
|