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 { /// /// 应用程序的主入口点。 /// [STAThread] static void Main() { var builder = new ContainerBuilder(); builder.RegisterModule(); builder.RegisterModule(); var _container = builder.Build(); AutofacHelper.Container = _container; List userData = new List(); using (var scope = AutofacHelper.Container.BeginLifetimeScope()) { IUserServices UserServices = scope.Resolve(); 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()); } } }