12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Windows.Forms;
- using Autofac;
- using EMIS.Utility;
- using EMIS.CommonLogic.SystemServices;
- using Bowin.Common;
- namespace EMIS.TestProject
- {
- static class Program
- {
- /// <summary>
- /// 应用程序的主入口点。
- /// </summary>
- [STAThread]
- static void Main()
- {
- var builder = new ContainerBuilder();
- builder.RegisterModule<EMIS.CommonLogic.DALModule>();
- builder.RegisterModule<EMIS.CommonLogic.ServiceModule>();
- var _container = builder.Build();
- AutofacHelper.Container = _container;
- List<string> userData = new List<string>();
- using (var scope = AutofacHelper.Container.BeginLifetimeScope())
- {
- IUserServices UserServices = scope.Resolve<IUserServices>();
- var userpageResult = UserServices.GetUserByLoginID("admin", true);
- userData.Add(userpageResult.LoginID);
- userData.Add(userpageResult.UserID.ToString());
- userData.Add(userpageResult.Name);
- userData.Add((userpageResult.CF_Staff != null) ? userpageResult.UserID.ToString() : "");//教职工ID
- userData.Add((userpageResult.CF_Student != null) ? userpageResult.UserID.ToString() : "");//学生ID
- userData.Add((userpageResult.CF_Staff != null && userpageResult.CF_Staff.CF_Department != null) ? userpageResult.CF_Staff.DepartmentID.ToString() : "");//部门(教研室)ID
- userData.Add((userpageResult.CF_Staff != null && userpageResult.CF_Staff.CF_Department != null) ? userpageResult.CF_Staff.CF_Department.HierarchyID : "");//部门(教研室)树结构ID
- userData.Add((userpageResult.CF_Staff != null && userpageResult.CF_Staff.CF_Department != null) ? userpageResult.CF_Staff.CF_Department.Name : "");//部门(教研室)名称
- userData.Add("");//学院ID
- userData.Add("");//校区ID
- userData.Add("");//学校ID
- EMIS.Utility.FormValidate.CustomPrincipal principal = new EMIS.Utility.FormValidate.CustomPrincipal();
- principal.ProcessData(string.Join("|", userData));
- }
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new Form1());
- }
- }
- }
|