1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using AjaxControlToolkit;
using System.Collections.Specialized;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using CallBook_DataSetTableAdapters;
/// <summary>
/// Description résumée de CallBook_Service
/// </summary>
[WebService(Namespace="http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class CallBook_Service : System.Web.Services.WebService {
public CallBook_Service () {
//Supprimez les marques de commentaire dans la ligne suivante si vous utilisez des composants conçus
//InitializeComponent();
}
[WebMethod(EnableSession = true)]
[System.Web.Script.Services.ScriptMethod]
public CascadingDropDownNameValue[] GetCourseByUser(string knownCategoryValues, string category)
{
string User = Convert.ToString(Session["User_Name"]);
List<CascadingDropDownNameValue> Course_Names = new List<CascadingDropDownNameValue>();
CallBook_DataSetTableAdapters.CourseTableAdapter Course = new CallBook_DataSetTableAdapters.CourseTableAdapter();
foreach (DataRow _row in Course.GetCourseByUser(User))
{
Course_Names.Add(new CascadingDropDownNameValue(_row["Matiere_course"].ToString(), _row["Matiere_code_course"].ToString()));
}
return Course_Names.ToArray();
}
[WebMethod (EnableSession=true)]
[System.Web.Script.Services.ScriptMethod]
public CascadingDropDownNameValue[] GetGroupByCourseAndUser(string knownCategoryValues, string category)
{
string user_name = Convert.ToString(Session["User_Name"]);
string[] _CourseValue = knownCategoryValues.Split(':', ';');
string Code_Course = Convert.ToString(_CourseValue[1]);
List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>();
CallBook_DataSetTableAdapters.ClasseTableAdapter GroupAdapter = new CallBook_DataSetTableAdapters.ClasseTableAdapter();
foreach (DataRow dr in GroupAdapter.GetGroupByCourseAndUser(Code_Course, user_name))
{
values.Add(new CascadingDropDownNameValue(dr["Classe_group_name"].ToString(), dr["Classe_code_group"].ToString()));
}
return values.ToArray();
}
} |
Partager