Code Behind Page Page /Admin/Profile.aspx.cs (C#)
Used by Page /Admin/Profile.aspx (C#)
1: using System;  
2: using System.Data;  
3: using System.Configuration;  
4: using System.Collections;  
5: using System.Web;  
6: using System.Web.Security;  
7: using System.Web.UI;  
8: using System.Web.UI.WebControls;  
9: using System.Web.UI.WebControls.WebParts;  
10: using System.Web.UI.HtmlControls;  
11: using QuizNetOnline.Logic;  
12: using Microsoft.ApplicationBlocks.Data;  
13:   
14: public partial class Admin_Profile : System.Web.UI.Page  
15: {  
16:     protected void Page_Load(object sender, EventArgs e)  
17:     {  
18:         if (Session["Validated"] == null || (bool)Session["Validated"] == false)  
19:             Response.Redirect("Default.aspx");  
20:   
21:         Profile profile=new Profile();  
22:         grdUserProfiles.DataSource = profile.GetProfiles(null, new SqlWrapper());  
23:         grdUserProfiles.DataBind();  
24:   
25:   
26:         //this.SqlDataSource1.ConnectionString = ConnectionObj.GetConnection().ConnectionString;  
27:   
28:     }  
29:   
30:     protected string CalculateCorrectTime(string Time)  
31:     {  
32:         DateTime tmpTime = Convert.ToDateTime(Time);  
33:         TimeSpan ts = TimeZone.CurrentTimeZone.GetUtcOffset(tmpTime);  
34:         DateTime now = tmpTime.AddHours(Convert.ToDouble(ts.Hours-1));  
35:   
36:         return now.ToString();  
37:     }  
38:   
39:     protected void grdUserProfiles_RowDeleting(object sender, GridViewDeleteEventArgs e)  
40:     {  
41:         string UserName = grdUserProfiles.DataKeys[e.RowIndex].Value.ToString();  
42:   
43:         Profile profile = new Profile();  
44:         profile.Delete(UserName, new SqlWrapper());  
45:   
46:         grdUserProfiles.DataSource = profile.GetProfiles(null, new SqlWrapper());  
47:         grdUserProfiles.DataBind();  
48:     }  
49:   
50: }  

.NET Documentation Tool is © 2002 - 2009 Winnersh Triangle Web Solutions Limited.