Example #1
0
 private void notifyListeners(BClient client, Exception e)
 {
     foreach (IXAuthenticationListener lsn in listeners)
     {
         lsn(client, e);
     }
 }
Example #2
0
        public virtual bool isReloginException(BClient client, Exception ex, int typeId)
        {
            if (typeId == BRequest_IXServicePortIF_sendEvents.serialVersionUID ||
                typeId == BRequest_IXServicePortIF_createEventBusListener.serialVersionUID)
            {
                return(false);
            }

            if (client.getTransport().isReloginException(ex, BRegistry.TYPEID_VOID))
            {
                return(true);
            }

            String msg = ex.ToString();

            for (int i = 0; i < RELOGIN_ERRORS.Length; i++)
            {
                if (msg.IndexOf(RELOGIN_ERRORS[i]) >= 0)
                {
                    return(true);
                }
            }

            return(false);
        }
Example #3
0
        public void Select()
        {
            bool             result          = false;
            BAudit           bAudit          = new BAudit();
            List <EAudit>    listAudit       = new List <EAudit>();
            BClient          bClient         = new BClient();
            EClient          eClient         = new EClient();
            EClient          selectedEClient = new EClient();
            TransactionScope ts = new TransactionScope(TransactionScopeOption.RequiresNew);

            eClient.CodeTypeDocumentIdentity = "0";
            eClient.NumberIdentity           = Aleatory.GetString(11);
            eClient.FirstName          = Aleatory.GetString(8);
            eClient.SecondName         = Aleatory.GetString(8);
            eClient.FatherLastName     = Aleatory.GetString(8);
            eClient.MotherLastName     = Aleatory.GetString(8);
            eClient.Audit.UserRegister = Aleatory.GetString(8);
            EClient insertedEClient = bClient.Insert(eClient);

            selectedEClient = bClient.Select(insertedEClient);

            if (selectedEClient != null &&
                selectedEClient.CodeClient == insertedEClient.CodeClient &&
                selectedEClient.SearchName == insertedEClient.SearchName &&
                selectedEClient.State == insertedEClient.State)
            {
                result = true;
            }

            ts.Dispose();

            Assert.IsTrue(result);
        }
Example #4
0
 public override bool isReloginException(BClient client, Exception e, int typeId)
 {
     if (e.ToString().IndexOf("[ELOIX:" + IXExceptionC.INVALID_SESSION) >= 0)
     {
         // Wenn das Ticket nicht mehr gültig ist, dann kann ich es durch ein re-login nicht erneuern.
         // Denn Name/Passwort sind unbekannt.
         return(false);
     }
     else
     {
         return(base.isReloginException(client, e, typeId));
     }
 }
            public virtual void authenticate(BClient client, BAsyncResult <bool> asyncResult)
            {
                log.info("authenticate(");

                BAsyncResult <SessionInfo> sessResult = (sess, ex) =>
                {
                    this.sess = sess;
                    asyncResult(true, ex);
                };

                ((BClient_Testser)client).RemoteWithAuthentication.Login(userName, pwd, sessResult);

                log.info(")authenticate");
            }
