Jump to: navigation, search

Changes


Internal:Coding Practices

445 bytes added, 07:49, 24 August 2016
/* How to sort objects by there creation timestamp? */
int days = (int)t.TotalDays+1; // for casting to an integer
</syntaxhighlight>
 
=== How to sort objects based on DateTime.Now? ===
'''Scenario:''' Objects should be sorted by the current Date / Time value<br />
'''Prerequisites:''' classification CLS_SORTEDITEM
 
<syntaxhighlight lang="csharp">
this.ORDERID = 10000 - (DateTime.Now.Month*2678400 + DateTime.Now.Day*86400 + DateTime.Now.Hour*3600 + DateTime.Now.Minute*60 + DateTime.Now.Second);
</syntaxhighlight>
 
[[Category:Best Practices (internal)|Coding Practices]]
=== Actions should be executed for objects of a certain MetaClass ===
10,686
edits