Program.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Windows.Forms;
  5. using Autofac;
  6. using EMIS.Utility;
  7. using EMIS.CommonLogic.SystemServices;
  8. using Bowin.Common;
  9. namespace EMIS.TestProject
  10. {
  11. static class Program
  12. {
  13. /// <summary>
  14. /// 应用程序的主入口点。
  15. /// </summary>
  16. [STAThread]
  17. static void Main()
  18. {
  19. var builder = new ContainerBuilder();
  20. builder.RegisterModule<EMIS.CommonLogic.DALModule>();
  21. builder.RegisterModule<EMIS.CommonLogic.ServiceModule>();
  22. var _container = builder.Build();
  23. AutofacHelper.Container = _container;
  24. List<string> userData = new List<string>();
  25. using (var scope = AutofacHelper.Container.BeginLifetimeScope())
  26. {
  27. IUserServices UserServices = scope.Resolve<IUserServices>();
  28. var userpageResult = UserServices.GetUserByLoginID("admin", true);
  29. userData.Add(userpageResult.LoginID);
  30. userData.Add(userpageResult.UserID.ToString());
  31. userData.Add(userpageResult.Name);
  32. userData.Add((userpageResult.CF_Staff != null) ? userpageResult.UserID.ToString() : "");//教职工ID
  33. userData.Add((userpageResult.CF_Student != null) ? userpageResult.UserID.ToString() : "");//学生ID
  34. userData.Add((userpageResult.CF_Staff != null && userpageResult.CF_Staff.CF_Department != null) ? userpageResult.CF_Staff.DepartmentID.ToString() : "");//部门(教研室)ID
  35. userData.Add((userpageResult.CF_Staff != null && userpageResult.CF_Staff.CF_Department != null) ? userpageResult.CF_Staff.CF_Department.HierarchyID : "");//部门(教研室)树结构ID
  36. userData.Add((userpageResult.CF_Staff != null && userpageResult.CF_Staff.CF_Department != null) ? userpageResult.CF_Staff.CF_Department.Name : "");//部门(教研室)名称
  37. userData.Add("");//学院ID
  38. userData.Add("");//校区ID
  39. userData.Add("");//学校ID
  40. EMIS.Utility.FormValidate.CustomPrincipal principal = new EMIS.Utility.FormValidate.CustomPrincipal();
  41. principal.ProcessData(string.Join("|", userData));
  42. }
  43. Application.EnableVisualStyles();
  44. Application.SetCompatibleTextRenderingDefault(false);
  45. Application.Run(new Form1());
  46. }
  47. }
  48. }