Code Behind Page Page /WebServices/Tools.asmx.cs (C#)
Used by Page /WebServices/Tools.asmx (C#)
1: using System;  
2: using System.Collections.Generic;  
3: using System.Linq;  
4: using System.Web;  
5: using System.Web.Services;  
6: using System.Configuration;  
7: using QuizNetOnline.Logic;  
8: using Microsoft.ApplicationBlocks.Data;  
9:   
10: namespace QuiznetOnline.Web.UI.WebServices  
11: {  
12:     /// <summary>  
13:     /// Summary description for Tools  
14:     /// </summary>  
15:     [WebService(Namespace = "http://tempuri.org/")]  
16:     [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]  
17:     [System.ComponentModel.ToolboxItem(false)]  
18:     // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.    
19:     [System.Web.Script.Services.ScriptService]  
20:     public class Tools : System.Web.Services.WebService  
21:     {  
22:   
23:         [WebMethod]  
24:         public string StringEncode(string str)  
25:         {  
26:             return Server.HtmlEncode(str);  
27:         }  
28:   
29:         [WebMethod]  
30:         public string StringDecode(string str)  
31:         {  
32:             return Server.HtmlDecode(str);  
33:         }  
34:   
35:         [WebMethod]  
36:         public bool GetSiteUnderMaintenanceValue()  
37:         {  
38:             return Convert.ToBoolean(ConfigurationManager.AppSettings["SiteUnderMaintenance"]);  
39:         }  
40:   
41:         [WebMethod]  
42:         public string GetAdminMessage(string ClientDateTime, string CountryName)  
43:         {  
44:             string message = string.Empty;  
45:             var adminMessage = new AdminMessage();  
46:             var adminMessages = new List<AdminMessage>();  
47:   
48:             adminMessages = adminMessage.GetAdminMessage(CountryName, new SqlWrapper());  
49:             if (adminMessages.Count > 0)  
50:             {  
51:                 foreach (AdminMessage msg in adminMessages)  
52:                 {  
53:                     if (Convert.ToDateTime(ClientDateTime) >= msg.StartMessageDate && Convert.ToDateTime(ClientDateTime) <= msg.EndMessageDate &&  
54:                        string.IsNullOrEmpty(msg.AdminMessageText) == false)  
55:                     {  
56:                         message += msg.AdminMessageText;  
57:                     }  
58:                 }  
59:             }  
60:             return message;  
61:         }  
62:     }  
63: }  

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