public void UpdatePatientLoginDetail(PatientLoginDetail pld)
        {
            PatientLoginDetail updatedPatientLoginDetail = database.PatientLoginDetails.FirstOrDefault(x => x.LoginDetailId == pld.LoginDetailId);

            database.Entry(updatedPatientLoginDetail).CurrentValues.SetValues(updatedPatientLoginDetail);
            database.Entry(updatedPatientLoginDetail).State = EntityState.Modified;
        }
コード例 #2
0
        public bool AddPatientLoginDetail(PatientLoginDetail patientLoginDetail)
        {
            if (patientLoginDetail.UserName.Length > 20)
            {
                return(false);
            }

            return(patientLoginDetailManagement.AddPatientLoginDetail(patientLoginDetail));
        }
 public bool AddPatientLoginDetail(PatientLoginDetail pld)
 {
     try
     {
         database.PatientLoginDetails.Add(pld);
         database.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
        public PatientLoginDetail FindPatient(PatientLoginDetail patient)
        {
            var result = database.PatientLoginDetails.SingleOrDefault(p => p.UserName == patient.UserName && p.Password == patient.Password);

            return(result);

            //if (result == null)
            //{
            //    return false;
            //}
            //else
            //{

            //    return true;
            //}
        }
コード例 #5
0
        private void btnPatientMemberSave_Click(object sender, EventArgs e)
        {
            long   tc       = Convert.ToInt64(txtPatientPersonelIdentifyNumber.Text);
            string username = txtNewPatientEmail.Text.Trim();
            string password = txtNewPatientPassword.Text.Trim();

            Patient patient = new Patient
            {
                FirstName = txtPatientName.Text.Trim(),
                LastName  = txtPatientSurname.Text.Trim(),
                Phone     = txtPatientPhone.Text.Trim(),
                BirthDate = Convert.ToDateTime(dateTimePicker1.Value.ToShortDateString()),
                TCNumber  = tc,
                Gender    = Convert.ToBoolean(cmbGender.SelectedValue),
            };
            var result = patientController.AddPatient(patient);



            if (LoginDetailCheck(username, password) == false)
            {
                lblWarning.Text = "E-Mail/Şifreyi Düzgün Formatta Giriniz!";
            }
            else
            {
                var result2 = patientManagement.SearchPatient(tc);
                PatientLoginDetail patientLoginDetail = new PatientLoginDetail
                {
                    PatientId = result2,
                    UserName  = username,
                    Password  = password,
                    Status    = true
                };

                patientLoginDetailManagement.AddPatientLoginDetail(patientLoginDetail);
            }

            //Gb_PatientDetailClear();
        }
 public void RemovePatientLoginDetail(PatientLoginDetail pld)
 {
     if (pld.LoginDetailId <= 0)
     {
         MessageBox.Show("Kayıt Silebilmek İçin Bir Kayıt Seçilmelidir..");
     }
     else
     {
         var selectedPatientLoginDetail = database.PatientLoginDetails.FirstOrDefault(x => x.LoginDetailId == pld.LoginDetailId);
         if (selectedPatientLoginDetail == null)
         {
             MessageBox.Show("Silinebilecek bir kayıt bulunmadı...");
         }
         else
         {
             DialogResult dialogResult = MessageBox.Show($"{pld.LoginDetailId} Numaralı Kaydı Silmek İstediğinizden Emin Misiniz ?", "Hasta Giriş Detayı Silme İşlemi", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
             if (dialogResult == DialogResult.OK)
             {
                 database.PatientLoginDetails.Remove(selectedPatientLoginDetail);
                 database.SaveChanges();
             }
         }
     }
 }
コード例 #7
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            var passwordResult = Validator.isPasswordValid(txtPassword.Text);

            switch (rol)
            {
            case 1:

                var mailResult = Validator.isEmailValid(txtEmail.Text);

                if (mailResult == false && passwordResult == false)
                {
                    lblWarning.Text = "Lütfen Kullanıcı Bilgilerinizi Doğru Formatta Giriniz!";
                }    //Kullanıcı Adı ve Şifre Yanlışsa
                else
                {
                    PatientLoginDetailManagement patientLogin = new PatientLoginDetailManagement();
                    PatientLoginDetail           patient      = new PatientLoginDetail

                    {
                        UserName = txtEmail.Text.Trim(),
                        Password = txtPassword.Text.Trim()
                    };

                    var patientResult = patientLogin.FindPatient(patient);
                    if (patientResult == null)
                    {
                        lblWarning.Text = "Lütfen Kullanıcı Bilgilerini Kontrol Ediniz!";
                    }
                    else
                    {
                        AppointmentSystem appointmentSystem = new AppointmentSystem();
                        appointmentSystem.UserID = patientResult.PatientId;
                        appointmentSystem.Show();
                    }
                }    //Kullanıcı Adı ve Şifre Doğruysa
                break;


            case 2:
                var drusernameResult = Validator.isDoctorUserNameValid(txtEmail.Text);

                if (drusernameResult == false && passwordResult == false)
                {
                    lblWarning.Text = "Lütfen Kullanıcı Bilgilerinizi Doğru Formatta Giriniz!";
                }
                else
                {
                    DoctorLoginDetailManagement doctorLogin = new DoctorLoginDetailManagement();
                    DoctorLoginDetail           doctor      = new DoctorLoginDetail
                    {
                        UserName = txtEmail.Text.Trim(),
                        Password = txtPassword.Text.Trim()
                    };
                    if (doctorLogin.FindDoctor(doctor) == null)
                    {
                        lblWarning.Text = "Lütfen Kullanıcı Bilgilerini Kontrol Ediniz!";
                    }
                    else
                    {
                        DoctorSystemScreen doctorSystemScreen = new DoctorSystemScreen();
                        doctorSystemScreen.doctorId = doctorLogin.FindDoctor(doctor).DoctorId;
                        doctorSystemScreen.Show();
                    }
                }
                break;


            case 3:
                var phusernameResult = Validator.isPharmacistUserNameValid(txtEmail.Text);

                PharmacistLoginDetailManagement pharmacistLogin = new PharmacistLoginDetailManagement();
                PharmacistLoginDetail           pharmacist      = new PharmacistLoginDetail
                {
                    UserName = txtEmail.Text.Trim(),
                    Password = txtPassword.Text.Trim()
                };

                if (phusernameResult == false && passwordResult == false)
                {
                    lblWarning.Text = "Lütfen Kullanıcı Bilgilerinizi Doğru Formatta Giriniz!";
                }
                else
                {
                    var pharmacistResult = pharmacistLogin.FindPharmacist(pharmacist);
                    if (pharmacist == null)

                    {
                        lblWarning.Text = "Lütfen Kullanıcı Bilgilerini Kontrol Ediniz!";
                    }
                    else
                    {
                        PharmacistSystemScreen pharmacistSystemScreen = new PharmacistSystemScreen();
                        pharmacistSystemScreen.getPharmacistId = pharmacistResult.PharmacistId;
                        pharmacistSystemScreen.Show();
                    }
                }

                break;
            }
        }