Code Behind Page Page /WebServices/Quiz.asmx.cs (C#)
Used by Page /WebServices/Quiz.asmx (C#)
1: using System;  
2: using System.Collections;  
3: using System.Collections.Generic;  
4: using System.Linq;  
5: using System.Web;  
6: using System.Web.Services;  
7: using QuizNetOnline.Logic;  
8: using Microsoft.ApplicationBlocks.Data;  
9:   
10:   
11: namespace QuiznetOnline.Web.WebServices  
12: {  
13:     /// <summary>  
14:     /// Summary description for GetUser  
15:     /// </summary>  
16:     [WebService(Namespace = "http://tempuri.org/")]  
17:     [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]  
18:     [System.ComponentModel.ToolboxItem(false)]  
19:     // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.    
20:     // [System.Web.Script.Services.ScriptService]  
21:   
22:     [System.Web.Script.Services.ScriptService]  
23:     public class Quiz : System.Web.Services.WebService  
24:     {  
25:   
26:         public struct TopicCount  
27:         {  
28:             internal string TopicCode { get; set; }  
29:             internal int NumberOfRecords { get; set; }  
30:         }  
31:   
32:         [System.Web.Services.WebMethod]  
33:         public int GetTopicCountByTopic(string topicCode)  
34:         {  
35:             var tblInfo = new TableInformation();  
36:             return tblInfo.GetTopicCount(new Topic(topicCode), null,null,null);  
37:         }  
38:   
39:         [System.Web.Services.WebMethod]  
40:         public List<Topic> GetTagTopics(string tagDesc)  
41:         {  
42:             Tag tag = new Tag();  
43:             return tag.GetTagTopics(tagDesc);  
44:         }  
45:   
46:         [System.Web.Services.WebMethod]  
47:         public void ClearLog()  
48:         {  
49:             Log log = new Log();  
50:             log.ClearLog();  
51:         }  
52:   
53:         [System.Web.Services.WebMethod]  
54:         public List<TopicCount> GetTopicCountAll()  
55:         {  
56:             var tblInfo = new TableInformation();  
57:             Dictionary<string, int> _topicCounts = tblInfo.GetTopicCount();  
58:   
59:             List<TopicCount> topicCounts = new List<TopicCount>();  
60:   
61:             foreach (KeyValuePair<string, int> pair in _topicCounts)  
62:             {  
63:                 TopicCount topicCount = new TopicCount();  
64:   
65:                 topicCount.TopicCode = pair.Key;  
66:                 topicCount.NumberOfRecords = pair.Value;  
67:   
68:                 topicCounts.Add(topicCount);  
69:             }  
70:             return topicCounts;  
71:         }  
72:     }  
73: }  

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