Exemple #1
0
        public bool Demande_carte(ClientInformations ClientDemande)
        {
            SqlTransaction Trans        = null;
            bool           TransOuverte = false;

            try
            {
                SqlConnection Conn;
                SqlCommand    command;
                Conn = new SqlConnection(Startup.DSN_EXTRANET);
                Conn.Open();
                TransOuverte = true;

                Trans = Conn.BeginTransaction();

                command                = new SqlCommand("Demande_Carte", Conn, Trans);
                command.CommandType    = CommandType.StoredProcedure;
                command.CommandTimeout = 750;
                command.Parameters.Add("@PRENOM", SqlDbType.VarChar).Value     = ClientDemande.CLI_PRENOM;
                command.Parameters.Add("@NOM", SqlDbType.VarChar).Value        = ClientDemande.CLI_NOM2;
                command.Parameters.Add("@TEL", SqlDbType.VarChar).Value        = ClientDemande.CLI_PORTABLE;
                command.Parameters.Add("@ADRPOS", SqlDbType.VarChar).Value     = ClientDemande.CLI_ADRPOS;
                command.Parameters.Add("@COMMUNE", SqlDbType.VarChar).Value    = ClientDemande.CLI_COMMUNE;
                command.Parameters.Add("@CODEPOSTAL", SqlDbType.VarChar).Value = ClientDemande.CLI_POSTE;
                command.Parameters.Add("@EMAIL", SqlDbType.VarChar).Value      = ClientDemande.CLI_EMAIL;
                command.ExecuteNonQuery();
                command.Dispose();

                Trans.Commit();
                Trans.Dispose();
                Conn.Dispose();

                return(true);
            }
            catch (Exception e)
            {
                if (TransOuverte)
                {
                    Trans.Rollback();
                    Trans.Dispose();
                }
                Console.WriteLine(e);
                return(false);
            }
        }
Exemple #2
0
    public virtual void ValidateAndExecute(ClientInformations clientInformations, IPEndPoint sender)
    {
        this.clientInformations = clientInformations;
        this.sender             = sender;

        CustomDebug.Log("Try to validate " + GetType(), VerboseLevel.ALL);
        if (alreadyValidate || CheckAllValidation())
        {
            CustomDebug.Log("Execute " + GetType(), VerboseLevel.ALL);
            if (Execute())
            {
                AddMainThreadAction();
            }
            clientInformations.client.ResetTime();
        }
        else
        {
            throw new BadDataException("Data is corrupted");
        }
    }
Exemple #3
0
        private void LoadClientList()
        {
            RestController <ClientInformations> rclist;

            rclist = new RestController <ClientInformations>(Settings.RestController.ServerBase,
                                                             "stations", Settings.RestController.ResourcePrefix);
            ClientInformations clist = null;

            try
            {
                //string param = "?data=" + txtChat.Text;
                clist = rclist.GetData();
                if (clist != null)
                {
                    //for
                }
            }
            catch (Exception exp) {
                AddToList(txtChat.Text + " : " + exp.Message);
            }
        }
Exemple #4
0
 public ClientParser(ClientInformations clientInformations)
 {
     this.clientInformations = clientInformations;
 }