Code Behind Page Page /WebServices/GetUser.asmx.cs (C#)
Used by Page /WebServices/GetUser.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 QuizNetOnline.Logic;  
7: using Microsoft.ApplicationBlocks.Data;  
8:   
9: namespace QuiznetOnline.Web.WebServices  
10: {  
11:     /// <summary>  
12:     /// Summary description for GetUser  
13:     /// </summary>  
14:     [WebService(Namespace = "http://tempuri.org/")]  
15:     [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]  
16:     [System.ComponentModel.ToolboxItem(false)]  
17:     // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.    
18:     // [System.Web.Script.Services.ScriptService]  
19:   
20:     [System.Web.Script.Services.ScriptService]  
21:     public class GetUser : System.Web.Services.WebService  
22:     {  
23:   
24:         [WebMethod]  
25:         public int GetUserTestQuestionPos(bool includePastQuestionsCorrectIncorrect,string userName, string topicCode, string quizType,string tagType)  
26:         {  
27:             UserTest userTest = new UserTest();  
28:             userTest.LoadQuiz(includePastQuestionsCorrectIncorrect,userName, new Topic(topicCode),quizType,tagType,new SqlWrapper());  
29:   
30:             return userTest.QuestionPos;  
31:   
32:         }  
33:   
34:         [WebMethod]  
35:         public List<UserTest> GetUserTest(bool includePastQuestionsCorrectIncorrect,string userName, string quizType, string tagType)  
36:         {  
37:             List<UserTest> userTests=new List<UserTest>();  
38:             UserTest userTest = new UserTest();  
39:             userTests = userTest.LoadQuizzes(includePastQuestionsCorrectIncorrect,userName, quizType, tagType, new SqlWrapper());  
40:   
41:             return userTests;  
42:   
43:         }  
44:   
45:         [WebMethod]  
46:         public bool DeleteUserTest(string userName, string topicCode, string quizType, string tagType)  
47:         {  
48:             UserTest userTest = new UserTest();  
49:             return userTest.DeleteUserTest(userName,topicCode, quizType, tagType, new SqlWrapper());  
50:         }  
51:   
52:         [WebMethod]  
53:         public void AddRemoveFavorite(string userName, int QuestionID, bool IsRemoveFavourite)  
54:         {  
55:   
56:             Question question=new Question();  
57:   
58:             UserFavourite fav = new UserFavourite();  
59:             fav.UserName = userName;  
60:   
61:             if (IsRemoveFavourite)  
62:                 fav.Insert(QuestionID,new SqlWrapper());  
63:             else  
64:                 fav.Delete(QuestionID, new SqlWrapper());  
65:         }  
66:     }  
67: }  

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