public UIDischarged(hasta pt, string tutar, int processId)
 {
     InitializeComponent();
     this.selectedPatient = pt;
     txtToplamTutar.Text  = tutar;
     this.processId       = processId;
 }
示例#2
0
        private void btnGuncelle_Click(object sender, EventArgs e)
        {
            if (kontrol() != "")
            {
                MessageBox.Show(kontrol());
                return;
            }
            hasta hasta = new hasta
            {
                tckimlikno  = txtTC.Text,
                dosyano     = int.Parse(txtDosyaNo.Text),
                ad          = txtAd.Text,
                soyad       = txtSoyad.Text,
                dogumyeri   = txtDogumYeri.Text,
                dogumtarihi = Convert.ToDateTime(dogumTarihi.Value),
                babaadi     = txtBabaAdi.Text,
                anneadi     = txtAnneAdi.Text,
                cinsiyet    = cinsiyet.Text,
                kangrubu    = kanGrubu.Text,
                medenihal   = medeniHal.Text,
                adres       = txtAdres.Text,

                tel               = txtTelefonNo.Text,
                kurumsicilno      = txtKurumSicilNo.Text,
                kurumadi          = txtKurumSicilAdi.Text,
                yakintel          = txtYakinTelefonNo.Text,
                yakinkurumsicilno = txtYakinKurumSicilNo.Text,
                yakinkurumadi     = txtYakinKurumAdi.Text
            };

            databaseControl.UpdateHasta(hasta);
            txtIslemGuncelleme.Text = "< İŞLEM TAMAMLANDI >";
        }
        protected void btnyatisyap_Click(object sender, EventArgs e)
        {
            MongoClient client     = new MongoClient();
            var         database   = client.GetDatabase("hastane");
            var         collection = database.GetCollection <yatanhastalar>("yatanhastalar");
            var         doktorlist = database.GetCollection <doktortek>("doktorlistesi").Find(x => x._id == ObjectId.Parse(ddlDoktor.SelectedValue)).ToList();
            var         dr         = collection.Find(x => x._id == ObjectId.Parse(ddlDoktor.SelectedValue)).ToList();

            if (doktorlist.Count != dr.Count)
            {
                foreach (var doktor in doktorlist)
                {
                    yatanhastalar cat = new yatanhastalar();
                    cat._id           = doktor._id;
                    cat.doktor_adi    = doktor.doktor_adi;
                    cat.doktor_soyadi = doktor.doktor_soyadi;
                    cat.doktor_bölüm  = doktor.doktor_bölüm;
                    collection.InsertOne(cat);
                }
            }
            var srv        = collection.Find(x => x._id == ObjectId.Parse(ddlDoktor.SelectedValue)).ToList().SelectMany(x => x.ServisList).Where(x => x._id == ObjectId.Parse(ddlServis.SelectedValue)).ToList();
            var servislist = database.GetCollection <servistek>("servislistesi").Find(x => x._id == ObjectId.Parse(ddlServis.SelectedValue)).ToList();

            if (srv.Count != servislist.Count)
            {
                foreach (var item in servislist)
                {
                    servis cat = new servis();
                    cat._id        = item._id;
                    cat.servis_adi = item.servis_adi;
                    List <servis> servisliste = collection.Find(x => x._id == ObjectId.Parse(ddlDoktor.SelectedValue)).FirstOrDefault()?.ServisList ?? new List <servis>();
                    servisliste.Add(cat);
                    collection.UpdateOne(Builders <yatanhastalar> .Filter.Eq(x => x._id, ObjectId.Parse(ddlDoktor.SelectedValue)),
                                         Builders <yatanhastalar> .Update.Set(b => b.ServisList, servisliste));
                }
            }
            var hst          = collection.Find(x => x._id != null).ToList().SelectMany(x => x.ServisList).ToList().SelectMany(x => x.HastaList).Where(x => x._id == ObjectId.Parse(ddlHasta.SelectedValue)).ToList();
            var hastalistesi = database.GetCollection <hastatek>("hastalistesi").Find(x => x._id == ObjectId.Parse(ddlHasta.SelectedValue)).ToList();

            if (hst.Count != hastalistesi.Count)
            {
                foreach (var item in hastalistesi)
                {
                    hasta cat = new hasta();
                    cat._id            = item._id;
                    cat.hasta_adi      = item.hasta_adi;
                    cat.hasta_soyadi   = item.hasta_soyadi;
                    cat.hasta_anneadi  = item.hasta_anneadi;
                    cat.hasta_babaadi  = item.hasta_babaadi;
                    cat.hasta_telefon  = item.hasta_telefon;
                    cat.hasta_adres    = item.hasta_adres;
                    cat.hasta_cinsiyet = item.hasta_cinsiyet;
                    var          servisliste = collection.Find(x => x._id == ObjectId.Parse(ddlDoktor.SelectedValue)).FirstOrDefault()?.ServisList ?? new List <servis>();
                    List <hasta> hastalist   = servisliste.FirstOrDefault(x => x._id == ObjectId.Parse(ddlServis.SelectedValue))?.HastaList ?? new List <hasta>();
                    hastalist.Add(cat);
                    collection.UpdateOne(Builders <yatanhastalar> .Filter.Eq(x => x._id, ObjectId.Parse(ddlDoktor.SelectedValue)),
                                         Builders <yatanhastalar> .Update.Set(b => b.ServisList, servisliste));
                }
            }
        }
