Ejemplo n.º 1
0
        public void AddClientToBdd(ref string FirstName, ref string LastName, ref string Country, ref string city, ref string CellNumber, ref string Address, ref string Email)

        {
            storedProcedure_name = @"dbo.[AddClient]";

            using SqlConnection connection = new SqlConnection(Helper.CnnVal("ManagementAppDB"));
            {
                SqlCommand command = new SqlCommand(storedProcedure_name, connection);

                command.Parameters.Add("@FirstName", SqlDbType.VarChar).Value  = FirstName;
                command.Parameters.Add("@LastName", SqlDbType.VarChar).Value   = LastName;
                command.Parameters.Add("@Country", SqlDbType.VarChar).Value    = Country;
                command.Parameters.Add("@City", SqlDbType.VarChar).Value       = city;
                command.Parameters.Add("@CellNumber", SqlDbType.VarChar).Value = CellNumber;
                command.Parameters.Add("@Address", SqlDbType.VarChar).Value    = Address;
                command.Parameters.Add("@Email", SqlDbType.VarChar).Value      = Email;


                connection.Open();
                command.CommandType = CommandType.StoredProcedure;
                command.ExecuteNonQuery();
                increment += 1;

                if (increment >= 1)
                {
                    Manage = new VerifyInformation_And_ManageStuff();
                    Manage.GetCurrentMenuFormInstance(ref Menu);
                }
            }
        }
Ejemplo n.º 2
0
        private void EnregistrerBtn_Click(object sender, EventArgs e)
        {
            DataAccess InsertDatatoBdd = new DataAccess();

            VerifyInformation_And_ManageStuff Ifempty = new VerifyInformation_And_ManageStuff();
            string prenom = "", nom = "", pays = "", ville = "", adresse = "", mail = "", telephone = "";



            prenom    = Prenom.Text;
            nom       = Nom.Text;
            pays      = Pays.Text;
            ville     = Ville.Text;
            telephone = Telephone.Text;
            adresse   = Adresse.Text;
            mail      = Mail.Text;

            if (!Ifempty.IsAddClientTextfieldEmpty(prenom, nom, pays, ville, Telephone.Text, adresse, mail))
            {
                return;
            }
            else
            {
                InsertDatatoBdd.AddClientToBdd(ref prenom, ref nom, ref pays, ref ville, ref telephone, ref adresse, ref mail);
                MessageBox.Show("Enregistrement reussi", "Enregistrement", MessageBoxButtons.OK, MessageBoxIcon.Information);


                this.Hide();

                ResetTextboxContains();
            }
        }
Ejemplo n.º 3
0
        private void Login_button_Click(object sender, EventArgs e)
        {
            DataAccess data = new DataAccess();
            VerifyInformation_And_ManageStuff IfEmpty = new VerifyInformation_And_ManageStuff();

            if (!IfEmpty.IsLoginTextfieldEmpty(UserNameTextbox.Text, PasswordTextbox.Text))
            {
                return;
            }

            data.VerifyCredentialsInformation(UserNameTextbox.Text, PasswordTextbox.Text);
        }