Esempio n. 1
0
 public void Delete(Radio entity)
 {
     using (SqlCommand command =
                new SqlCommand("delete from Radios where RadioId=@RadioId "))
     {
         command.Parameters.AddWithValue("@RadioId", entity.RadioId);
         VTYS.SqlExecuteNonQuery(command);
     }
 }
Esempio n. 2
0
 public void Add(Post entity)
 {
     using (SqlCommand command = new SqlCommand("insert into Posts (Title,Details) values (@Title,@Details)"))
     {
         command.Parameters.AddWithValue("@Title", entity.Title);
         command.Parameters.AddWithValue("@Details", entity.Details);
         VTYS.SqlExecuteNonQuery(command);
     }
 }
Esempio n. 3
0
 public void Update(Post entity)
 {
     using (SqlCommand command = new SqlCommand("update Posts set Title=@Title, Details=@Details where PostId=@PostId"))
     {
         command.Parameters.AddWithValue("@PostId", entity.PostId);
         command.Parameters.AddWithValue("@Title", entity.Title);
         command.Parameters.AddWithValue("@Details", entity.Details);
         VTYS.SqlExecuteNonQuery(command);
     }
 }
Esempio n. 4
0
 public void Add(Radio entity)
 {
     using (SqlCommand command =
                new SqlCommand("insert into Radios (Name,Frequency,isOnline) values (@Name,@Frequency,@isOnline)"))
     {
         command.Parameters.AddWithValue("@Name", entity.Name);
         command.Parameters.AddWithValue("@Frequency", entity.Frequency);
         command.Parameters.AddWithValue("@isOnline", entity.isOnline);
         VTYS.SqlExecuteNonQuery(command);
     }
 }
Esempio n. 5
0
 public void Update(Radio entity)
 {
     using (SqlCommand command =
                new SqlCommand("update Radios set Name=@Name, Frequency=@Frequency, isOnline=@isOnline where RadioId=@RadioId "))
     {
         command.Parameters.AddWithValue("@RadioId", entity.RadioId);
         command.Parameters.AddWithValue("@Name", entity.Name);
         command.Parameters.AddWithValue("@Frequency", entity.Frequency);
         command.Parameters.AddWithValue("@isOnline", entity.isOnline);
         VTYS.SqlExecuteNonQuery(command);
     }
 }