Example #1
0
 public void Execute()
 {
     var dialogResult = MessageBox.Show(MultilingualUtility.GetString("IsSync"),
                 MultilingualUtility.GetString("SyncConfig"),
                 MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
     if (dialogResult == DialogResult.OK)
     {
         if (TestSql()
             && TestLocalMongoDB())
         {
             var action = new ConfigDataAction();
             using (var dialog = new Com.Heguang.ConfigToolManager.Dialogs.ProgressBar(action))
             {
                 dialog.ShowDialog();
             }
         }
     }
 }
Example #2
0
        private void llabSync_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (TestSql()
                && TestLocalMongoDB()
                && TestRemoteMongoDB())
            {
                var result = DALFacade.GetUserInfoDAL(StorageTypeEnum.SqlServer).Select(txtUserName.Text);
                if (result == null)
                {
                    DialogResult = System.Windows.Forms.DialogResult.None;
                    MessageBox.Show(MultilingualUtility.GetString("LoginFailure"),
                                MultilingualUtility.GetString("LoginFailure"),
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                var authResult = FormsAuthenUtility.AuthUser(result, txtPwd.Text);
                if (!authResult)
                {
                    DialogResult = System.Windows.Forms.DialogResult.None;
                    MessageBox.Show(MultilingualUtility.GetString("LoginFailure"),
                                MultilingualUtility.GetString("LoginFailure"),
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                var dialogResult = MessageBox.Show(MultilingualUtility.GetString("IsSync"),
                           MultilingualUtility.GetString("SyncPageToLocal"),
                           MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
                if (dialogResult == DialogResult.OK)
                {
                    ConfigToolContext.Instance.CurrentUser = result;
                    var action = new ConfigDataAction();
                    using (var dialog = new Com.Heguang.ConfigToolManager.Dialogs.ProgressBar(action))
                    {
                        dialog.ShowDialog();
                    }
                    var actionL = new PageToLocalAction();
                    using (var dialog = new Com.Heguang.ConfigToolManager.Dialogs.ProgressBar(actionL))
                    {
                        dialog.ShowDialog();
                    }
                }
            }
        }