示例#4
0
        private hasta HastaBulDosyaID(string str)
        {
            db = new saglikDBEntities_1();
            long  sayi  = long.Parse(str);
            hasta hasta = db.hasta.ToList().Where(a => a.dosyaID == sayi).FirstOrDefault();

            return(hasta); //(a => a.dosyaID == int.Parse(str));
        }
 public void UpdateHasta(hasta hasta)
 {
     using (SOHATSEntities context = new SOHATSEntities())
     {
         var entity = context.Entry(hasta);
         entity.State = EntityState.Modified;
         context.SaveChanges();
     }
 }
 internal void DeleteHasta(hasta hasta)
 {
     using (SOHATSEntities context = new SOHATSEntities())
     {
         var entity = context.Entry(hasta);
         entity.State = EntityState.Deleted;
         context.SaveChanges();
     }
 }
        public List <hasta> NameToGetPatient(string name)
        {
            ConnectionDB.ConnectionToDatabase();

            #region Stored Prosedure bağlantısı
            if (name == null)
            {
                command = new SqlCommand("[dbo].[_selGetPatient]", ConnectionDB._connection);
            }
            else
            {
                command             = new SqlCommand("[dbo].[sel_GetNameOrSurName]", ConnectionDB._connection);
                command.CommandType = CommandType.StoredProcedure;
                parameter           = new SqlParameter("@Name", name);
                parameter.Direction = ParameterDirection.Input;
                parameter.DbType    = DbType.String;
                command.Parameters.Add(parameter);
            }
            #endregion

            adapter = new SqlDataAdapter(command);
            DataTable dataTable = new DataTable();
            adapter.Fill(dataTable);
            command.ExecuteNonQuery();

            reader = command.ExecuteReader();
            List <hasta> patients = new List <hasta>();

            #region Load to data reader
            while (reader.Read())
            {
                hasta patient = new hasta();
                patient.FullName     = reader["FullName"].ToString();
                patient.TCKN         = reader["TCKN"].ToString();
                patient.FileNumber   = reader["FileNumber"].ToString();
                patient.Name         = reader["Name"].ToString();
                patient.SurName      = reader["SurName"].ToString();
                patient.PlaceOfBirth = reader["PlaceOfBirth"].ToString();
                patient.DateOfBirth  = (DateTime)reader["DateOfBirth"];
                patient.FatherName   = reader["FatherName"].ToString();
                patient.MotherName   = reader["MotherName"].ToString();
                patient.Gender       = reader["Gender"].ToString();
                patient.BloodGroup   = reader["BloodGroup"].ToString();
                patient.Address      = reader["Address"].ToString();
                patient.MobilePhone  = reader["MobilePhone"].ToString();
                patient.FoundationRegistrationNumber = reader["FoundationRegistrationNumber"].ToString();
                patient.FoundationName   = reader["FoundationName"].ToString();
                patient.CloseMobilePhone = reader["CloseMobilePhone"].ToString();
                patient.CloseFoundationRegistrationNumber = reader["CloseFoundationRegistrationNumber"].ToString();
                patient.CloseFoundationName = reader["CloseFoundationName"].ToString();
                patients.Add(patient);
            }
            #endregion

            ConnectionDB.EndConnectionToDatabase();
            return(patients);
        }
