Пример #1
0
        void YeniKaydet()
        {
            try
            {
                TblHasta hasta = new TblHasta();
                try
                {
                    PosterolateralDbDataContext _db = new PosterolateralDbDataContext();

                    hasta.Ad     = txtAd.Text;
                    hasta.Soyad  = txtSoyad.Text;
                    hasta.Prot   = txtProtokolNo.Text;
                    hasta.Opttar = DateTime.Parse(dtpOpTarih.Text);
                    hasta.Opttur = txtOpTur.Text;
                    hasta.Takip  = int.Parse(txtTakip.Text);
                    hasta.Anah   = int.Parse(txtAnah.Text);
                    _db.TblHastas.InsertOnSubmit(hasta);
                    _db.SubmitChanges();
                }
                catch (Exception es)
                {
                    _m.Hata(es);
                }

                TblDemograf demog = new TblDemograf();
                try
                {
                    demog.HastaId  = hasta.Id;
                    demog.Yas      = txtYas.Text != "" ? int.Parse(txtYas.Text) : -1;
                    demog.Kilo     = txtKilo.Text != "" ? decimal.Parse(txtKilo.Text) : -1;
                    demog.Boy      = txtBoy.Text != "" ? int.Parse(txtBoy.Text) : -1;
                    demog.BMI      = Convert.ToInt16((demog.Kilo * 10000) / (demog.Boy * demog.Boy));
                    demog.ASA      = cbAsa.Text != "" ? int.Parse(cbAsa.Text) : -1;
                    demog.Dr       = txtDr.Text;
                    demog.Cins     = cbCins.Text;
                    demog.Taraf    = cbTaraf.Text;
                    demog.Lklzsyn  = txtLokalizasyon.Text;
                    demog.Boyut    = txtBoyut.Text != ""?int.Parse(txtBoyut.Text):-1;
                    demog.Komorbid = txtKoMorb.Text;

                    _db.TblDemografs.InsertOnSubmit(demog);
                }
                catch (Exception ed)
                {
                    _m.Hata(ed);
                }

                TblOperaf op = new TblOperaf();


                try
                {
                    op.HastaId = hasta.Id;

                    op.PksAc   = cbPksAciklama.Text;
                    op.SIK     = cbSIK.Text;
                    op.Coop    = txtCoop.Text;
                    op.Iskemi  = txtIskemi.Text != "" ? int.Parse(txtIskemi.Text) : -1;
                    op.Portsay = txtPortSay.Text != "" ? int.Parse(txtPortSay.Text) : -1;
                    op.Yrdmynt = txtYardimYnt.Text;
                    op.Sure    = txtSure.Text != "" ? int.Parse(txtSure.Text) : -1;
                    op.Dren    = txtDren.Text != "" ? int.Parse(txtDren.Text) : -1;
                    op.Kanama  = txtKanama.Text != "" ? int.Parse(txtKanama.Text) : -1;
                    op.Piyes   = txtPiyes.Text != "" ? int.Parse(txtPiyes.Text) : -1;

                    _db.TblOperafs.InsertOnSubmit(op);
                }
                catch (Exception eo)
                {
                    _m.Hata(eo);
                }
                TblPosOperaf po = new TblPosOperaf();

                try
                {
                    po.HastaId        = hasta.Id;
                    po.PeropErkenKomp = cbPerErKom.Text;
                    po.PostopAn       = txtPosAnaliz.Text;
                    po.Sonda          = cbSonda.Text;
                    po.HospSur        = txtHospSure.Text != "" ? int.Parse(txtHospSure.Text) : -1;
                    po.preopKeratin   = mtbPreobKeratin.Text != "" ? decimal.Parse(mtbPreobKeratin.Text) : -1;
                    po.PostopKreatin  = mtbPostopKeratin.Text != "" ? decimal.Parse(mtbPostopKeratin.Text) : -1;
                    po.PreopHtc       = mtbPreopHct.Text != "" ? decimal.Parse(mtbPreopHct.Text) : -1;
                    po.PostopHct      = mtbPostopHct.Text != "" ? decimal.Parse(mtbPostopHct.Text) : -1;
                    po.PreobHb        = mtbPreopHb.Text != "" ? decimal.Parse(mtbPreopHb.Text) : -1;
                    po.PostopHb       = mtbPostopHb.Text != "" ? decimal.Parse(mtbPostopHb.Text) : -1;
                    po.Takip          = txtPosTakip.Text;
                    po.Tel            = txtTel.Text;
                    po.PostopGecKomp  = txtPostopGecKomp.Text;
                    po.KompClavien    = txtKompClavien.Text;

                    _db.TblPosOperafs.InsertOnSubmit(po);
                }
                catch (Exception p)
                {
                    _m.Hata(p);
                }
                Tbl_PatalojikVeri pa = new Tbl_PatalojikVeri();

                try
                {
                    pa.HastaId       = hasta.Id;
                    pa.Patoloji      = txtPatoloji.Text;
                    pa.AltGr         = txtAltGrup.Text;
                    pa.FurhmanGrade  = cbFuhrman.Text;
                    pa.PatolojikEvre = cbPatEvre.Text;
                    pa.CerrahiSinir  = cbCerrahiSinir.Text;

                    _db.Tbl_PatalojikVeris.InsertOnSubmit(pa);
                }
                catch (Exception a)
                {
                    _m.Hata(a);
                }
                TblTakip tkp = new TblTakip();
                try
                {
                    tkp.HastaId = hasta.Id;

                    tkp.Postop3Lkl  = cb3Nuks.Text;
                    tkp.Postop3Krtn = mtbPost3Kerat.Text != "" ? decimal.Parse(mtbPost3Kerat.Text) : -1;

                    tkp.Postop6Lkl  = cbNuks6.Text;
                    tkp.Postop6Krtn = mtbPost6Kerat.Text != "" ? decimal.Parse(mtbPost6Kerat.Text) : -1;

                    tkp.Postop12Lkl  = cbNuks12.Text;
                    tkp.Postop12Krtn = mtbPost12Kerat.Text != "" ? decimal.Parse(mtbPost12Kerat.Text) : -1;

                    _db.TblTakips.InsertOnSubmit(tkp);
                }
                catch (Exception t)
                {
                    _m.Hata(t);
                }



                _db.SubmitChanges();


                _m.YeniKayit("Kayıt başarılı");
                Temizle();
            }
            catch (Exception d)
            {
                _m.Hata(d);
            }
        }
