public void Delete(Clothe entity) { using (SqlCommand cmd = new SqlCommand("DELETE FROM Clothes WHERE ClotheId = @ClotheId")) { cmd.Parameters.AddWithValue("ClotheId", entity.ClotheId); VTYS.SqlExecuteNonQuery(cmd); } }
public void Delete(Post entity) { using (SqlCommand cmd = new SqlCommand("DELETE FROM Posts WHERE PostId = @PostId")) { cmd.Parameters.AddWithValue("PostId", entity.PostId); VTYS.SqlExecuteNonQuery(cmd); } }
public void Add(Clothe entity) { using (SqlCommand cmd = new SqlCommand("INSERT INTO Clothes (Name,UnitPrice) " + "VALUES(@Name,@UnitPrice)")) { cmd.Parameters.AddWithValue("Name", entity.Name); cmd.Parameters.AddWithValue("UnitPrice", entity.UnitPrice); VTYS.SqlExecuteNonQuery(cmd); } }
public void Update(Clothe entity) { using (SqlCommand cmd = new SqlCommand("UPDATE Clothes set Name = @Name, UnitPrice=@UnitPrice WHERE ClotheId = @ClotheId")) { cmd.Parameters.AddWithValue("@ClotheId", entity.ClotheId); cmd.Parameters.AddWithValue("@Name", entity.Name); cmd.Parameters.AddWithValue("@UnitPrice", entity.UnitPrice); VTYS.SqlExecuteNonQuery(cmd); } }
public void Add(Post entity) { using (SqlCommand cmd = new SqlCommand("INSERT INTO Posts (Title,Details) " + "VALUES(@Title,@Details)")) { cmd.Parameters.AddWithValue("Title", entity.Title); cmd.Parameters.AddWithValue("Details", entity.Details); VTYS.SqlExecuteNonQuery(cmd); } }
public void Update(Post entity) { using (SqlCommand cmd = new SqlCommand("UPDATE Posts set Title = @Title, Details=@Details WHERE PostId = @PostId")) { cmd.Parameters.AddWithValue("@PostId", entity.PostId); cmd.Parameters.AddWithValue("@Title", entity.Title); cmd.Parameters.AddWithValue("@Details", entity.Details); VTYS.SqlExecuteNonQuery(cmd); } }