示例#8
0
 private bool HastaYok(hasta hastas)
 {
     if (hastas.tckimlikno == "0")
     {
         MessageBox.Show("Kişi bulunamadı");
         return(false);
     }
     return(true);
 }
示例#9
0
 private void HastaBilgiDoldur(hasta h)
 {
     textBox1.Text       = h?.birey.ad ?? "";
     textBox2.Text       = h?.birey.soyad ?? "";
     maskedTextBox1.Text = h?.birey.ceptel ?? "";
     maskedTextBox2.Text = h?.yakintel ?? "";
     textBox3.Text       = h?.kurumsicilno ?? "";
     textBox4.Text       = h?.tckimlikno.ToString() ?? "";
     sevkIslemDoldur(h);
 }
示例#10
0
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }
            long tcno = long.Parse(dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString());

            activeHasta  = db.hasta.Where(a => a.tckimlikno == tcno).Single();
            DialogResult = DialogResult.OK;
            Close();
        }
 public bool addHasta(hasta hasta)
 {
     using (SOHATSEntities context = new SOHATSEntities())
     {
         try
         {
             var entity = context.Entry(hasta);
             entity.State = EntityState.Added;
             context.SaveChanges();
             return(true);
         }
         catch (System.Data.Entity.Infrastructure.DbUpdateException)
         {
             return(false);
         }
     }
 }
        private void btnBul_Click(object sender, EventArgs e)
        {
            dgwTahlilveİslemler.Rows.Clear();
            if (txtDosyaNo.Text == "")
            {
                DosyaBul dosyaBul = new DosyaBul(anaForm, formControl);
                dosyaBul.MdiParent = anaForm;
                dosyaBul.Visible   = true;
            }
            else
            {
                string dosyaNo = txtDosyaNo.Text;

                hasta hastam = databaseControl.GetHasta(dosyaNo);
                if (hastam == null)
                {
                    MessageBox.Show("Hasta Yok");
                }
                else
                {
                    txtHastaAdi.Text = hastam.ad;
                    txtSoyadi.Text   = hastam.soyad;
                    txtKurumAdi.Text = hastam.kurumadi;
                    sevk sevk = databaseControl.GetSevk(dosyaNo);
                    if (sevk.dosyano == null)
                    {
                        return;
                    }
                    else
                    {
                        txtHastaAdi.Text = hastam.ad;
                        txtSoyadi.Text   = hastam.soyad;
                        txtKurumAdi.Text = hastam.kurumadi;
                    }
                }

                List <DateTime> oncekiler = databaseControl.GetOncekiİslemler(dosyaNo);
                cbOncekiIslemler.Text = " ";
                cbOncekiIslemler.Items.Clear();
                foreach (DateTime dt in oncekiler)
                {
                    cbOncekiIslemler.Items.Add(dt);
                }
            }
        }
