CafeProject.frmProfilGuncelleme.profilUpdate C# (CSharp) Метод

profilUpdate() публичный Метод

public profilUpdate ( string adi, string soyadi, string telefon, string mail, string adres, string tcno, string notlar ) : void
adi string
soyadi string
telefon string
mail string
adres string
tcno string
notlar string
Результат void
        public void profilUpdate(string adi, string soyadi, string telefon, string mail, string adres, string tcno, string notlar)
        {
            if (!Regex.IsMatch(adi, @"^[ABCÇDEFGĞHIİJKLMNOÖPRSŞTUÜVYZQWXabcçdefgğhıijklmnoöprsştuüvyzqwx]+$")||!Regex.IsMatch(soyadi, @"^[ABCÇDEFGĞHIİJKLMNOÖPRSŞTUÜVYZQWXabcçdefgğhıijklmnoöprsştuüvyzqwx]+$"))
            {
               MessageBox.Show("Lütfen adı soyadı için sadece harf giriniz!");
                textBox1.Text = "";
                textBox2.Text = "";
                textBox1.Focus();
            }
            else if (!Regex.IsMatch(telefon, @"^[0123456789+]+$"))
            {
                MessageBox.Show("Telefon numarası için yalnızca sayı giriniz!");
                textBox3.Text = "";
                textBox3.Focus();
            }

            else if (!IsValidEmail(textBox4.Text))
            {

                    MessageBox.Show("Hatalı formatta mail adresi girdiniz!");
                    textBox4.Text = "";
                    textBox4.Focus();
            }
            else if (textBox6.TextLength < 11 || textBox6.TextLength > 11)
            {
            MessageBox.Show("Tc kimlik numarası hatalı!");
            textBox6.Text = "";
            textBox6.Focus();

            }
            else
            {
            SqlCommand com1 = new SqlCommand("profilUpdate", db.dbConnect());
            com1.CommandType = CommandType.StoredProcedure;
            com1.Parameters.Add("@id", SqlDbType.Int).Value = id;
            com1.Parameters.Add("@adi", SqlDbType.VarChar, 255).Value = adi;
            com1.Parameters.Add("@soyadi", SqlDbType.VarChar, 255).Value = soyadi;
            com1.Parameters.Add("@telefon", SqlDbType.VarChar, 255).Value = telefon;
            com1.Parameters.Add("@mail", SqlDbType.VarChar, 255).Value = mail;
            com1.Parameters.Add("@adres", SqlDbType.VarChar, 500).Value = adres;
            com1.Parameters.Add("@tcno", SqlDbType.VarChar, 11).Value = tcno;
            com1.Parameters.Add("@notlar", SqlDbType.VarChar, 500).Value = notlar;
            db.dbConnect();
            com1.ExecuteNonQuery();
            db.dbClose();
            MessageBox.Show("Profil Bilgileri Güncellendi");
            }
        }