コード例 #1
0
 public Connection(
     Common.Connection connection,
     List <Base.Srv.Dto.KeyValuePair <int, string> > automationTypeId
     )
 {
     ConnectionDto    = connection;
     AutomationTypeId = new ListKeyValuePair <int, string>(automationTypeId);
 }
コード例 #2
0
 private void simpleButtonLogin_Click(object sender, EventArgs e)
 {
     if (this.comboBoxEditConnections.SelectedItem == null)
     {
         MessageBox.Show(Properties.Resources.RequireChooseConnection);
         return;
     }
     //ÕýÔÚ¼ì²âÁ¬½Ó...
     this.labelControl1.Text = Properties.Resources.CheckIngConnection;
     Cursor.Current          = Cursors.WaitCursor;
     Application.DoEvents();
     Common.Connection connection = this.comboBoxEditConnections.SelectedItem as Common.Connection;
     if (!connection.Awailable)
     {
         this.labelControl1.Text = Properties.Resources.ConnectionCannotUse;
         Cursor.Current          = Cursors.Default;
         return;
     }
     Cursor.Current    = Cursors.Default;
     this.DialogResult = DialogResult.OK;
 }
コード例 #3
0
        /// <inheritdoc />
        public virtual async Task <(ConnectionResponseMessage, ConnectionRecord)> CreateResponseAsync(IAgentContext agentContext, string connectionId)
        {
            Logger.LogTrace(LoggingEvents.AcceptConnectionRequest, "ConnectionId {0}", connectionId);

            var connection = await GetAsync(agentContext, connectionId);

            if (connection.State != ConnectionState.Negotiating)
            {
                throw new AriesFrameworkException(ErrorCode.RecordInInvalidState,
                                                  $"Connection state was invalid. Expected '{ConnectionState.Negotiating}', found '{connection.State}'");
            }

            await connection.TriggerAsync(ConnectionTrigger.Response);

            await RecordService.UpdateAsync(agentContext.Wallet, connection);

            // Send back response message
            var provisioning = await ProvisioningService.GetProvisioningAsync(agentContext.Wallet);

            var connectionData = new Common.Connection
            {
                Did    = connection.MyDid,
                DidDoc = connection.MyDidDoc(provisioning)
            };

            var sigData = await SignatureUtils.SignDataAsync(agentContext, connectionData, connection.GetTag(TagConstants.ConnectionKey));

            var threadId = connection.GetTag(TagConstants.LastThreadId);

            var response = new ConnectionResponseMessage(agentContext.UseMessageTypesHttps)
            {
                ConnectionSig = sigData
            };

            response.ThreadFrom(threadId);

            return(response, connection);
        }
コード例 #4
0
ファイル: LoginForm.cs プロジェクト: daobataotie/EDERP
        private void simpleButtonLogin_Click(object sender, EventArgs e)
        {
            //数据库连接判断


            if (this.comboBoxEditConnections.SelectedItem == null)
            {
                MessageBox.Show(Properties.Resources.RequireChooseConnection);
                return;
            }
            //正在检测连接...
            //  this.labelControl1.Text = Properties.Resources.CheckIngConnection;
            Cursor.Current = Cursors.WaitCursor;
            Application.DoEvents();
            Common.Connection connection = this.comboBoxEditConnections.SelectedItem as Common.Connection;
            if (!connection.Awailable)
            {
                this.labelControl1.Text = Properties.Resources.ConnectionCannotUse;
                Cursor.Current          = Cursors.Default;
                return;
            }



            //Cursor.Current = Cursors.Default;

            //用户名 密码

            string operatorName = this.comboBoxEditOperator.Text.Trim();
            string password     = this.textEditPassWord.Text.Trim();



            Model.Operators _operator = this.operatorsManager.GetByOperatorName(operatorName);

            if (_operator == null)
            {
                MessageBox.Show(Properties.Resources.NoThisUser, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if (_operator.Password != password)
            {
                MessageBox.Show(Properties.Resources.PassWordError, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            this._operator = _operator;


            //this._currentModule = this.comboBoxModule.SelectedItem as Module;
            this._currentModule = new Module("Stock", Properties.Resources.DepotMana, "Book.UI.MainForm");

            this.DialogResult = DialogResult.OK;

            //string dataname = SelectedConnection.Name;
            //string username = _operator.OperatorName;

            //Module.mSaveSetting(Module.BASE_NAME, dataname, Module.BASE_INFO);
            //Module.mSaveSetting(Module.USER_NAME, username, Module.USER_INFO);
            String      configFile = Application.ExecutablePath + ".config";
            XmlDocument document   = new XmlDocument();

            document.Load(configFile);

            XmlNodeList nodes = document.SelectNodes("/configuration/userSettings/Book.UI.Properties.Settings/setting");

            foreach (XmlNode node in nodes)
            {
                switch (node.Attributes["name"].Value)
                {
                case "connection":
                    node.FirstChild.InnerText = SelectedConnection.Name;
                    break;

                case "username":
                    node.FirstChild.InnerText = _operator.OperatorName;
                    break;
                }

                document.Save(configFile);
            }
        }