atest
C
code posted
created at 02 Feb 15:54, updated at 11 Feb 01:21
Edit
|
Back
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
using System; using System.Linq; using BusinessLayer; public partial class _Default : BasePage { protected void Page_Load( object sender, EventArgs e ) { carTabPage.TabPosition = (DevExpress.Web.ASPxTabControl.TabPosition) Enum.Parse(typeof(DevExpress.Web.ASPxTabControl.TabPosition), ( "Bottom" )); carTabPage.TabAlign = (DevExpress.Web.ASPxTabControl.TabAlign) Enum.Parse(typeof(DevExpress.Web.ASPxTabControl.TabAlign), ( "Left" )); carTabPage.AutoPostBack = false; carTabPage.EnableHotTrack = true; carTabPage.ActivateTabPageAction = (DevExpress.Web.ASPxTabControl.ActivateTabPageAction) Enum.Parse(typeof(DevExpress.Web.ASPxTabControl.ActivateTabPageAction), ( "0" )); GridValues(); } protected void GridValues( ) { //Get Tournament var tournaments = Globals.DB.Tournaments; if ( tournaments.Count() > 0 ) { cbTournaments.DataSource = tournaments; cbTournaments.DataBind(); cbTournaments.SelectedIndex = 0; if ( tournaments.Count() == 1 ) { cbTournaments.Visible = false; } Tournament tr = Globals.DB.Tournaments.GetRecord(Guid.Parse(cbTournaments.Value.ToString())); if ( tr != null ) { var teams = Globals.DB.vw_default_scores.Where(s => s.Id == tr.Id).OrderByDescending(t => t.Score).Take(10); gvTeams.DataSource = teams; gvTeams.DataBind(); } } else { cbTournaments.Visible = false; gvTeams.SettingsText.EmptyDataRow = "Turnuva Yok!"; } } protected DateTime ConvertToDate( object oDate ) { DateTime result = DateTime.MinValue; if ( !( oDate != null && DateTime.TryParse(oDate.ToString().TrimEnd(new char[] { ' ', 'P', 'S', 'T' }), out result) ) ) return DateTime.Now; return result; } } |
1.69 KB in 4 ms with coderay