예제 #1
0
        public kullanicilar getir()
        {
            OnlineSatrancEntities db        = new OnlineSatrancEntities();
            kullanicilar          kullanici = db.kullanicilar.Where(s => s.kAdi == Properties.Settings.Default.kAdi).FirstOrDefault();

            return(kullanici);
        }
예제 #2
0
파일: mesaj.cs 프로젝트: ByStronq/Caissa
        private void cevrimiciDurum_Tick(object sender, EventArgs e)
        {
            bool cevrimiciDurum = new OnlineSatrancEntities().kullanicilar.Where(s => s.ID == arkadasim.ID).FirstOrDefault().durum;

            if (cevrimiciDurum && !Text.Contains("Çevrimiçi"))
            {
                Text = Text.Replace("dışı", "içi"); foreach (Control mesaj in mesajlarPanel.Controls)
                {
                    if (mesaj.Text.Contains(arkadasim.kAdi))
                    {
                        mesaj.ForeColor = Color.Green;
                    }
                }
            }
            else if (!cevrimiciDurum && !Text.Contains("Çevrimdışı"))
            {
                Text = Text.Replace("içi", "dışı"); foreach (Control mesaj in mesajlarPanel.Controls)
                {
                    if (mesaj.Text.Contains(arkadasim.kAdi))
                    {
                        mesaj.ForeColor = Color.LightGray;
                    }
                }
            }
        }
예제 #3
0
        public kullanicilar getDb()
        {
            var user = HttpContext.Current.User.Identity;

            if (user.IsAuthenticated)
            {
                Int32.TryParse(user.Name, out userID);
            }

            OnlineSatrancEntities db = new OnlineSatrancEntities();
            var kullanici            = db.kullanicilar.Where(s => s.ID == userID).FirstOrDefault();

            return(kullanici);
        }
