Code
1//ref
2using System.Xml.Serialization;
3using System.Collections.Generic;
4
5
6
7 [WebMethod]
8 [XmlInclude(typeof(DeptModel))]
9 public IList GetDepModelList(string Deptname,int isdel)
10 {
11 ICommDal<DeptModel> iDal=new DeptDal();
12 IList<DeptModel> ilist = iDal.GetModelList(new DeptModel(0, Deptname, isdel, DateTime.Now));
13 IList list=new ArrayList();
14 for(int i=0;i<ilist.Count;i++)
15 {
16 list.Add(new DeptModel(ilist[i].Id, ilist[i].Deptname, ilist[i].Isdel, ilist[i].Createdate));
17 }
18 return list;
19
20 }
21 [WebMethod]
22 [XmlInclude(typeof(UserModel))]
23 public IList GetUserModelList(string Username, int deptid)
24 {
25 ICommDal<UserModel> iDal = new UserDal();
26 IList<UserModel> ilist = iDal.GetModelList(new UserModel(0, Username, "", "", deptid, 0, DateTime.Now, 1, ""));
27 IList list = new ArrayList();
28 for (int i = 0; i < ilist.Count; i++)
29 {
30 UserModel model = new UserModel();
31 model.Createdate = ilist[i].Createdate;
32 model.Dept = ilist[i].Dept;
33 model.Deptname = ilist[i].Deptname;
34 model.Group = ilist[i].Group;
35 model.Groupname = ilist[i].Groupname;
36 model.Id = ilist[i].Id;
37 model.Isdel = ilist[i].Isdel;
38 model.Password = ilist[i].Password;
39 model.True_password = ilist[i].True_password;
40 model.Truename = ilist[i].Truename;
41 model.Username = ilist[i].Username;
42 list.Add(model);
43 }
44
45 return list;
46 }
47
这样才可以调用,调试成功,不知道还有没有别的方法,总是感觉怪怪的.