Beispiel #1
0
        public bool Add(UyeGiris uye)
        {
            UyeOlKontrol(uye.Email, uye.Parola);
            int result = uyeGirisDAL.HastaAdd(uye);

            return(result > 0);
        }
        public bool HastaUyeTabloEkle(UyeGiris uye)
        {
            GirisKontrol(uye.Email, uye.Parola, uye.RolID);
            int result = uyeGirisDAL.HastaAdd(uye);

            return(result > 0);
        }
 public int HastaAdd(UyeGiris uye)
 {
     cmd = new SqlCommand("insert into UyeGirisi values (@Mail,@Parola,@Rolid)", cnn);
     cmd.Parameters.AddWithValue("@Mail", uye.Email);
     cmd.Parameters.AddWithValue("@Parola", uye.Parola);
     cmd.Parameters.AddWithValue("@Rolid", uye.RolID);
     return(ExecuteCommand());
 }
Beispiel #4
0
        //Giriş yap butonu;
        private void BtnSignUp_Click(object sender, EventArgs e)
        {
            try
            {
                hasta      = new HastaBilgileri();
                uye        = new UyeGiris();
                uye.Email  = txtMail.Text;
                uye.Parola = txtPswrd.Text;
                uye.RolID  = 1;
                try
                {
                    hasta.Tc_No = txtTC.Text;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

                hasta.Ad      = txtName.Text;
                hasta.Soyad   = txtSurname.Text;
                hasta.Email   = txtMail.Text;
                hasta.Parola  = txtPswrd.Text;
                hasta.Telefon = txtPhone.Text;

                if (rbMale.Checked)
                {
                    hasta.Cinsiyet = false;
                }
                else
                {
                    hasta.Cinsiyet = true;
                }
                uyeGirisBLL.Add(uye);
                hastaBilgileriBLL.HastaEkle(hasta);

                DialogResult result = MessageBox.Show("Kayıt başarılı, çıkmak için OK'a basın.", "Kayıt Oluşturuldu", MessageBoxButtons.OK);
                if (result == DialogResult.OK)
                {
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #5
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            uyeGiris        = new UyeGiris();
            uyeGiris.Email  = txtUsername.Text;
            uyeGiris.Parola = txtPassword.Text;
            uyeGiris.RolID  = comboBox1.SelectedIndex + 1;

            try
            {
                hastaBilgileriBLL.GirisKontrol(uyeGiris.Email, uyeGiris.Parola, uyeGiris.RolID);

                //LoginControl
                if (uyeGiris.RolID == 1) // Hasta ise
                {
                    //Burada email ve sifreye göre hasta ID'sini alacağız bu yüzden hastabilgilerinden instance alıyoruz.
                    hastaBilgileri = new HastaBilgileri();

                    //Globalde int HastaId diye değişken tanımlamıştık BLL'den çıkan sonucu ona atıyoruz.
                    hastaBilgileri = hastaBilgileriBLL.HastaIdGetir(uyeGiris.Email, uyeGiris.Parola);
                    HastaID        = hastaBilgileri.HastaID;

                    //Hasta eposta ve parola doğruysa Randevu Alma formuna geçiş yapılıyor, bu işlem için öncelikle instance alıyoruz.
                    RandevuAlma randevu = new RandevuAlma();

                    //RandevuAlmada public bir metod tanımladık(HastaIDGetir) hastaID'yi alıp formda kullanacağız.
                    randevu.HastaIDGetir(HastaID);
                    randevu.ShowDialog();
                }
                else if (uyeGiris.RolID == 2) //Doktor ise
                {
                    //Deneme  MessageBox.Show("Doktor");
                    DoktorPaneli frmDoktorPaneli = new DoktorPaneli();
                    frmDoktorPaneli.ShowDialog();
                }
                else if (uyeGiris.RolID == 3)//Eczane ise
                {
                    //Deneme  MessageBox.Show("Ezcane");
                    EczanePaneli frmEczanePaneli = new EczanePaneli();
                    frmEczanePaneli.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        public ActionResult UyeGiris(UyeGiris model)
        {
            if (ModelState.IsValid)
            {
                var sifre = Helper.CreateMd5(model.Sifre);
                var uye   = _uyelerService.Get(x => x.Email == model.Email && x.Sifre == sifre).Entity;
                if (uye == null)
                {
                    model.Mesaj = "Giriş bilgileri hatalı";
                    return(View(model));
                }

                var uyeBilgileri        = AutoMapper.Mapper.Map <UyeOl>(uye);
                JavaScriptSerializer js = new JavaScriptSerializer();
                Session.Add("Uye", js.Serialize(uyeBilgileri));
                return(RedirectToAction("Index", "Home"));
            }
            return(View(model));
        }
        public IActionResult Index(string Adi, string Soyadi, string email, string username, string Parola,
                                   string ParolaTekrar, bool CinsiyetKız, bool CinsiyetErkek, DateTime DogumTarihi, decimal Kilo,
                                   decimal Boy, string submitButton)
        {
            Uye      u  = new Uye();
            UyeGiris ug = new UyeGiris();

            u.Adi    = Adi;
            u.Soyadi = Soyadi;
            u.Kilo   = Kilo;
            u.Boy    = Boy;
            //radio buttondan değer almaya bak...
            if (CinsiyetErkek == true)
            {
                u.Cinsiyet = false;//çünkü yaşasın feminizimmmm :P:P:P
            }
            else
            {
                u.Cinsiyet = true;
            }
            u.DogumTarihi = DogumTarihi;
            u.Tarih       = DateTime.Now.ToShortDateString();
            db.Uye.Add(u);
            db.SaveChanges();
            ug.UyeId        = u.Id;
            ug.KullaniciAdi = username;
            ug.Sifre        = Parola;
            ug.IsActive     = true;
            db.UyeGiris.Add(ug);
            db.SaveChanges();
            if (submitButton == "Kayit")
            {
                return(RedirectToAction("Index", "Home"));//üyenin girişi kabul edilerek ana sayfaya gitsin artık yorum yapabilir..
            }
            else
            {
                return(RedirectToAction("Danisman", "SignIn"));//Danısman sayfasında üye işlemleri devam edicekkk
            }
        }