Ejemplo n.º 1
0
 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();
     }
 }
Ejemplo n.º 2
0
 public void CreateOrder(Order order)
 {
     new OrderDAO().CreateOrder(order);
 }
Ejemplo n.º 3
0
 public void UpdateOrder(Order order)
 {
     new OrderDAO().UpdateOrder(order);
 }