private UserPanelController(ref DBDelegateBridge.UIMoney uim, ref DBDelegateBridge.UIStockHold uis, ref InfoDelegate.SetWin setWin)
 {
     this.uim = uim;
     this.uis = uis;
     this.setWin = setWin;
     usersController = new UsersController();
     DB_ERROR DBE = usersController.GetLastError();
     if (DBE == DB_ERROR.DB_DATA_NOT_EXISTS)
     {
         InputMoney dlg = new InputMoney();
         dlg.ShowDialog();
         if (dlg.m == 0)
         {
             Application.Current.Shutdown();
             return;
         }
         usersController.AddNewUser(dlg.n, dlg.m);
     }
     else if (DBE != DB_ERROR.DB_OK)
     {
         Adapter.ErrorAdapter.Show(DBE);
         Application.Current.Shutdown();
         return;
     }
     List<string> users = usersController.GetUserList();
     UserBoxController.Handler().setEventHandler(UserChange);
     foreach (string name in users)
     {
         //选择
         UserBoxController.Handler().Add(name, usersController.GetUserControler(name).PrincipalRead());
     }
     UserChange(users.First());
 }
        private void setInfoDelegate(string name)
        {
            InfoDelegate ID;

            if (InfoSwitch.ContainsKey(name))
            {
                ID = InfoSwitch[name];
            }
            else
            {
                ID = new InfoDelegate(setWin);
                InfoSwitch.Add(name, ID);
            }
            if (StockStateBoxController.ID != null)
            {
                StockStateBoxController.ID.setDelegateFlag(false);
            }
            StockStateBoxController.ID = ID;
            StockStateBoxController.ID.setDelegateFlag(true);
            ID.setValues();
        }
 public static UserPanelController Create(ref DBDelegateBridge.UIMoney uim, ref DBDelegateBridge.UIStockHold uis, ref InfoDelegate.SetWin setWin)
 {
     if (UPC == null)
     {
         UPC = new UserPanelController(ref uim, ref uis, ref setWin);
         return UPC;
     }
     else
         return UPC;
 }
 private void setInfoDelegate(string name)
 {
     InfoDelegate ID;
     if (InfoSwitch.ContainsKey(name))
     {
         ID = InfoSwitch[name];
     }
     else
     {
         ID = new InfoDelegate(setWin);
         InfoSwitch.Add(name, ID);
     }
     if (StockStateBoxController.ID != null)
         StockStateBoxController.ID.setDelegateFlag(false);
     StockStateBoxController.ID = ID;
     StockStateBoxController.ID.setDelegateFlag(true);
     ID.setValues();
 }