Hi,
How can I insert the order time in the date column? Something like:
10/10/2008
15:32
Thanks
Manage > Orders - How to add the time of order?
Re: Manage > Orders - How to add the time of order?
If you want to update the ac_Orders tables OrderDate information then you can just upadete the OrderDate info after loading the order and save it as below
If you want to put this info in some custom table then probably you need to write an insert query with DateTime parameter something like below
Code: Select all
order.OrderDate = DateTime.Now;
order.Save();
Code: Select all
Order order = OrderDataSource.Load(orderId, false);
Microsoft.Practices.EnterpriseLibrary.Data.Database database = Token.Instance.Database;
string sql = ("INSERT INTO custom_MyTable(OrderDate) VALUES(@orderDate)");
using (System.Data.Common.DbCommand selectCommand = database.GetSqlStringCommand(sql))
{
database.AddInParameter(selectCommand, "@orderDate", System.Data.DbType.DateTime, order.OrderDate);
database.ExecuteNonQuery(selectCommand);
}