Example #6
0
        public void Update()
        {
            bool             result    = false;
            BAudit           bAudit    = new BAudit();
            List <EAudit>    listAudit = new List <EAudit>();
            BClient          bClient   = new BClient();
            EClient          eClient   = new EClient();
            TransactionScope ts        = new TransactionScope(TransactionScopeOption.RequiresNew);

            eClient.CodeTypeDocumentIdentity = "0";
            eClient.NumberIdentity           = Aleatory.GetString(11);
            eClient.FirstName          = Aleatory.GetString(8);
            eClient.SecondName         = Aleatory.GetString(8);
            eClient.FatherLastName     = Aleatory.GetString(8);
            eClient.MotherLastName     = Aleatory.GetString(8);
            eClient.Audit.UserRegister = Aleatory.GetString(8);
            EClient insertedEClient = bClient.Insert(eClient);

            insertedEClient.FirstName          = Aleatory.GetString(8);
            insertedEClient.SecondName         = Aleatory.GetString(8);
            insertedEClient.FatherLastName     = Aleatory.GetString(8);
            insertedEClient.MotherLastName     = Aleatory.GetString(8);
            insertedEClient.Audit.UserRegister = Aleatory.GetString(8);
            EClient updatedEClient = bClient.Update(insertedEClient);

            listAudit = bAudit.Select(eClient.Audit);

            if (updatedEClient != null &&
                updatedEClient.SearchName != eClient.SearchName &&
                listAudit.Count > 0 &&
                listAudit.Exists(
                    x => x.UserRegister == insertedEClient.Audit.UserRegister &&
                    x.Code == updatedEClient.CodeClient.ToString() &&
                    x.TypeEvent == "Update"))
            {
                result = true;
            }

            ts.Dispose();

            Assert.IsTrue(result);
        }
Example #7
0
 public virtual void getSession(BClient client, int typeId, BAsyncResult <Object> asyncResult)
 {
     if (needAlive())
     {
         ticketBestBeforeAlive = 0L;
         BAsyncResult <Object> aliveResult = (ignored, e) =>
         {
             if (e == null)
             {
                 setTicketValid();
             }
             asyncResult(loginResult.clientInfo, e);
         };
         ((BClient_Indexserver)client).IXServicePortIF.alive(aliveResult);
     }
     else
     {
         asyncResult(loginResult.clientInfo, null);
     }
 }
Example #8
0
        public void Insert()
        {
            bool             result    = false;
            BAudit           bAudit    = new BAudit();
            List <EAudit>    listAudit = new List <EAudit>();
            BClient          bClient   = new BClient();
            EClient          eClient   = new EClient();
            BSequence        bSequence = new BSequence();
            ESequence        eSequence = null;
            TransactionScope ts        = new TransactionScope(TransactionScopeOption.RequiresNew);

            eClient.CodeTypeDocumentIdentity = "0";
            eClient.NumberIdentity           = Aleatory.GetString(11);
            eClient.FirstName          = Aleatory.GetString(8);
            eClient.SecondName         = Aleatory.GetString(8);
            eClient.FatherLastName     = Aleatory.GetString(8);
            eClient.MotherLastName     = Aleatory.GetString(8);
            eClient.Audit.UserRegister = Aleatory.GetString(8);
            EClient insertedEClient = bClient.Insert(eClient);

            eSequence = new ESequence(eClient);
            eSequence = bSequence.Select(eSequence);

            listAudit = bAudit.Select(eClient.Audit);

            if (insertedEClient != null &&
                listAudit.Exists(x => x.UserRegister == eClient.Audit.UserRegister &&
                                 x.TypeEvent == "Insert" &&
                                 x.Code == insertedEClient.CodeClient.ToString()) &&
                eSequence.Correlative == insertedEClient.CodeClient + 1)
            {
                result = true;
            }

            ts.Dispose();

            Assert.IsTrue(result);
        }
Example #9
0
        public virtual void authenticate(BClient client1, BAsyncResult <Boolean> asyncResult)
        {
            BClient_Indexserver client = (BClient_Indexserver)client1;

            BAsyncResult <bool> listenerResult = (ignored, e) =>
            {
                notifyListeners(client, e);
                asyncResult(ignored, e);
            };

            BAsyncResult <bool> outerResult = (ignored, e) =>
            {
                if (e != null)
                {
                    asyncResult(ignored, e);
                }
                else
                {
                    invokeInternalAuthenticateThenSetGetServerInfo(client, listenerResult);
                }
            };

            providePublicEncrKey(client, outerResult);
        }