示例#13
0
 public List <HastaTip> YeniHasta(hasta kayit)
 {
     try
     {
         hasta h = new hasta();
         h.hastaID          = kayit.hastaID;
         h.hastaAd          = kayit.hastaAd;
         h.hastaSoyad       = kayit.hastaSoyad;
         h.hastaGelisNedeni = kayit.hastaGelisNedeni;
         _ent.hasta.Add(h);
         _ent.SaveChanges();
         return(HastalariGetir());
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
        public bool InsertPatientProcess(hasta hasta)
        {
            if (hasta == null)
            {
                return(false);
            }
            else
            {
                SqlCommand command = ConnectionDB._connection.CreateCommand();
                command.CommandText = "Execute [dbo].[_insPatient]" +
                                      "@TCKN, @FileNumber, @Name," +
                                      "@SurName, @PlaceOfbirth, @DateOfBirth," +
                                      "@FatherName, @MotherName, @Gender," +
                                      "@BloodGroup, @Address,@MobilePhone," +
                                      "@FoundationRegistrationNumber, @FoundationName, @CloseMobilePhone," +
                                      "@CloseFoundationRegistrationNumber, @CloseFoundationName";

                #region Inserted command data
                command.Parameters.Add("@TCKN", SqlDbType.VarChar, 10).Value         = hasta.TCKN.ToString();
                command.Parameters.Add("@FileNumber", SqlDbType.VarChar, 10).Value   = hasta.FileNumber.ToString();
                command.Parameters.Add("@Name", SqlDbType.VarChar, 15).Value         = hasta.Name.ToString();
                command.Parameters.Add("@SurName", SqlDbType.VarChar, 15).Value      = hasta.SurName.ToString();
                command.Parameters.Add("@PlaceOfBirth", SqlDbType.VarChar, 15).Value = hasta.PlaceOfBirth.ToString();
                command.Parameters.Add("@DateOfBirth", SqlDbType.DateTime).Value     = (DateTime)hasta.DateOfBirth;
                command.Parameters.Add("@FatherName", SqlDbType.VarChar, 15).Value   = hasta.FatherName.ToString();
                command.Parameters.Add("@MotherName", SqlDbType.VarChar, 15).Value   = hasta.MotherName.ToString();
                command.Parameters.Add("@Gender", SqlDbType.VarChar, 5).Value        = hasta.Gender.ToString();
                command.Parameters.Add("@BloodGroup", SqlDbType.VarChar, 5).Value    = hasta.BloodGroup.ToString();
                command.Parameters.Add("@Address", SqlDbType.VarChar, 255).Value     = hasta.Address.ToString();
                command.Parameters.Add("@MobilePhone", SqlDbType.VarChar, 11).Value  = hasta.MobilePhone.ToString();
                command.Parameters.Add("@FoundationRegistrationNumber", SqlDbType.VarChar, 10).Value = hasta.FoundationRegistrationNumber.ToString();
                command.Parameters.Add("@FoundationName", SqlDbType.VarChar, 50).Value   = hasta.FoundationName.ToString();
                command.Parameters.Add("@CloseMobilePhone", SqlDbType.VarChar, 11).Value = hasta.CloseMobilePhone.ToString();
                command.Parameters.Add("@CloseFoundationRegistrationNumber", SqlDbType.VarChar, 10).Value = hasta.CloseFoundationRegistrationNumber.ToString();
                command.Parameters.Add("@CloseFoundationName", SqlDbType.VarChar, 50).Value = hasta.CloseFoundationName.ToString();
                #endregion

                ConnectionDB.ConnectionToDatabase();
                command.ExecuteNonQuery();
                ConnectionDB.EndConnectionToDatabase();

                return(true);
            }
        }
示例#15
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        DataClassesDataContext ekle = new DataClassesDataContext();
        hasta blg = new hasta()
        {
            ogrenci_no  = TextBox1.Text,
            g_tarih     = TextBox2.Text,
            c_tarih     = TextBox3.Text,
            rahatsizlik = TextBox4.Text,
            tedavi      = TextBox5.Text
        };

        ekle.hastas.InsertOnSubmit(blg);
        ekle.SubmitChanges();
        Label1.Text = "Öğrenci kaydedildi.";



        listele();
    }
示例#16
0
        private void TextboxEnterSorgula()
        {
            string aranan = materialSingleLineTextField1.Text;
            long   sayi;

            if (!long.TryParse(aranan, out sayi))
            {
                hastaEkleFlipFlop();
                return;
            }

            hasta hasta = HastaBulDosyaID(aranan) ?? HastaBulTC(aranan);

            HastaBilgiDoldur(hasta);
            ActiveHasta = hasta;

            if (hasta == null)
            {
                hastaEkleFlipFlop();
            }
        }
示例#17
0
        private void bilgileriGetir()
        {
            hasta hasta = databaseControl.GetHasta(dosyaNumarasi.ToString());

            txtTC.Text                = hasta.tckimlikno;
            txtAd.Text                = hasta.ad;
            txtSoyad.Text             = hasta.soyad;
            txtDogumYeri.Text         = hasta.dogumyeri;
            dogumTarihi.Value         = Convert.ToDateTime(hasta.dogumtarihi);
            txtBabaAdi.Text           = hasta.babaadi;
            txtAnneAdi.Text           = hasta.anneadi;
            cinsiyet.Text             = hasta.cinsiyet;
            kanGrubu.Text             = hasta.kangrubu;
            medeniHal.Text            = hasta.medenihal;
            txtAdres.Text             = hasta.adres;
            txtTelefonNo.Text         = hasta.tel;
            txtKurumSicilNo.Text      = hasta.kurumsicilno;
            txtKurumSicilAdi.Text     = hasta.kurumadi;
            txtYakinTelefonNo.Text    = hasta.yakintel;
            txtYakinKurumSicilNo.Text = hasta.yakinkurumsicilno;
            txtYakinKurumAdi.Text     = hasta.yakinkurumadi;
        }
示例#18
0
        private void sevkIslemDoldur(hasta h)
        {
            if (h == null)
            {
                return;
            }
            flowLayoutPanel1.Controls.Clear();
            int sevkSayi = 0;
            var efesfe   = db.dosya.ToList().Where(a => a.dosyaid == h.dosyaID);

            foreach (var sevk in db.dosya.ToList().Where(a => a.dosyaid == h.dosyaID).FirstOrDefault().sevk)
            {
                SevkItem item = new SevkItem(sevk);
                item.GörüntüleEvent += SevkGörüntüleOrtakButton;
                item.DüzenleEvent   += SevkDüzenleOrtakButton;
                item.TaburcuEvent   += SevkTaburcuOrtakButton;
                flowLayoutPanel1.Controls.Add(item);
                sevkSayi++;
            }

            materialLabel8.Text = sevkSayi == 0 ? "Sevk Bulunamadı!" : sevkSayi + " Adet Sevk Bulundu";
        }
示例#19
0
 public void InsertPatientProcessMethod()
 {
     #region Boş kontrolü yapılmaktadır ..
     foreach (Control item in this.Controls)
     {
         if (item is TextBox)
         {
             if (((TextBox)item).Text == string.Empty)
             {
                 if (((TextBox)item).Text == string.Empty)
                 {
                     MessageBox.Show("Gerekli alanları doldurunuz.");
                     return;
                 }
             }
         }
         if (item is ComboBox)
         {
             if (((ComboBox)item).Text == string.Empty)
             {
                 if (((TextBox)item).Text == string.Empty)
                 {
                     MessageBox.Show("Gerekli alanları doldurunuz.");
                     return;
                 }
             }
         }
     }
     #endregion
     #region Kayıt işlemi gerçekleşmektedir ..
     try
     {
         hasta patient = new hasta();
         patient.TCKN         = txtTcNo.Text;
         patient.FileNumber   = txtDosyaNo.Text;
         patient.Name         = txtAd.Text;
         patient.SurName      = txtSoyad.Text;
         patient.PlaceOfBirth = txtDogumYer.Text;
         patient.DateOfBirth  = dtDogumTarih.Value;
         patient.FatherName   = txtBabaAd.Text;
         patient.MotherName   = txtAnneAd.Text;
         patient.Gender       = cmbCinsiyet.Text;
         patient.BloodGroup   = cmbKanGrubu.Text;
         patient.Address      = txtAdres.Text;
         patient.MobilePhone  = txtTelNo.Text;
         patient.FoundationRegistrationNumber = txtKurumSicilNo.Text;
         patient.FoundationName   = txtKurumAd.Text;
         patient.CloseMobilePhone = txtYakınTel.Text;
         patient.CloseFoundationRegistrationNumber = txtKurumSicilNo2.Text;
         patient.CloseFoundationName = txtKurumAd2.Text;
         HastaContract crud = new HastaContract();
         if (!crud.InsertPatientProcess(patient))
         {
             MessageBox.Show("Lütfen Tüm alanları doldurunuz !");
         }
         MessageBox.Show("Kayıt işlemi başarıyla gerçekleşti.. ", "Bildiri", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
     #endregion
 }
示例#20
0
        private void btnBul_Click(object sender, EventArgs e)
        {
            dgwHasta.Rows.Clear();
            if (cbSecenek.Text == "")
            {
                MessageBox.Show("Lütfen bir seçim yapınız");
                return;
            }
            if (cbSecenek.SelectedIndex == 0)
            {
                string ad    = txtAd.Text != "" ? txtAd.Text : "0";
                string soyad = txtSoyad.Text != "" ? txtSoyad.Text : "0";

                if (cbVe.Checked)
                {
                    if (ad.Equals("0"))
                    {
                        MessageBox.Show("Lütfen adını giriniz veya 've' işaretlemeyiz");
                        return;
                    }
                    if (soyad.Equals("0"))
                    {
                        MessageBox.Show("Lütfen Soyadını giriniz veya 've' işaretlemeyiz");
                        return;
                    }
                    // VE
                    List <hasta> hastas = databaseControl.GetHastaAdSoyad(ad, soyad, true);
                    if (hastas.Count < 1)
                    {
                        MessageBox.Show("Kişi bulunamadı");
                        return;
                    }
                    foreach (hasta hasta in hastas)
                    {
                        dgwHasta.Rows.Add(hasta.tckimlikno,
                                          hasta.dosyano,
                                          hasta.ad,
                                          hasta.soyad,
                                          hasta.dogumyeri,
                                          hasta.dogumtarihi,
                                          hasta.babaadi,
                                          hasta.anneadi,
                                          hasta.cinsiyet);
                    }
                }
                else
                {
                    // VEYA
                    if (txtAd.Text == "" && txtSoyad.Text == "")
                    {
                        MessageBox.Show("Lütfen değer giriniz");
                        return;
                    }
                    List <hasta> hastas = databaseControl.GetHastaAdSoyad(ad, soyad, false);
                    if (hastas.Count < 1)
                    {
                        MessageBox.Show("Kişi bulunamadı");
                        return;
                    }
                    foreach (hasta hasta in hastas)
                    {
                        dgwHasta.Rows.Add(hasta.tckimlikno,
                                          hasta.dosyano,
                                          hasta.ad,
                                          hasta.soyad,
                                          hasta.dogumyeri,
                                          hasta.dogumtarihi,
                                          hasta.babaadi,
                                          hasta.anneadi,
                                          hasta.cinsiyet);
                    }
                }
            }
            else if (cbSecenek.SelectedIndex == 1)
            {
                if (!txtAramaKontrol())
                {
                    return;
                }
                string kimlikNo = txtArama.Text;
                hasta  hastas   = databaseControl.GetHastaKimlikNo(kimlikNo);

                bool durum = HastaYok(hastas);
                if (!durum)
                {
                    return;
                }

                dgwHasta.Rows.Add(hastas.tckimlikno,
                                  hastas.dosyano,
                                  hastas.ad,
                                  hastas.soyad,
                                  hastas.dogumyeri,
                                  hastas.dogumtarihi,
                                  hastas.babaadi,
                                  hastas.anneadi,
                                  hastas.cinsiyet);
            }
            else if (cbSecenek.SelectedIndex == 2)
            {
                if (!txtAramaKontrol())
                {
                    return;
                }
                string kurumSicilNo = txtArama.Text;
                hasta  hastas       = databaseControl.GetHastaKurumSicilNo(kurumSicilNo);

                bool durum = HastaYok(hastas);
                if (!durum)
                {
                    return;
                }

                dgwHasta.Rows.Add(hastas.tckimlikno,
                                  hastas.dosyano,
                                  hastas.ad,
                                  hastas.soyad,
                                  hastas.dogumyeri,
                                  hastas.dogumtarihi,
                                  hastas.babaadi,
                                  hastas.anneadi,
                                  hastas.cinsiyet);
            }
            else if (cbSecenek.SelectedIndex == 3)
            {
                if (!txtAramaKontrol())
                {
                    return;
                }
                string dosyaNo = txtArama.Text;

                hasta hastas = databaseControl.GetHastaDosyaNo(dosyaNo);

                bool durum = HastaYok(hastas);
                if (!durum)
                {
                    return;
                }

                dgwHasta.Rows.Add(hastas.tckimlikno,
                                  hastas.dosyano,
                                  hastas.ad,
                                  hastas.soyad,
                                  hastas.dogumyeri,
                                  Convert.ToDateTime(hastas.dogumtarihi).ToShortDateString(),
                                  hastas.babaadi,
                                  hastas.anneadi,
                                  hastas.cinsiyet);
            }
        }
示例#21
0
        private void button1_Click(object sender, EventArgs e)
        {
            saglikDBEntities_1 db = new saglikDBEntities_1();

            if (!YıldızlılarDolumu())
            {
                MessageBox.Show("Lütfen Yıdızlı Kısımları Doldurup Tekrar Deneyin!", "Hata", MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
                return;
            }

            if (db.hasta.Any(a => a.tckimlikno.ToString() == maskedTextBox4.Text.Trim()))
            {
                MessageBox.Show("Aynı Kimlik Numaralı hasta daha önce zaten eklenmiş!", "Hata", MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
                return;
            }

            DateTime aktifDosyaTarihi = DateTime.Now;
            birey    birey            = new birey();

            birey.tckimlikno = long.Parse(maskedTextBox4.Text);
            birey.ad         = textBox5.Text;
            birey.soyad      = textBox6.Text;
            birey.cinsiyet   = comboBox2.SelectedIndex.ToString();
            birey.dtarihi    = dateTimePicker1.Value;
            birey.evtel      = maskedTextBox1.Text;
            birey.ceptel     = maskedTextBox2.Text;
            birey.dogumyeri  = textBox16.Text;
            birey.anneadi    = textBox15.Text;
            birey.babaadi    = textBox17.Text;
            birey.kangrubu   = textBox18.Text;
            birey.medenihal  = comboBox3.SelectedIndex.ToString();
            birey.adres      = richTextBox1.Text;

            birey.hasta                   = new hasta();
            birey.hasta.tckimlikno        = birey.tckimlikno;
            birey.hasta.kurumadi          = textBox3.Text;
            birey.hasta.kurumsicilno      = textBox2.Text;
            birey.hasta.yakinkurumadi     = textBox4.Text;
            birey.hasta.yakinkurumsicilno = textBox11.Text;
            birey.hasta.yakintel          = maskedTextBox3.Text;


            dosya dosya = new dosya();

            dosya.dosyatarihi     = aktifDosyaTarihi;
            dosya.hastatckimlikno = birey.tckimlikno;

            birey.hasta.dosya = new List <dosya>();
            birey.hasta.dosya.Add(dosya);


            db.birey.AddOrUpdate(birey);
            db.SaveChanges();
            birey.hasta.dosyaID = dosya.dosyaid;
            db = new saglikDBEntities_1();
            db.hasta.AddOrUpdate(birey.hasta);
            db.SaveChanges();
            ActiveHasta = birey.hasta;
            MessageBox.Show("Hasta Eklendi!", "Başarılı", MessageBoxButtons.OK, MessageBoxIcon.Information);
            DialogResult = DialogResult.OK;
        }
 partial void Inserthasta(hasta instance);
 partial void Updatehasta(hasta instance);
 partial void Deletehasta(hasta instance);
示例#25
0
 public YeniSevkForm(hasta h) : this() //yeni Kayıt
 {
     ActiveHasta = h;
     SevkİşlemControlsDoldur();
 }