Ejemplo n.º 1
0
        /// <summary> 加载其他信息
        /// </summary>
        public void HandlerOther()
        {
            string dbName = GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode;

            //获取宇通加密秘钥
            yuTongWebService.GlobalStaticObj_YT.KeySecurity_YT = DBHelper.GetSingleValue("获取服务站省份", dbName, "sys_config", "key_value", "key_name='KeySecurity_YT'", "");
            //获取服务站所长省份,cxz
            GlobalStaticObj_Server.Instance.ServiceStationProvince = DBHelper.GetSingleValue("获取服务站省份", dbName, "tb_company", "province",
                                                                                             string.Format("data_source='2' and sap_code='{0}'", yuTongWebService.GlobalStaticObj_YT.SAPCode), "");

            CommonUtility.LoadAutoBackUpPlanInfo();

            #region 启用服务
            btnServer_Click(null, null);
            #endregion

            #region --启动云平台通讯服务
            this.uiHandler += new UiHandler(this.InitCloundService);
            ThreadPool.QueueUserWorkItem(new WaitCallback(this._StartCloundService));
            #endregion

            #region 启用宇通系统链接
            btnYutong_Click(null, null);
            #endregion
        }
Ejemplo n.º 2
0
 protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
 {
     if (keyData == Keys.Escape)
     {
         if (this.formCmb.Visible)
         {
             this.formCmb.Hide();
             return(true);
         }
     }
     else if (keyData == Keys.Enter)
     {
         panelLogin_Click(null, null);
         return(true);
     }
     else if (keyData == Keys.F5)
     {
         this.uiHandler -= new UiHandler(this.LoginResult);
         this.uiHandler -= new UiHandler(this.ShowAccData);
         this.uiHandler += new UiHandler(this.ShowAccData);
         ThreadPool.QueueUserWorkItem(new WaitCallback(this._LoadAccData));
         return(true);
     }
     return(base.ProcessCmdKey(ref msg, keyData));
 }
Ejemplo n.º 3
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ManagerOverviewPage"/> class.
        /// Constructor
        /// </summary>
        /// <param name="parent">
        /// the frame which tihs page is displayed in
        /// </param>
        /// <param name="ui">
        /// the UIHandler for this UI
        /// </param>
        public ManagerOverviewPage(Frame parent, UiHandler ui)
        {
            InitializeComponent();
            _parent = parent;
            _ui     = ui;
            _ui.ManagerOverviewPage = this;

            LoadingBar.Visibility          = System.Windows.Visibility.Hidden;
            LoadingBar.Value               = 100;
            RemoveButton.IsEnabled         = false;
            AddButton.IsEnabled            = false;
            EndElectionButton.IsEnabled    = false;
            IPLabel.Content                = IPLabel.Content.ToString().Replace("255.255.255.255", ui._station.Communicator.GetIdentifyingString());
            ManagerstationGrid.ItemsSource = _ui._station.PeerStatuses.Values;

            // Change the width of the window
            var wnd = Window.GetWindow(_parent);

            if (wnd != null)
            {
                wnd.Width = 1000;
            }
            PopulateList();
            RefreshStatistics();
        }
Ejemplo n.º 5
0
 private void ButtonLoadTrainSet_Click(object sender, EventArgs e)
 {
     _instance = _parser.ParseData(loadTrainSet.Text);
     UiHandler.SetSlider(panelSlider, buttonTrain.Top, buttonTrain.Height);
     buttonTrain.Enabled = true;
     UiHandler.PanelVisible(panelTrain, _panels);
 }