Example #10
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult option;
                option = MessageBox.Show("Do you really want to delete?", "SysBusiness", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                if (option == DialogResult.OK)
                {
                    string Code;
                    string resp = "";

                    foreach (DataGridViewRow row in dataList.Rows)
                    {
                        if (Convert.ToBoolean(row.Cells[0].Value))
                        {
                            Code = Convert.ToString(row.Cells[1].Value);
                            resp = BClient.Delete(Convert.ToInt32(Code));

                            if (resp.Equals("OK"))
                            {
                                this.MessageOk("Success deleted");
                            }
                            else
                            {
                                this.MessageError(resp);
                            }
                        }
                    }
                    this.ShowValues();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace);
            }
        }
Example #11
0
	    public static void checkTempDirEmpty(BClient client) 
        {
		    log.info("check temp dir is empty");
		    String[] tempFiles = client.getTransport().getWire().getTestAdapter().getServerTempFiles();
		    TestUtils.assertEquals(log, "temp files", new String[0], tempFiles);
	    }
Example #12
0
 private void SearchName()
 {
     this.dataList.DataSource = BClient.SearchName(this.txtSearch.Text);
     //this.HideCollumns();
     lblTotal.Text = Convert.ToString(dataList.Rows.Count) + " registers found";
 }
Example #13
0
 private void ShowValues()
 {
     this.dataList.DataSource = BClient.ShowValues();
     //this.HideCollumns();
     lblTotal.Text = Convert.ToString(dataList.Rows.Count) + " registers found";
 }
Example #14
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                string resp = "";
                if (txtName.Text == string.Empty)
                {
                    MessageError("Fill the fields");
                    errorIcon.SetError(txtName, "Insert the client's name");
                }
                else
                {
                    if (this.eNew)
                    {
                        resp = BClient.Insert(
                            this.txtName.Text.Trim().ToUpper(),
                            this.txtSurname.Text,
                            this.cbGender.Text,
                            this.dtDate.Value,
                            this.cbDocType.Text,
                            this.txtDocNumber.Text,
                            this.txtAddress.Text,
                            this.txtPhone.Text,
                            this.txtEmail.Text

                            );
                    }
                    else
                    {
                        resp = BClient.Edit(Convert.ToInt32(this.txtId.Text),
                                            this.txtName.Text.Trim().ToUpper(), this.txtSurname.Text,
                                            this.cbGender.Text, this.dtDate.Value, this.cbDocType.Text,
                                            this.txtDocNumber.Text, this.txtAddress.Text, this.txtPhone.Text, this.txtEmail.Text
                                            );
                    }

                    if (resp.Equals("OK"))
                    {
                        if (this.eNew)
                        {
                            this.MessageOk("Client saved");
                        }
                        else
                        {
                            this.MessageOk("Client Edited");
                        }
                    }
                    else
                    {
                        this.MessageError(resp);
                    }

                    this.eNew  = false;
                    this.eEdit = false;
                    this.Enabledbuttons();
                    this.Clean();
                    this.ShowValues();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace);
            }
        }
 public void getSession(BClient client, int typeId, BAsyncResult <Object> asyncResult)
 {
     asyncResult(sess, null);
 }
 public bool isReloginException(BClient client, Exception ex, int typeId)
 {
     return(client.getTransport().isReloginException(ex, typeId));
 }
Example #17
0
	    public BServer(BServer rhs) {
		    this.transport = rhs.transport;
		    this.clientR = rhs.clientR;
		    this.remotes = rhs.remotes;
	    }
Example #18
0
	    public BServer(BTransport transport, BClient clientR) {
		    this.transport = transport;
		    this.clientR = clientR;
		    this.remotes = new Dictionary<int, BRemote>();
	    }
 public BClient createClientR(BClient client)
 {
     return null;
 }
Example #20
0
 public static void checkTempDirEmpty(BClient client)
 {
     log.info("check temp dir is empty");
     String[] tempFiles = client.getTransport().getWire().getTestAdapter().getServerTempFiles();
     TestUtils.assertEquals(log, "temp files", new String[0], tempFiles);
 }