root/trunk/eCard/Expo/MasterPage.master.cs @ 745

Wersja 477, 3.1 KB (wprowadzona przez marek, 17 years temu)

re #139

Line 
1using System;
2using System.Data;
3using System.Configuration;
4using System.Collections;
5using System.Web;
6using System.Web.Security;
7using System.Web.UI;
8using System.Web.UI.WebControls;
9using System.Web.UI.WebControls.WebParts;
10using System.Web.UI.HtmlControls;
11using System.Threading;
12
13public partial class MasterPage : System.Web.UI.MasterPage
14{
15    protected void Page_Load(object sender, EventArgs e)
16    {
17        if ((string)Session["culture"] == "pl-PL")
18        {
19            this.ImageButton1.Enabled = false;
20        }
21        if ((string)Session["culture"] == "en-US")
22        {
23            this.ImageButton2.Enabled = false;
24        }
25        if ((string)Session["culture"] == "fr-FR")
26        {
27            this.ImageButton3.Enabled = false;
28        }
29        if ((string)Session["culture"] == "it-IT")
30        {
31            this.ImageButton4.Enabled = false;
32        }
33        if ((string)Session["culture"] == "de-DE")
34        {
35            this.ImageButton5.Enabled = false;
36        }
37    }   
38
39    protected void FlagaPL_Click(object sender, EventArgs e)
40    {
41        if (Thread.CurrentThread.CurrentCulture.Name != "pl-PL")
42        {
43            Session["culture"] = "pl-PL";
44            string zapytanie = Request.QueryString.ToString();
45            if (zapytanie != "") { zapytanie = "?" + zapytanie; }
46            Response.Write(zapytanie);
47            Response.Redirect(Request.Url.LocalPath + zapytanie);
48        }   
49       
50    }
51
52    protected void FlagaGB_Click(object sender, EventArgs e)
53    {
54        if (Thread.CurrentThread.CurrentCulture.Name != "en-US")
55        {
56            Session["culture"] = "en-US";
57            string zapytanie = Request.QueryString.ToString();
58            if (zapytanie != "") { zapytanie = "?" + zapytanie; }
59            Response.Redirect(Request.Url.LocalPath + zapytanie);
60        }   
61
62    }
63
64    protected void FlagaFR_Click(object sender, EventArgs e)
65    {
66        if (Thread.CurrentThread.CurrentCulture.Name != "fr-FR")
67        {
68            Session["culture"] = "fr-FR";
69            string zapytanie = Request.QueryString.ToString();
70            if (zapytanie != "") { zapytanie = "?" + zapytanie; }
71            Response.Redirect(Request.Url.LocalPath + zapytanie);
72        }
73
74    }
75
76    protected void FlagaIT_Click(object sender, EventArgs e)
77    {
78        if (Thread.CurrentThread.CurrentCulture.Name != "it-IT")
79        {
80            Session["culture"] = "it-IT";
81            string zapytanie = Request.QueryString.ToString();
82            if (zapytanie != "") { zapytanie = "?" + zapytanie; }
83            Response.Redirect(Request.Url.LocalPath + zapytanie);
84        }
85
86    }
87
88    protected void FlagaDE_Click(object sender, EventArgs e)
89    {
90        if (Thread.CurrentThread.CurrentCulture.Name != "de-DE")
91        {
92            Session["culture"] = "de-DE";
93            string zapytanie = Request.QueryString.ToString();
94            if (zapytanie != "") { zapytanie = "?" + zapytanie; }
95            Response.Redirect(Request.Url.LocalPath + zapytanie);
96        }
97
98    }
99}
Notatka: Zobacz TracBrowser aby uzyskać więcej informacji.