예제 #4
0
        private void girisBtn_Click(object sender, EventArgs e)
        {
            frm1 = Application.OpenForms.OfType <Form1>().SingleOrDefault();
            UTF8Encoding              utf8 = new UTF8Encoding();
            MD5CryptoServiceProvider  md5  = new MD5CryptoServiceProvider();
            SHA1CryptoServiceProvider sha1 = new SHA1CryptoServiceProvider();
            string md5SHA1_PW        = BitConverter.ToString(md5.ComputeHash(utf8.GetBytes(BitConverter.ToString(sha1.ComputeHash(utf8.GetBytes(sifre.Text))))));
            OnlineSatrancEntities db = new OnlineSatrancEntities();

            if (db.kullanicilar.FirstOrDefault(x => (x.kAdi == kAdi.Text || x.ePosta == kAdi.Text || x.gsm == kAdi.Text) && x.sifre == md5SHA1_PW) != null)
            {
                Save_Data();
                frm1.openChildForm(new Home());

                /************** BUTONLARIN AKTİF HALE GETİRİLMESİ **************/

                frm1.klasik.Enabled         = true;
                frm1.dortluSatranc.Enabled  = true;
                frm1.takimliSatranc.Enabled = true;
                frm1.soloMacKur.Enabled     = true;
                frm1.dortluMacKur.Enabled   = true;
                frm1.kolay.Enabled          = true;
                frm1.orta.Enabled           = true;
                frm1.zor.Enabled            = true;

                if (Properties.Settings.Default.kAdi.ToLower() == "bystrong")
                {
                    frm1.test.Visible = true;
                }

                /************** BUTONLARIN AKTİF HALE GETİRİLMESİ **************/
            }
            else
            {
                MessageBox.Show("Giriş Başarısız. (Yanlış Kullanıcı Adı veya Şifre)", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                kAdi.Text            = null;
                sifre.Text           = null;
                kAdiHatirla.Checked  = false;
                sifreHatirla.Checked = false;

                Properties.Settings.Default.kAdi = null;
                Properties.Settings.Default.Save();
            }
        }
예제 #5
0
        private void davetEt(object sender, EventArgs e)
        {
            if (Controls.Find("adSoyad" + ((Control)sender).Name[12], true).OfType <Label>().First().Text == "Rakip Bekleniyor...") // Tıklanan yerde oyuncu yoksa;
            {
                kullanicilar          bilgilerim = new Models.bilgilerim().getir();
                OnlineSatrancEntities db         = new OnlineSatrancEntities();

                Form form = new Form();

                foreach (arkadasliklar arkadaslik in db.arkadasliklar.Where(s => (s.gonderenID == bilgilerim.ID || s.alıcıID == bilgilerim.ID) && s.arkadaslikDurumu).ToList())
                {
                    kullanicilar arkadas    = arkadaslik.kullanicilar1.ID == bilgilerim.ID ? arkadaslik.kullanicilar : arkadaslik.kullanicilar1;
                    Button       davetEtBTN = new Button()
                    {
                        Text = arkadas.kAdi + " Davet Et"
                    }; davetEtBTN.Tag = arkadas.ID; davetEtBTN.Click += davetEt_Click;
                    form.Controls.Add(davetEtBTN);
                }

                void davetEt_Click(object sender2, EventArgs e2)
                {
                    db.mesajlar.Add(new mesajlar {
                        gonderenID = bilgilerim.ID, aliciID = Convert.ToInt32(((Button)sender2).Tag.ToString()), mesaj = "Oda No: (" + odaNo + ") Sıra No: [" + ((PictureBox)sender).Tag + "] - Klasik Satranç", tarih = DateTime.Now
                    });
                    if (db.SaveChanges() > 0)
                    {
                        MessageBox.Show("Davet gönderildi!");
                    }
                    else
                    {
                        MessageBox.Show("Davet gönderilemedi!");
                    }
                }

                form.Show();
            }
            else // Tıklanan yerde oyuncu varsa;
            {
                MessageBox.Show("Zaten biri oynuyor bu yüzden birini davet edemezsin!");
            }
        }
예제 #6
0
        private void klasikSatranc_Load(object sender, EventArgs e)
        {
            odaNoLabel.Text += odaNo;
            satrancTahtalari odaBilgisi = new SatrancTahtasiController().getir(1, forceSiraNo);

            string odaSahibiAdSoyad = odaBilgisi.kullanicilar.Ad + " " + odaBilgisi.kullanicilar.Soyad, rakipAdSoyad = odaBilgisi.kullanicilar1 != null ? odaBilgisi.kullanicilar1.Ad + " " + odaBilgisi.kullanicilar1.Soyad : null, odaSahibiRutbeAd = "", rakipRutbeAd = "";
            bool   odaSahibiCins = odaBilgisi.kullanicilar.cinsiyet, rakipCins = odaBilgisi.kullanicilar1 != null ? odaBilgisi.kullanicilar1.cinsiyet : false;
            Image  odaSahibiPP = odaSahibiCins ? Properties.Resources.img_avatar1 : Properties.Resources.img_avatar2, rakipPP = rakipCins ? Properties.Resources.img_avatar1 : odaBilgisi.kullanicilar1 != null ? Properties.Resources.img_avatar2 : Properties.Resources.img_avatar3, odaSahibiRutbeTas = null, rakipRutbeTas = null;
            int    odaSahibiELO = odaBilgisi.kullanicilar.ELO, rakipELO = odaBilgisi.kullanicilar1 != null ? odaBilgisi.kullanicilar1.ELO : 0;

            if (odaSahibiELO > 0 && odaSahibiELO < 500)
            {
                odaSahibiRutbeTas = Properties.Resources.cm; odaSahibiRutbeAd = (odaSahibiCins ? "" : "W") + "CM (" + (odaSahibiCins ? "" : "Woman ") + "Candidate Master - " + (odaSahibiCins ? "" : "Kadın ") + "Usta Adayı)";
            }
            else if (odaSahibiELO >= 500 && odaSahibiELO < 1000)
            {
                odaSahibiRutbeTas = Properties.Resources.fm; odaSahibiRutbeAd = (odaSahibiCins ? "" : "W") + "FM (" + (odaSahibiCins ? "" : "Woman ") + "FIDE Master - " + (odaSahibiCins ? "" : "Kadın ") + "FIDE Ustası)";
            }
            else if (odaSahibiELO >= 1000 && odaSahibiELO < 1500)
            {
                odaSahibiRutbeTas = Properties.Resources.im; odaSahibiRutbeAd = (odaSahibiCins ? "" : "W") + "IM (" + (odaSahibiCins ? "" : "Woman ") + "International Master - " + (odaSahibiCins ? "" : "Kadın ") + "Uluslararası Usta)";
            }
            else if (odaSahibiELO >= 1500)
            {
                odaSahibiRutbeTas = Properties.Resources.gm;  odaSahibiRutbeAd = (odaSahibiCins ? "" : "W") + "GM (" + (odaSahibiCins ? "" : "Woman ") + "Grand Master - " + (odaSahibiCins ? "" : "Kadın ") + "Büyük Usta)";
            }
            else
            {
                odaSahibiRutbeTas = null; odaSahibiRutbeAd = "UNRANKED!";
            }

            if (rakipELO > 0 && rakipELO < 500)
            {
                rakipRutbeTas = Properties.Resources.cm; rakipRutbeAd = (rakipCins ? "" : "W") + "CM (" + (rakipCins ? "" : "Woman ") + "Candidate Master - " + (rakipCins ? "" : "Kadın ") + "Usta Adayı)";
            }
            else if (rakipELO >= 500 && rakipELO < 1000)
            {
                rakipRutbeTas = Properties.Resources.fm; rakipRutbeAd = (rakipCins ? "" : "W") + "FM (" + (rakipCins ? "" : "Woman ") + "FIDE Master - " + (rakipCins ? "" : "Kadın ") + "FIDE Ustası)";
            }
            else if (rakipELO >= 1000 && rakipELO < 1500)
            {
                rakipRutbeTas = Properties.Resources.im; rakipRutbeAd = (rakipCins ? "" : "W") + "IM (" + (rakipCins ? "" : "Woman ") + "International Master - " + (rakipCins ? "" : "Kadın ") + "Uluslararası Usta)";
            }
            else if (rakipELO >= 1500)
            {
                rakipRutbeTas = Properties.Resources.gm; rakipRutbeAd = (rakipCins ? "" : "W") + "GM (" + (rakipCins ? "" : "Woman ") + "Grand Master - " + (rakipCins ? "" : "Kadın ") + "Büyük Usta)";
            }
            else
            {
                rakipRutbeTas = null; rakipRutbeAd = "UNRANKED!";
            }

            int     yer      = 0;
            ToolTip Aciklama = new ToolTip();

            profilePhoto1.Click += davetEt; profilePhoto2.Click += davetEt;

            if (new OnlineSatrancEntities().satrancTahtalari.Where(s => s.ID == odaNo).FirstOrDefault().rakip == new Models.bilgilerim().getir().ID)
            {
                adSoyad1.Text = rakipAdSoyad;
                adSoyad2.Text = odaSahibiAdSoyad;

                profilePhoto1.Image = rakipPP;
                profilePhoto2.Image = odaSahibiPP;
                profilePhoto1.Tag   = "2";
                profilePhoto2.Tag   = "1";

                odaStatus1.Text = "Konuk";
                odaStatus2.Text = "Oda Sahibi";

                rutbeTas1.Image = rakipRutbeTas;
                rutbeTas2.Image = odaSahibiRutbeTas;

                rutbeAd1.Text = rakipRutbeAd;
                rutbeAd2.Text = odaSahibiRutbeAd;

                elo1.Text = "ELO: " + rakipELO;
                elo2.Text = "ELO: " + odaSahibiELO;

                Aciklama.SetToolTip(rutbeAd1, rakipRutbeAd);
                Aciklama.SetToolTip(rutbeAd2, odaSahibiRutbeAd);

                yer = 1;
                for (int i = 1; i <= 8; i++)
                {
                    for (char j = 'h'; j >= 'a'; j--)
                    {
                        Button btn = new Button();
                        btn.Name      = j + "" + i;
                        btn.Size      = new Size(60, 60);
                        btn.Margin    = Padding.Empty;
                        btn.FlatStyle = FlatStyle.Flat;
                        btn.Click    += notasyonOlustur;
                        if (i % 2 == 0)
                        {
                            if (yer == 1)
                            {
                                btn.BackColor = Color.Black;
                                yer           = 0;
                            }
                            else
                            {
                                yer++;
                                btn.BackColor = Color.White;
                            }

                            if (i == 2)
                            {
                                btn.BackgroundImage = Properties.Resources.beyazPiyon; btn.Tag = "beyazPiyon";
                            }
                            else if (i == 8)
                            {
                                if (j == 'a' || j == 'h')
                                {
                                    btn.BackgroundImage = Properties.Resources.kale; btn.Tag = "kale";
                                }
                                else if (j == 'b' || j == 'g')
                                {
                                    btn.BackgroundImage = Properties.Resources.at; btn.Tag = "at";
                                }
                                else if (j == 'c' || j == 'f')
                                {
                                    btn.BackgroundImage = Properties.Resources.fil; btn.Tag = "fil";
                                }
                                else if (j == 'd')
                                {
                                    btn.BackgroundImage = Properties.Resources.vezir; btn.Tag = "vezir";
                                }
                                else if (j == 'e')
                                {
                                    btn.BackgroundImage = Properties.Resources.sah; btn.Tag = "sah";
                                }
                            }
                        }
                        else
                        {
                            if (yer == 0)
                            {
                                btn.BackColor = Color.Black;
                                yer++;
                            }
                            else
                            {
                                yer           = 0;
                                btn.BackColor = Color.White;
                            }

                            if (i == 7)
                            {
                                btn.BackgroundImage = Properties.Resources.piyon; btn.Tag = "piyon";
                            }
                            else if (i == 1)
                            {
                                if (j == 'a' || j == 'h')
                                {
                                    btn.BackgroundImage = Properties.Resources.beyazKale; btn.Tag = "beyazKale";
                                }
                                else if (j == 'b' || j == 'g')
                                {
                                    btn.BackgroundImage = Properties.Resources.beyazAt; btn.Tag = "beyazAt";
                                }
                                else if (j == 'c' || j == 'f')
                                {
                                    btn.BackgroundImage = Properties.Resources.beyazFil; btn.Tag = "beyazFil";
                                }
                                else if (j == 'd')
                                {
                                    btn.BackgroundImage = Properties.Resources.beyazVezir; btn.Tag = "beyazVezir";
                                }
                                else if (j == 'e')
                                {
                                    btn.BackgroundImage = Properties.Resources.beyazSah; btn.Tag = "beyazSah";
                                }
                            }
                        }
                        btn.BackgroundImageLayout = ImageLayout.Stretch;
                        satrancTahtasiContainer.Controls.Add(btn);
                    }
                }
            }
            else
            {
                adSoyad1.Text = odaSahibiAdSoyad;
                adSoyad2.Text = rakipAdSoyad;

                profilePhoto1.Image = odaSahibiPP;
                profilePhoto2.Image = rakipPP;
                profilePhoto1.Tag   = "1";
                profilePhoto2.Tag   = "2";

                odaStatus1.Text = "Oda Sahibi";
                odaStatus2.Text = "Konuk";

                rutbeTas1.Image = odaSahibiRutbeTas;
                rutbeTas2.Image = rakipRutbeTas;

                rutbeAd1.Text = odaSahibiRutbeAd;
                rutbeAd2.Text = rakipRutbeAd;

                elo1.Text = "ELO: " + odaSahibiELO;
                elo2.Text = "ELO: " + rakipELO;

                Aciklama.SetToolTip(rutbeAd1, odaSahibiRutbeAd);
                Aciklama.SetToolTip(rutbeAd2, rakipRutbeAd);

                for (int i = 8; i >= 1; i--)
                {
                    for (char j = 'a'; j <= 'h'; j++)
                    {
                        Button btn = new Button();
                        btn.Name      = j + "" + i;
                        btn.Size      = new Size(60, 60);
                        btn.Margin    = Padding.Empty;
                        btn.FlatStyle = FlatStyle.Flat;
                        btn.Click    += notasyonOlustur;
                        if (i % 2 == 0)
                        {
                            if (yer == 1)
                            {
                                btn.BackColor = Color.Black;
                                yer           = 0;
                            }
                            else
                            {
                                yer++;
                                btn.BackColor = Color.White;
                            }

                            if (i == 2)
                            {
                                btn.BackgroundImage = Properties.Resources.beyazPiyon; btn.Tag = "beyazPiyon";
                            }
                            else if (i == 8)
                            {
                                if (j == 'a' || j == 'h')
                                {
                                    btn.BackgroundImage = Properties.Resources.kale; btn.Tag = "kale";
                                }
                                else if (j == 'b' || j == 'g')
                                {
                                    btn.BackgroundImage = Properties.Resources.at; btn.Tag = "at";
                                }
                                else if (j == 'c' || j == 'f')
                                {
                                    btn.BackgroundImage = Properties.Resources.fil; btn.Tag = "fil";
                                }
                                else if (j == 'd')
                                {
                                    btn.BackgroundImage = Properties.Resources.vezir; btn.Tag = "vezir";
                                }
                                else if (j == 'e')
                                {
                                    btn.BackgroundImage = Properties.Resources.sah; btn.Tag = "sah";
                                }
                            }
                        }
                        else
                        {
                            if (yer == 0)
                            {
                                btn.BackColor = Color.Black;
                                yer++;
                            }
                            else
                            {
                                yer           = 0;
                                btn.BackColor = Color.White;
                            }

                            if (i == 7)
                            {
                                btn.BackgroundImage = Properties.Resources.piyon; btn.Tag = "piyon";
                            }
                            else if (i == 1)
                            {
                                if (j == 'a' || j == 'h')
                                {
                                    btn.BackgroundImage = Properties.Resources.beyazKale; btn.Tag = "beyazKale";
                                }
                                else if (j == 'b' || j == 'g')
                                {
                                    btn.BackgroundImage = Properties.Resources.beyazAt; btn.Tag = "beyazAt";
                                }
                                else if (j == 'c' || j == 'f')
                                {
                                    btn.BackgroundImage = Properties.Resources.beyazFil; btn.Tag = "beyazFil";
                                }
                                else if (j == 'd')
                                {
                                    btn.BackgroundImage = Properties.Resources.beyazVezir; btn.Tag = "beyazVezir";
                                }
                                else if (j == 'e')
                                {
                                    btn.BackgroundImage = Properties.Resources.beyazSah; btn.Tag = "beyazSah";
                                }
                            }
                        }
                        btn.BackgroundImageLayout = ImageLayout.Stretch;
                        satrancTahtasiContainer.Controls.Add(btn);
                    }
                }
            }

            List <hamleler> hamleler = new OnlineSatrancEntities().hamleler.Where(s => s.odaNo == odaNo).ToList();

            foreach (hamleler hamle in hamleler)
            {
                Control eskiTas = satrancTahtasiContainer.Controls.Find(hamle.pozisyon, true)[0];
                Control yeniTas;

                char[] notasyonParca = hamle.notasyon.ToCharArray();

                // NOTASYON KONTROL BAŞLANGICI = TAŞIN ESKİ HÜCRESİ => TAŞIN YENİ HÜCRESİ //
                if (notasyonParca[0] == 'Ş' || notasyonParca[0] == 'V' || notasyonParca[0] == 'F' || notasyonParca[0] == 'A' || notasyonParca[0] == 'K')             // Şah, Vezir, Fil, At veya Kale;
                {
                    if (notasyonParca[1] == 'x' || notasyonParca[1] == '+')
                    {
                        yeniTas = satrancTahtasiContainer.Controls.Find((notasyonParca[2] + "" + notasyonParca[3]), true)[0];               // Bir taşı yiyor veya şah çekiyorsa yeniPozisyonu
                        //if (notasyonParca[1] == '+') sahCek = true;
                    }
                    else
                    {
                        yeniTas = satrancTahtasiContainer.Controls.Find((notasyonParca[1] + "" + notasyonParca[2]), true)[0];                    // Yer değiştiriyorsa yeniPozisyonu
                    }
                }
                else                    // Taş piyon ise;
                if (notasyonParca.Count() >= 3 && (notasyonParca[2] == 'x' || notasyonParca[2] == '+'))
                {
                    yeniTas = satrancTahtasiContainer.Controls.Find((notasyonParca[3] + "" + notasyonParca[4]), true)[0];                       // Bir taşı yiyor veya şah çekiyorsa yeniPozisyonu
                    //if (notasyonParca[2] == '+') sahCek = true;
                }
                else
                {
                    yeniTas = satrancTahtasiContainer.Controls.Find((notasyonParca[0] + "" + notasyonParca[1]), true)[0]; // Yer değiştiriyorsa yeniPozisyonu
                    //if (notasyonParca.Count() >= 3 && (notasyonParca[2] == 'V' || notasyonParca[2] == 'K')) tasCik = notasyonParca[2];
                }                                                                                                         // Piyon Vezir veya Kale taşı çıkıyorsa
                // NOTASYON KONTROL BİTİŞİ = TAŞIN ESKİ HÜCRESİ => TAŞIN YENİ HÜCRESİ //


                yeniTas.BackgroundImage = (Image)Properties.Resources.ResourceManager.GetObject(eskiTas.Tag.ToString());
                yeniTas.Tag             = eskiTas.Tag;

                eskiTas.BackgroundImage = null;
                eskiTas.Tag             = null;
            }
        }
예제 #7
0
파일: KayitOl.cs 프로젝트: ByStronq/Caissa
        private void kayitBtn_Click(object sender, EventArgs e)
        {
            frm1 = Application.OpenForms.OfType <Form1>().SingleOrDefault();
            string pwPattern         = @"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$";
            string eMailPattern      = "^([0-9a-zA-Z]([-\\.\\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})$";
            string telNoPattern      = @"^[0][1-9]\d{9}$|^[1-9]\d{9}$";
            OnlineSatrancEntities db = new OnlineSatrancEntities();

            if (String.IsNullOrEmpty(ad.Text) ||
                String.IsNullOrEmpty(soyad.Text) ||
                String.IsNullOrEmpty(kAdi.Text) ||
                String.IsNullOrEmpty(sifre.Text) ||
                String.IsNullOrEmpty(ePosta.Text) ||
                String.IsNullOrEmpty(gsm.Text))
            {
                MessageBox.Show("Boş alan bırakmayınız!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (!Regex.IsMatch(sifre.Text, pwPattern))
            {
                MessageBox.Show("Şifreniz şunları içermelidir:" + "\n" +
                                "- En az sekiz karakter" + "\n" +
                                "- En az bir büyük harf (A-Z)" + "\n" +
                                "- Bir küçük harf (a-z)" + "\n" +
                                "- Bir sayı (0-9)" + "\n" +
                                "- Bir özel karakter (@$!%*?&)", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (!Regex.IsMatch(ePosta.Text, eMailPattern))
            {
                MessageBox.Show("Geçerli bir e-Posta adresi giriniz!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (!Regex.IsMatch(gsm.Text, telNoPattern))
            {
                MessageBox.Show("Geçerli bir telefon numarası giriniz!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (!erkek.Checked && !kadin.Checked)
            {
                MessageBox.Show("Cinsiyet seçiniz!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (db.kullanicilar.Where(s => s.kAdi == kAdi.Text).Count() > 0)
            {
                MessageBox.Show("Bu kullanıcı adı daha önce alınmış!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (db.kullanicilar.Where(s => s.ePosta == ePosta.Text).Count() > 0)
            {
                MessageBox.Show("Bu e-posta adresi kullanımda!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (db.kullanicilar.Where(s => s.gsm == gsm.Text).Count() > 0)
            {
                MessageBox.Show("Bu telefon numarası kullanımda!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                kullanicilar kullanicilar = new kullanicilar();

                kullanicilar.Ad     = ad.Text;
                kullanicilar.Soyad  = soyad.Text;
                kullanicilar.kAdi   = kAdi.Text;
                kullanicilar.ePosta = ePosta.Text;

                UTF8Encoding              utf8 = new UTF8Encoding();
                MD5CryptoServiceProvider  md5  = new MD5CryptoServiceProvider();
                SHA1CryptoServiceProvider sha1 = new SHA1CryptoServiceProvider();
                kullanicilar.sifre     = BitConverter.ToString(md5.ComputeHash(utf8.GetBytes(BitConverter.ToString(sha1.ComputeHash(utf8.GetBytes(sifre.Text))))));
                kullanicilar.gsm       = gsm.Text;
                kullanicilar.dgmTarihi = dgmTarihi.Value;

                if (erkek.Checked)
                {
                    kullanicilar.cinsiyet = true;
                }
                else if (kadin.Checked)
                {
                    kullanicilar.cinsiyet = false;
                }

                db.kullanicilar.Add(kullanicilar);
                db.SaveChanges(); MessageBox.Show("Kayıt Başarılı!");
                Properties.Settings.Default.kAdi  = null;
                Properties.Settings.Default.sifre = null;
                Properties.Settings.Default.Save();
                this.Close();
                frm1.openChildForm(new GirisYap());
            }
        }