예제 #1
0
        public bool AddPatientLoginDetail(PatientLoginDetail patientLoginDetail)
        {
            if (patientLoginDetail.UserName.Length > 20)
            {
                return(false);
            }

            return(patientLoginDetailManagement.AddPatientLoginDetail(patientLoginDetail));
        }
        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();
        }