예제 #1
0
        public DataInitializer(YizhouCoreManager yizhouManager, YizhouDataManager dataManager)
        {
            this._yizhouManager = yizhouManager;
            this._dataManager   = dataManager;

            if (yizhouManager.OrgManager.DepartmentManager.Departments.Count == 0)
            {
                this.InitOrg(yizhouManager, dataManager);
            }

            Position wenyuanPosition = yizhouManager.OrgManager.PositionManager.GetPositionByName("文员");

            if (wenyuanPosition == null)
            {
                Position topPosition = yizhouManager.OrgManager.PositionManager.TopPosition;
                wenyuanPosition = yizhouManager.OrgManager.PositionManager.Create(yizhouManager.OrgManager.System, new PositionCreateInfo {
                    Name = "文员", ParentId = topPosition.ID
                });
                dataManager.PositionDataProvider.Insert(wenyuanPosition);
                this.CreateUser("heyuchi", "何玉池", wenyuanPosition.ID);
                this.CreateUser("liangminxia", "梁敏霞", wenyuanPosition.ID);
                this.CreateUser("lishuxing", "黎淑兴", wenyuanPosition.ID);
                this.CreateUser("lirong", "李蓉", wenyuanPosition.ID);
            }
        }
예제 #2
0
 public YizhouDataManager(YizhouCoreManager coreManager)
 {
     this.PositionDataProvider   = new PositionDataProvider(coreManager.OrgManager);
     this.UserDataProvider       = new UserDataProvider(coreManager.OrgManager);
     this.DepartmentDataProvider = new DepartmentDataProvider(coreManager.OrgManager);
     this.FunctionDataProvider   = new FunctionDataProvider(coreManager.OrgManager);
     this.GroupDataProvider      = new GroupDataProvider(coreManager.OrgManager);
     this.KehuDataProvider       = new KehuDataProvider(coreManager);
     this.ChanpinDataProvider    = new ChanpinDataProvider(coreManager);
     this.DingdanDataProvider    = new DingdanDataProvider(coreManager);
     this.Load();
 }
예제 #3
0
 public KehuDataProvider(YizhouCoreManager coreManager)
 {
     this._coreManager = coreManager;
 }
예제 #4
0
 public KehuService(YizhouCoreManager coreManager, YizhouDataManager dataManager)
 {
     this._coreManager = coreManager;
     this._dataManager = dataManager;
 }
예제 #5
0
 public DataProviderTester()
 {
     this._coreManager = new YizhouCoreManager();
     this._dataManager = new YizhouDataManager(this._coreManager);
 }
예제 #6
0
 public UserService(YizhouCoreManager yizhouManager)
 {
     this.OrganizationManager = yizhouManager.OrgManager;
 }
예제 #7
0
 public ChanpinDataProvider(YizhouCoreManager coreManager)
 {
     this._coreManager = coreManager;
 }
예제 #8
0
        private void InitOrg(YizhouCoreManager yizhouManager, YizhouDataManager dataManager)
        {
            Position topPosition = yizhouManager.OrgManager.PositionManager.Create(yizhouManager.OrgManager.System, new PositionCreateInfo {
                Name = "总经理"
            });

            dataManager.PositionDataProvider.Insert(topPosition);
            Department topDepartment = yizhouManager.OrgManager.DepartmentManager.Create(yizhouManager.OrgManager.System,
                                                                                         new DepartmentCreateInfo
            {
                Name            = "益州",
                ManagerPosition = topPosition
            });

            dataManager.DepartmentDataProvider.Insert(topDepartment);
            User admin = yizhouManager.OrgManager.UserManager.Create(yizhouManager.OrgManager.System, new UserCreateInfo
            {
                Name     = "Administrator",
                Account  = "admin",
                Password = "******",
                Role     = UserRole.Administrator,
                Status   = UserStatus.Normal
            });

            dataManager.UserDataProvider.Insert(admin);

            Position yewuyuanPosition = yizhouManager.OrgManager.PositionManager.Create(yizhouManager.OrgManager.System, new PositionCreateInfo {
                Name = "业务员", ParentId = topPosition.ID
            });

            dataManager.PositionDataProvider.Insert(yewuyuanPosition);

            User mengdong = yizhouManager.OrgManager.UserManager.Create(yizhouManager.OrgManager.System, new UserCreateInfo
            {
                Name           = "刘燕",
                Account        = "liuyan",
                Password       = "******",
                Status         = UserStatus.Normal,
                MainPositionId = yewuyuanPosition.ID
            });

            dataManager.UserDataProvider.Insert(mengdong);

            User luohuaili = yizhouManager.OrgManager.UserManager.Create(yizhouManager.OrgManager.System, new UserCreateInfo
            {
                Name           = "李世全",
                Account        = "lishiquan",
                Password       = "******",
                Status         = UserStatus.Normal,
                MainPositionId = yewuyuanPosition.ID
            });

            dataManager.UserDataProvider.Insert(luohuaili);

            User lianglin = yizhouManager.OrgManager.UserManager.Create(yizhouManager.OrgManager.System, new UserCreateInfo
            {
                Name           = "余佳承",
                Account        = "yujiacheng",
                Password       = "******",
                Status         = UserStatus.Normal,
                MainPositionId = yewuyuanPosition.ID
            });

            dataManager.UserDataProvider.Insert(lianglin);

            User yangke = yizhouManager.OrgManager.UserManager.Create(yizhouManager.OrgManager.System, new UserCreateInfo
            {
                Name           = "杨科",
                Account        = "yangke",
                Password       = "******",
                Status         = UserStatus.Normal,
                MainPositionId = yewuyuanPosition.ID
            });

            dataManager.UserDataProvider.Insert(yangke);

            User qudenggui = yizhouManager.OrgManager.UserManager.Create(yizhouManager.OrgManager.System, new UserCreateInfo
            {
                Name           = "瞿灯桂",
                Account        = "qudenggui",
                Password       = "******",
                Status         = UserStatus.Normal,
                MainPositionId = yewuyuanPosition.ID
            });

            dataManager.UserDataProvider.Insert(qudenggui);

            User yaohuiqing = yizhouManager.OrgManager.UserManager.Create(yizhouManager.OrgManager.System,
                                                                          new UserCreateInfo
            {
                Account        = "yaohuiqing",
                Name           = "姚慧清",
                MainPositionId = yewuyuanPosition.ID,
                Password       = "******", Role = UserRole.User, Status = UserStatus.Normal
            });

            dataManager.UserDataProvider.Insert(yaohuiqing);
        }
예제 #9
0
 public DingdanDataProvider(YizhouCoreManager coreManager)
 {
     this._coreManager = coreManager;
 }
예제 #10
0
 public AuthenticationService(YizhouCoreManager yizhouManager)
 {
     this.OrganizationManager = yizhouManager.OrgManager;
 }