Manage > Orders - How to add the time of order?

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
alkasber
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 36
Joined: Thu May 15, 2008 2:50 pm
Location: Brazil

Manage > Orders - How to add the time of order?

Post by alkasber » Fri Dec 05, 2008 8:59 am

Hi,

How can I insert the order time in the date column? Something like:

10/10/2008
15:32


Thanks

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Manage > Orders - How to add the time of order?

Post by mazhar » Sat Dec 06, 2008 4:20 am

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

Code: Select all

order.OrderDate = DateTime.Now;
order.Save();
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 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);
        }

Post Reply