Пример #2
0
        void BilgiGetir()
        {
            _f.HastaList(true);
            _secimId = frmAnasayfa.aktarma;

            frmAnasayfa.aktarma = -1;
            if (_secimId > 0)
            {
                _edit          = true;
                btnKaydet.Text = "GÜNCELLE";
            }
            TblHasta hst = new TblHasta();

            hst                = _db.TblHastas.First(x => x.Id == _secimId);
            txtAd.Text         = hst.Ad;
            txtSoyad.Text      = hst.Soyad;
            txtProtokolNo.Text = hst.Prot;
            dtpOpTarih.Text    = hst.Opttar.ToString();
            txtOpTur.Text      = hst.Opttur;
            txtTakip.Text      = hst.Takip.ToString();
            txtAnah.Text       = hst.Anah.ToString();

            TblDemograf hd = _db.TblDemografs.First(x => x.HastaId == _secimId);

            txtYas.Text          = hd.Yas.ToString();
            txtBoy.Text          = hd.Boy.ToString();
            txtKilo.Text         = hd.Kilo.ToString();
            txtBMI.Text          = hd.BMI.ToString();
            cbAsa.Text           = hd.ASA.ToString();
            txtDr.Text           = hd.Dr;
            cbCins.Text          = hd.Cins;
            cbTaraf.Text         = hd.Taraf;
            txtLokalizasyon.Text = hd.Lklzsyn;
            txtBoyut.Text        = hd.Boyut.ToString();
            txtKoMorb.Text       = hd.Komorbid;

            Tbl_PatalojikVeri pv = _db.Tbl_PatalojikVeris.First(x => x.HastaId == _secimId);

            txtPatoloji.Text    = pv.Patoloji;
            txtAltGrup.Text     = pv.AltGr;
            cbFuhrman.Text      = pv.FurhmanGrade;
            cbPatEvre.Text      = pv.PatolojikEvre;
            cbCerrahiSinir.Text = pv.CerrahiSinir;

            TblOperaf op = _db.TblOperafs.First(x => x.HastaId == _secimId);

            cbPksAciklama.Text = op.PksAc;
            cbSIK.Text         = op.SIK;
            txtCoop.Text       = op.Coop;
            txtIskemi.Text     = op.Iskemi.ToString();
            txtPortSay.Text    = op.Portsay.ToString();
            txtYardimYnt.Text  = op.Yrdmynt;
            txtSure.Text       = op.Sure.ToString();
            txtDren.Text       = op.Dren.ToString();
            txtKanama.Text     = op.Kanama.ToString();
            txtPiyes.Text      = op.Piyes.ToString();

            TblPosOperaf po = _db.TblPosOperafs.First(x => x.HastaId == _secimId);

            cbPerErKom.Text       = po.PeropErkenKomp;
            txtPosAnaliz.Text     = po.PostopAn;
            cbSonda.Text          = po.Sonda;
            mtbPreobKeratin.Text  = po.preopKeratin.ToString();
            mtbPostopKeratin.Text = po.PostopKreatin.ToString();
            mtbPreopHct.Text      = po.PreopHtc.ToString();
            mtbPostopHct.Text     = po.PostopHct.ToString();
            mtbPreopHb.Text       = po.PreobHb.ToString();
            mtbPostopHb.Text      = po.PostopHb.ToString();
            txtPosTakip.Text      = po.Takip;
            txtTel.Text           = po.Tel;
            txtPostopGecKomp.Text = po.PostopGecKomp;
            txtKompClavien.Text   = po.KompClavien;



            TblTakip tkp = _db.TblTakips.First(x => x.HastaId == _secimId);

            cb3Nuks.Text       = tkp.Postop3Lkl;
            mtbPost3Kerat.Text = tkp.Postop3Krtn.ToString();

            cbNuks6.Text       = tkp.Postop6Lkl;
            mtbPost6Kerat.Text = tkp.Postop6Krtn.ToString();

            cbNuks12.Text       = tkp.Postop12Lkl;
            mtbPost12Kerat.Text = tkp.Postop12Krtn.ToString();
        }