Ejemplo n.º 6
0
        private void InitializeHandlers()
        {
            try
            {
                UiReferenceContainer uiRefContainer = new UiReferenceContainer
                                                      (
                    perfCpuTextBox,
                    perfRamTextBox,
                    logListBox,
                    mySqlServerTextBox,
                    mySqlPortNmrUpDown,
                    mySqlBaseTextBox,
                    mySqlUserTextBox,
                    mySqlPassTextBox,
                    mainTabControl,
                    mySqlInstallerCreateTablesCheckBox,
                    mySqlInstallerCreateDataCheckBox,
                    newAccLoginTextBox,
                    newAccPassTextBox,
                    newAccAccessLevelNmrUpDown,
                    newAccButton,
                    tcpIpTextBox,
                    tcpPortNumericUpDown
                                                      );

                _uiHandler   = UiHandler.GetInstance(uiRefContainer);
                _gameManager = GameManager.GetInstance(_uiHandler, _uiHandler, _uiHandler);
            }
            catch (Exception exception)
            {
                MessageBox.Show($"A method InitializeHandlers() throws an exception: {exception.Message}");
            }
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="parent">the frame this page is shown in</param>
 /// <param name="ui">the UIHandler for this UI</param>
 public MasterPasswordPage(Frame parent, UiHandler ui)
 {
     InitializeComponent();
     _parent = parent;
     _ui     = ui;
     MasterPassWordLabel.Content = _ui.GeneratePassword();
 }
Ejemplo n.º 8
0
        private void _LoadReminder(DataSet ds)
        {
            this.loadFlag = false;
            UiHandler _uiHandler = new UiHandler(this.LoadReminder);

            this.Invoke(_uiHandler, ds);
        }
Ejemplo n.º 9
0
        public void _ShowItem(DataTable dt)
        {
            this.loadFlag = false;
            UiHandler _uiHandler = new UiHandler(this.ShowItem);

            this.Invoke(_uiHandler, dt);
        }
Ejemplo n.º 10
0
 private void panelLogin_Click(object sender, EventArgs e)
 {
     pictureBox4.Image = Properties.Resources.top2;
     if (this.enableFlag)
     {
         this.errorProvider.Clear();
         if (string.IsNullOrEmpty(this.tbUser.Caption.Trim()) ||
             this.tbUser.Caption.Trim() == "用户名")
         {
             Utility.Common.Validator.SetError(this.errorProvider, this.tbUser, "用户名不能为空!");
             return;
         }
         if (string.IsNullOrEmpty(this.tbPwd.Caption.Trim()) ||
             this.tbPwd.Caption.Trim() == "密码")
         {
             Utility.Common.Validator.SetError(this.errorProvider, this.tbPwd, "密码不能为空!");
             return;
         }
         //FormLoading.StartLoading(this, new Size(110, 120));
         this.enableFlag = false;
         this.userName   = this.tbUser.Caption.Trim();
         this.pwd        = this.tbPwd.Caption.Trim();
         this.uiHandler += new UiHandler(this.LoginResult);
         //登录验证
         ThreadPool.QueueUserWorkItem(new WaitCallback(this._Login));
     }
     else
     {
         FormMessgeBox.ShowMsg(this, "数据库连接异常!", this.panelTop.BackColor);
     }
 }
Ejemplo n.º 11
0
 private void ButtonTestSet_Click(object sender, EventArgs e)
 {
     _drawer?.ResetPoints();
     UiHandler.SetSlider(panelSlider, buttonTestSet.Top, buttonTestSet.Height);
     buttonTrain.Enabled = false;
     buttonTest.Enabled  = false;
     UiHandler.PanelVisible(panelTestSet, _panels);
 }
Ejemplo n.º 12
0
    void Awake()
    {
        uiHandler    = GetComponent <UiHandler>();
        sceneHandler = GetComponent <SceneHandler>();
        audioSource  = GetComponent <AudioSource>();

        curentNode.SettingUp(firstNode);
    }
Ejemplo n.º 13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CheckMasterPasswordDialog"/> class.
 /// constructor
 /// </summary>
 /// <param name="ui">
 /// the UIHandler for this UI
 /// </param>
 public CheckMasterPasswordDialog(UiHandler ui, string reason)
 {
     InitializeComponent();
     _ui = ui;
     PwTextbox.Focus();
     Title = "Master Password";
     AuthenticationReason.Text = reason;
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DataLoadPage"/> class.
 /// constructor
 /// </summary>
 /// <param name="parent">
 /// the frame in which this page is displayed
 /// </param>
 /// <param name="ui">
 /// the UIHandler for this UI
 /// </param>
 public DataLoadPage(Frame parent, UiHandler ui, bool local = false)
 {
     InitializeComponent();
     _parent = parent;
     _ui     = ui;
     _local  = local;
     LoadingLabel.Visibility = System.Windows.Visibility.Hidden;
 }
Ejemplo n.º 15
0
        private void LoginResult(object obj)
        {
            this.uiHandler -= new UiHandler(this.LoginResult);
            string errMsg = obj.ToString();

            if (!string.IsNullOrEmpty(errMsg))
            {
                FormLoading.EndLoading();
                FormMessgeBox.ShowMsg(this, errMsg, this.panelTop.BackColor);
                this.enableFlag = true;
                return;
            }


            if (GlobalStaticObj.gLoginDataSet == null ||
                GlobalStaticObj.gLoginDataSet.Tables.Count == 0 ||
                GlobalStaticObj.gLoginDataSet.Tables[0].Rows.Count < 1)
            {
                this.enableFlag = true;
                FormLoading.EndLoading();
                FormMessgeBox.ShowMsg(this, "用户名或密码错误!", this.panelTop.BackColor);
                return;
            }

            if (HXCServerWinForm.GlobalStaticObj.gLoginDataSet.Tables[0].Rows.Count < 1)
            {
                this.enableFlag = true;
                FormMessgeBox.ShowMsg(this, "数据加载失败!", this.panelTop.BackColor);
                FormLoading.EndLoading();
                return;
            }

            #region 设置全局变量
            GlobalStaticObj_Server.Instance.UserID    = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["user_id"].ToString();
            GlobalStaticObj_Server.Instance.UserName  = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["user_name"].ToString();
            GlobalStaticObj_Server.Instance.LoginName = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["land_name"].ToString();
            GlobalStaticObj_Server.Instance.PassWord  = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["password"].ToString();

            GlobalStaticObj_Server.Instance.RoleID   = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["role_id"].ToString();
            GlobalStaticObj_Server.Instance.RoleName = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["role_name"].ToString();
            GlobalStaticObj_Server.Instance.OrgID    = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["org_id"].ToString();
            GlobalStaticObj_Server.Instance.OrgName  = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["org_name"].ToString();

            GlobalStaticObj_Server.Instance.ComID     = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["com_id"].ToString();
            GlobalStaticObj_Server.Instance.ComName   = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["com_name"].ToString();
            GlobalStaticObj_Server.Instance.LoginTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            #endregion

            //预加载信息
            //LocalCache.PreLoad();

            //登录记忆保存
            this.SaveMemery();

            FormLoading.EndLoading();
            this.DialogResult = DialogResult.OK;//关键:设置登陆成功状态
        }
Ejemplo n.º 16
0
 void RefreshAccData()
 {
     this.Opacity    = 1;
     this.uiHandler -= new UiHandler(this.LoginResult);
     this.uiHandler -= new UiHandler(this.ShowAccData);
     this.uiHandler += new UiHandler(this.ShowAccData);
     //加载帐套信息
     ThreadPool.QueueUserWorkItem(new WaitCallback(this._LoadAccData));
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ui">the UIHandler for this UI</param>
 /// <param name="parent">the frame in which this page is displayed</param>
 public BallotRequestPage(UiHandler ui, Frame parent)
 {
     _ui     = ui;
     _parent = parent;
     _ui.BallotRequestPage = this;
     InitializeComponent();
     checkValidityButton.IsEnabled = false;
     WaitingLabel.Content          = "";
 }
Ejemplo n.º 18
0
 private void ButtonSave_Click(object sender, EventArgs e)
 {
     SaveTestSet.Enabled = false;
     savePanel.Visible   = false;
     _parser.FormatAndSaveResult(fileNameBox.Text, _instance);
     UiHandler.PanelVisible(panelTrain, _panels);
     buttonTrain.Enabled = true;
     UiHandler.SetSlider(panelSlider, buttonTrain.Top, buttonTrain.Height);
 }
        public WaitingForManagerPage(Frame parent, UiHandler ui)
        {
            _parent = parent;
            _ui     = ui;
            InitializeComponent();
            Window.GetWindow(_parent);

            _ui.WaitingForManagerPage = this;
        }
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="ui">the UIHandler for this UI</param>
 public CheckMasterPasswordDialog(UiHandler ui)
 {
     InitializeComponent();
     _ui = ui;
     Focus();
     PwTextbox.Focus();
     OKButton.IsEnabled = false;
     Title = "Master Password";
 }
Ejemplo n.º 21
0
 private void GoToResult_Click(object sender, EventArgs e)
 {
     Train.Visible = true;
     _ann.GoToResult();
     GoToResults.Visible = false;
     UiHandler.PanelVisible(panelResult, _panels);
     buttonResult.Enabled = true;
     UiHandler.SetSlider(panelSlider, buttonResult.Top, buttonResult.Height);
 }
Ejemplo n.º 22
0
 public PrecinctChoicePage(Frame parent, UiHandler ui)
 {
     InitializeComponent();
     _parent = parent;
     _ui     = ui;
     _ui.PrecinctChoicePage = this;
     _places = new SortedDictionary <string, PollingPlace>();
     PopulateList();
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="parent">the frame this page is shown in</param>
 /// <param name="ui">the UIHandler for this UI</param>
 public OverviewPage(Frame parent, UiHandler ui)
 {
     InitializeComponent();
     _parent               = parent;
     _ui                   = ui;
     _ui.OverviewPage      = this;
     LoadingBar.Visibility = Visibility.Hidden;
     LoadingBar.Value      = 100;
     PopulateList();
 }
Ejemplo n.º 24
0
 private void GoToTest_Click(object sender, EventArgs e)
 {
     Train.Visible    = true;
     GoToTest.Visible = false;
     GoToTest.Enabled = false;
     _ann.FixArchitecture();
     UiHandler.PanelVisible(panelTest, _panels);
     buttonTest.Enabled = true;
     UiHandler.SetSlider(panelSlider, buttonTest.Top, buttonTest.Height);
 }
Ejemplo n.º 25
0
        private void UCHomePage_Load(object sender, EventArgs e)
        {
            btnServer_Click(null, null);
            BindDatatoFrm();

            #region --启动云平台通讯服务
            this.uiHandler += new UiHandler(this.InitCloundService);
            ThreadPool.QueueUserWorkItem(new WaitCallback(this._StartCloundService));
            #endregion
        }
Ejemplo n.º 26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WaitingForManagerPage"/> class.
 /// </summary>
 /// <param name="parent">
 /// The parent.
 /// </param>
 /// <param name="ui">
 /// The ui.
 /// </param>
 public WaitingForManagerPage(Frame parent, UiHandler ui)
 {
     _parent = parent;
     _ui     = ui;
     InitializeComponent();
     Window.GetWindow(_parent);
     IPLabel.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal,
                               new Action(delegate { IPLabel.Content = "This is Station " + _ui.IdentifyingString(); }));
     _ui.WaitingForManagerPage = this;
 }
Ejemplo n.º 27
0
        private void UCHomePage_Load(object sender, EventArgs e)
        {
            btnServer_Click(null, null);
            BindDatatoFrm();

            #region --启动云平台通讯服务
            this.uiHandler += new UiHandler(this.InitCloundService);
            ThreadPool.QueueUserWorkItem(new WaitCallback(this._StartCloundService));
            #endregion
        }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ip">the IP address of the station to accept</param>
 /// <param name="ui">the UIHandler for this UI</param>
 public AcceptStationDialog(IPEndPoint ip, UiHandler ui)
 {
     _ui = ui;
     _ip = ip;
     InitializeComponent();
     StationLabel.Content = ip.Address.ToString();
     Focus();
     PwTextbox.Focus();
     OKButton.IsEnabled = false;
     Title = "Accept Station";
 }
Ejemplo n.º 29
0
    private void Start()
    {
        InitSprites();
        ShuffleSprites();
        InitButtons();

        Time.timeScale = 1f;
        startTime      = Time.time;
        isGameFinished = isGamePaused = false;
        uiHandler      = FindObjectOfType <UiHandler>();
    }
Ejemplo n.º 30
0
 private void ButtonTrain_Click(object sender, EventArgs e)
 {
     _ann?.ResetNetwork();
     _drawer?.ResetPoints();
     _ann?.ResetTraining();
     Train.Visible    = true;
     GoToTest.Visible = false;
     UiHandler.SetSlider(panelSlider, buttonTrain.Top, buttonTrain.Height);
     buttonTest.Enabled = false;
     UiHandler.PanelVisible(panelTrain, _panels);
 }
Ejemplo n.º 31
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AcceptStationDialog"/> class.
 /// Constructor
 /// </summary>
 /// <param name="ip">
 /// the IP address of the station to accept
 /// </param>
 /// <param name="ui">
 /// the UIHandler for this UI
 /// </param>
 public AcceptStationDialog(IPEndPoint ip, UiHandler ui)
 {
     _ui = ui;
     _ip = ip;
     InitializeComponent();
     StationLabel.Content = StationLabel.Content.ToString().Replace("NAME", _ui.IdentifyingStringForStation(ip));
     Activate();
     PwTextbox.Focus();
     OKButton.IsEnabled = false;
     Title = "Accept Station";
 }
Ejemplo n.º 32
0
 /// <summary>
 /// 动画加载
 /// </summary>
 /// <param name="ctl"></param>
 public static void StartLoading(Control ctl)
 {
     if (formLoading != null)
     {
         EndLoading();
     }
     formLoading = new FormLoading();
     uiHandler -= new UiHandler(ShowText);
     uiHandler += new UiHandler(ShowText);           
     formLoading.Show();
     //formLoading.BringToFront();
     AdjustLoacation(ctl);           
 }       
Ejemplo n.º 33
0
        public UCAnnounce()
        {
            InitializeComponent();
            SetStyle(
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.OptimizedDoubleBuffer |
                ControlStyles.ResizeRedraw |
                ControlStyles.DoubleBuffer, true);

            LocalCache.AnnounceComplated -= new LocalCache.AnnounceComplate(this._ShowItem);
            LocalCache.AnnounceComplated += new LocalCache.AnnounceComplate(this._ShowItem);
            this.uiHandler -= new UiHandler(this.ShowItem);
            this.uiHandler += new UiHandler(this.ShowItem);
        }
Ejemplo n.º 34
0
        public UCReminder()
        {
            InitializeComponent();

            SetStyle(
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.OptimizedDoubleBuffer |
                ControlStyles.ResizeRedraw |
                ControlStyles.DoubleBuffer, true);

            LocalCache.ReminderComplated -= new LocalCache.ReminderComplate(this._LoadReminder);
            LocalCache.ReminderComplated += new LocalCache.ReminderComplate(this._LoadReminder);
            this.uiHandler -= new UiHandler(this.LoadReminder);
            this.uiHandler += new UiHandler(this.LoadReminder);
        }
Ejemplo n.º 35
0
 /// <summary>
 /// 动画加载
 /// </summary>
 /// <param name="ctl">阴影覆盖控件</param>
 /// <param name="size"></param>
 public static void StartLoading(Control ctl,Size size)
 {
     if (formLoading != null)
     {
         EndLoading();
     }
     formLoading = new FormLoading();
     uiHandler -= new UiHandler(ShowText);
     uiHandler += new UiHandler(ShowText);
     formLoading.Show();
     if (size.Width > ctl.Width)
     {
         size = new Size(ctl.Width, size.Height);
     }
     if (size.Height > ctl.Height)
     {
         size = new Size(size.Width, ctl.Height);
     }
     formLoading.Size = size;
     AdjustLoacation(ctl);
 }
Ejemplo n.º 36
0
 void RefreshAccData()
 {
     this.Opacity = 1;
     this.uiHandler -= new UiHandler(this.LoginResult);
     this.uiHandler -= new UiHandler(this.ShowAccData);
     this.uiHandler += new UiHandler(this.ShowAccData);
     //加载帐套信息
     ThreadPool.QueueUserWorkItem(new WaitCallback(this._LoadAccData));
 }
Ejemplo n.º 37
0
        private void panelLogin_Click(object sender, EventArgs e)
        {
            pictureBox4.Image = Properties.Resources.top2;
            if (this.enableFlag)
            {                
                if (this.dtDb.Rows.Count == 0)
                {
                    MessageBoxEx.Show("帐套信息加载中…");
                    this.RefreshAccData();
                    return;
                }
                this.errorProvider.Clear();
                if (string.IsNullOrEmpty(this.tbUser.Caption.Trim())
                    || this.tbUser.Caption.Trim() == "用户名")
                {
                    Utility.Common.Validator.SetError(this.errorProvider, this.tbUser, "用户名不能为空!");
                    return;
                }
                if (string.IsNullOrEmpty(this.tbPwd.Caption.Trim())
                    || this.tbPwd.Caption.Trim() == "密码")
                {
                    Utility.Common.Validator.SetError(this.errorProvider, this.tbPwd, "密码不能为空!");
                    return;
                }
                //FormLoading.StartLoading(this,new Size(110,120));
                this.enableFlag = false;
                this.userName = this.tbUser.Caption.Trim();
                this.pwd = this.tbPwd.Caption.Trim();
                this.uiHandler += new UiHandler(this.LoginResult);

                //保存帐套信息
                string dbId = this.tbDb.Tag.ToString();
                DataRow dr = this.dtDb.Select("Value='" + dbId + "'")[0];

                GlobalStaticObj.CurrAccID = dbId;
                GlobalStaticObj.CurrAccCode = dr["Code"].ToString();
                GlobalStaticObj.CurrAccName = dr["Name"].ToString();
                GlobalStaticObj.IsDefaultAcc = dr["Status"].ToString() == DataSources.EnumYesNo.Yes.ToString("d");

                this.timer.Enabled = true;

                //登录验证                             
                ThreadPool.QueueUserWorkItem(new WaitCallback(this._Login));
            }
            else
            {
                MessageBoxEx.Show("服务连接异常!");
            }
        }
Ejemplo n.º 38
0
 protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
 {
     if (keyData == Keys.Escape)
     {
         if (this.formCmb.Visible)
         {
             this.formCmb.Hide();
             return true;
         }
     }
     else if (keyData == Keys.Enter)
     {
         panelLogin_Click(null, null);
         return true;
     }
     else if (keyData == Keys.F5)
     {
         this.uiHandler -= new UiHandler(this.LoginResult);
         this.uiHandler -= new UiHandler(this.ShowAccData);
         this.uiHandler += new UiHandler(this.ShowAccData);
         ThreadPool.QueueUserWorkItem(new WaitCallback(this._LoadAccData));
         return true;
     }
     return base.ProcessCmdKey(ref msg, keyData);
 }
Ejemplo n.º 39
0
        private void LoginResult(object obj)
        {
            this.uiHandler -= new UiHandler(this.LoginResult);

            if (this.enableFlag)
            {
                return;
            }

            this.timer.Enabled = false;

            string errMsg = obj.ToString();
            if (!string.IsNullOrEmpty(errMsg))
            {
                FormLoading.EndLoading();
                FormMessgeBox.ShowMsg(this, errMsg, this.panelTop.BackColor);
                this.enableFlag = true;                
                return;
            }

            if (HXCPcClient.GlobalStaticObj.gLoginDataSet == null)
            {
                FormMessgeBox.ShowMsg(this, "数据加载失败!", this.panelTop.BackColor);
                FormLoading.EndLoading();
                this.enableFlag = true;
                return;
            }

            if (HXCPcClient.GlobalStaticObj.gLoginDataSet.Tables[0].Rows.Count < 1)
            {
                FormLoading.EndLoading();
                this.enableFlag = true;
                return;
            }

            try
            {
                #region 服务站信息   add by kord
                var dr = DBHelper.GetTable("获取当前服务站信息", GlobalStaticObj.CommAccCode, "tb_company", "*", "data_source = '2'", "", "");
                if (dr == null || dr.Rows.Count == 0)
                {
                    GlobalStaticObj.GlobalLogService.WriteLog("无法获取当前服务站信息");
                }
                else
                {
                    GlobalStaticObj.ServerStationCode = CommonCtrl.IsNullToString(dr.Rows[0]["sap_code"]);
                    GlobalStaticObj.ServerStationName = CommonCtrl.IsNullToString(dr.Rows[0]["com_name"]);
                    
                }
                #endregion

                GlobalStaticObj.CookieStr = GlobalStaticObj.gLoginDataSet.Tables["cookieStr"].Rows[0][0].ToString();
                GlobalStaticObj.UserID = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["user_id"].ToString();
                GlobalStaticObj.UserName = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["user_name"].ToString();
                GlobalStaticObj.LandName = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["land_name"].ToString();
                GlobalStaticObj.PassWord = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["password"].ToString();
                GlobalStaticObj.CurrUserCom_Id = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["com_id"].ToString();
                GlobalStaticObj.CurrUserCom_Code = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["com_code"].ToString();
                GlobalStaticObj.CurrUserCom_Name = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["com_name"].ToString();
                GlobalStaticObj.CurrUserOrg_Id = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["org_id"].ToString();
                GlobalStaticObj.CurrUserOrg_Name = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["org_name"].ToString();
                GlobalStaticObj.CurrUserCom_Category = CommonCtrl.IsNullToString(HXCPcClient.GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["category"]);  //modify by kord

            }
            catch (Exception ex)
            {
                //write log
            }

            ThreadPool.SetMinThreads(3, 3);
            ThreadPool.SetMaxThreads(5, 5);

            //预加载信息
            LocalCache.PreLoad();

            //记忆登录保存
            this.SaveMemery();

            FormLoading.EndLoading();
            this.DialogResult = DialogResult.OK;//关键:设置登陆成功状态            
        }
Ejemplo n.º 40
0
        private void FormLogin_Load(object sender, EventArgs e)
        {
            this.dtDb = new DataTable();
            this.dtDb.Columns.Add("DisplayName");
            this.dtDb.Columns.Add("Name");
            this.dtDb.Columns.Add("Value");
            this.dtDb.Columns.Add("Code");
            this.dtDb.Columns.Add("Status");
            this.uiHandler -= new UiHandler(this.ShowAccData);
            this.uiHandler += new UiHandler(this.ShowAccData);

            //初始化Wcf
            WCFClientProxy.CreatePCClientProxy();

            //加载帐套信息
            ThreadPool.QueueUserWorkItem(new WaitCallback(this._LoadAccData));

            //初始化配置
            LocalVariable.Init();

            //加载登录记忆
            this.LoadMemery();
        }
Ejemplo n.º 41
0
 public void _ShowItem(DataTable dt)
 {
     this.loadFlag = false;
     UiHandler _uiHandler = new UiHandler(this.ShowItem);
     this.Invoke(_uiHandler,dt);
 }
Ejemplo n.º 42
0
 private void panelLogin_Click(object sender, EventArgs e)
 {
     pictureBox4.Image = Properties.Resources.top2;
     if (this.enableFlag)
     {
         this.errorProvider.Clear();
         if (string.IsNullOrEmpty(this.tbUser.Caption.Trim())
             || this.tbUser.Caption.Trim() == "用户名")
         {
             Utility.Common.Validator.SetError(this.errorProvider, this.tbUser, "用户名不能为空!");
             return;
         }
         if (string.IsNullOrEmpty(this.tbPwd.Caption.Trim())
             || this.tbPwd.Caption.Trim() == "密码")
         {
             Utility.Common.Validator.SetError(this.errorProvider, this.tbPwd, "密码不能为空!");
             return;
         }
         //FormLoading.StartLoading(this, new Size(110, 120));
         this.enableFlag = false;
         this.userName = this.tbUser.Caption.Trim();
         this.pwd = this.tbPwd.Caption.Trim();
         this.uiHandler += new UiHandler(this.LoginResult);
         //登录验证                             
         ThreadPool.QueueUserWorkItem(new WaitCallback(this._Login));
     }
     else
     {
         FormMessgeBox.ShowMsg(this, "数据库连接异常!", this.panelTop.BackColor);
     }
 }
Ejemplo n.º 43
0
        private void LoginResult(object obj)
        {
            this.uiHandler -= new UiHandler(this.LoginResult);
            string errMsg = obj.ToString();

            if (!string.IsNullOrEmpty(errMsg))
            {
                FormLoading.EndLoading();
                FormMessgeBox.ShowMsg(this, errMsg, this.panelTop.BackColor);
                this.enableFlag = true;
                return;
            }


            if (GlobalStaticObj.gLoginDataSet == null
               || GlobalStaticObj.gLoginDataSet.Tables.Count == 0
               || GlobalStaticObj.gLoginDataSet.Tables[0].Rows.Count < 1)
            {
                this.enableFlag = true;
                FormLoading.EndLoading();
                FormMessgeBox.ShowMsg(this, "用户名或密码错误!", this.panelTop.BackColor);
                return;
            }

            if (HXCServerWinForm.GlobalStaticObj.gLoginDataSet.Tables[0].Rows.Count < 1)
            {
                this.enableFlag = true;
                FormMessgeBox.ShowMsg(this, "数据加载失败!", this.panelTop.BackColor);
                FormLoading.EndLoading();
                return;
            }

            #region 设置全局变量
            GlobalStaticObj_Server.Instance.UserID = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["user_id"].ToString();
            GlobalStaticObj_Server.Instance.UserName = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["user_name"].ToString();
            GlobalStaticObj_Server.Instance.LoginName = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["land_name"].ToString();
            GlobalStaticObj_Server.Instance.PassWord = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["password"].ToString();

            GlobalStaticObj_Server.Instance.RoleID = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["role_id"].ToString();
            GlobalStaticObj_Server.Instance.RoleName = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["role_name"].ToString();
            GlobalStaticObj_Server.Instance.OrgID = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["org_id"].ToString();
            GlobalStaticObj_Server.Instance.OrgName = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["org_name"].ToString();

            GlobalStaticObj_Server.Instance.ComID = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["com_id"].ToString();
            GlobalStaticObj_Server.Instance.ComName = GlobalStaticObj.gLoginDataSet.Tables[0].Rows[0]["com_name"].ToString();
            GlobalStaticObj_Server.Instance.LoginTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            #endregion

            //预加载信息
            //LocalCache.PreLoad();

            //登录记忆保存
            this.SaveMemery();

            FormLoading.EndLoading();
            this.DialogResult = DialogResult.OK;//关键:设置登陆成功状态            
        }
Ejemplo n.º 44
0
 private void _LoadReminder(DataSet ds)
 {
     this.loadFlag = false;
     UiHandler _uiHandler = new UiHandler(this.LoadReminder);
     this.Invoke(_uiHandler, ds);
 }
Ejemplo n.º 45
0
        /// <summary> 加载其他信息
        /// </summary>
        public void HandlerOther()
        {

            GlobalStaticObj_Server.Instance.FilePath = System.Configuration.ConfigurationManager.AppSettings["savePath"].ToString();
            string dbName = GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode;

            GlobalStaticObj_Server.Instance.DbServerInstallDir = DBHelper.GetSingleValue("获取数据库安装路径", dbName, "sys_config", "key_value", "key_name='DbServerInstallDir'", "");
            GlobalStaticObj_Server.Instance.DbServerBackDir = DBHelper.GetSingleValue("获取数据库备份路径", dbName, "sys_config", "key_value", "key_name='DbServerBackDir'", "");
            //获取宇通加密秘钥
            yuTongWebService.GlobalStaticObj_YT.KeySecurity_YT = DBHelper.GetSingleValue("获取服务站省份", dbName, "sys_config", "key_value", "key_name='KeySecurity_YT'", "");
            //获取服务站所长省份,cxz
            GlobalStaticObj_Server.Instance.ServiceStationProvince = DBHelper.GetSingleValue("获取服务站省份", dbName, "tb_company", "province",
               string.Format("data_source='2' and sap_code='{0}'", yuTongWebService.GlobalStaticObj_YT.SAPCode), "");

            CommonUtility.LoadAutoBackUpPlanInfo();

            #region 启用服务
            btnServer_Click(null, null);
            #endregion

            #region --启动云平台通讯服务
            this.uiHandler += new UiHandler(this.InitCloundService);
            ThreadPool.QueueUserWorkItem(new WaitCallback(this._StartCloundService));
            #endregion

            #region 启用宇通系统链接
            btnYutong_Click(null, null);
            #endregion
        }
Ejemplo n.º 46
0
 private void ShowAccData(object obj)
 {
     this.uiHandler -= new UiHandler(this.ShowAccData);
     if (obj.ToString().Length > 0)
     {
         FormLoading.EndLoading();
         if (this.formSet == null || !this.formSet.Visible)
         {
             FormMessgeBox.ShowMsg(this, "无法加载帐套数据!", this.panelTop.BackColor);
         }
     }
     this.enableFlag = true;
     //加载帐套
     if (this.dtDb.Rows.Count > 0)
     {
         this.tbDb.Caption = this.dtDb.Rows[0]["DisplayName"].ToString();
         this.tbDb.Tag = this.dtDb.Rows[0]["Value"].ToString();
         if (this.tbUser.Caption.Trim().Length == 0)
         {
             this.tbUser.Focus();
         }
         else
         {
             if (this.tbPwd.Caption.Trim().Length == 0)
             {
                 this.tbPwd.Focus();
             }
             else
             {
                 this.panelLogin.Focus();
             }
         }
     }
     this.formCmb = new FormCmb();
     this.formCmb.DisplayName = "DisplayName";
     this.formCmb.ValueName = "Value";
     this.formCmb.ItemHeight = 35;
     this.formCmb.BackColor = Color.White;
     this.formCmb.SelectedColor = Color.FromArgb(97, 167, 208);
     this.formCmb.ItemSelected += new FormCmb.ItemSelectedHandler(this.SeletecdAccount);
     this.formCmb.BindCmb(this.tbDb.InnerTextBox, this.dtDb, this.tbDb.Location.X,
         this.panelDb.Height - this.tbDb.Location.Y - this.tbDb.Height, false);
 }