public void CreateOrder(Order order) { using (SqlConnection connection = base.GetConnection()) { SqlCommand command = new SqlCommand("_OrderUpdate", connection) { CommandType = CommandType.StoredProcedure }; command.Parameters.AddWithValue("@Type", 0); command.Parameters.AddWithValue("@ID", 0); command.Parameters.AddWithValue("@OrderID", order.OrderID); command.Parameters.AddWithValue("@MemberID", order.MemberID); command.Parameters.AddWithValue("@Title", order.Title); command.Parameters.AddWithValue("@DateCreated", order.DateCreated); command.Parameters.AddWithValue("@IsActived", order.IsActived); command.Parameters.AddWithValue("@FullName", order.FullName); command.Parameters.AddWithValue("@Email", order.Email); command.Parameters.AddWithValue("@Phone", order.Phone); command.Parameters.AddWithValue("@Address", order.Address); command.Parameters.AddWithValue("@NickYahoo", order.NickYahoo); command.Parameters.AddWithValue("@NickSkype", order.NickSkype); command.Parameters.AddWithValue("@Require", order.Require); connection.Open(); if (command.ExecuteNonQuery() <= 0) { throw new DataAccessException("Lỗi kh\x00f4ng thể tao moi"); } command.Dispose(); } }
public void CreateOrder(Order order) { new OrderDAO().CreateOrder(order); }
public void UpdateOrder(Order order) { new OrderDAO().UpdateOrder(order); }