示例#1
0
        private void button6_Click(object sender, EventArgs e)
        {
            Sevk s = new Sevk()
            {
                DosyaNo    = h.DosyaNo,
                Poliklinik = comboBox_Poliklink.SelectedItem.ToString(),
                Sira       = Convert.ToInt32(txt_sirano.Text),
                Islem      = comboBox_Islem.SelectedItem.ToString(),
                DoktorKod  = Convert.ToInt32(comboBox_Doktor.SelectedItem.ToString()),
                Miktar     = Convert.ToInt32(numericUpDown_Miktar.Value),
                BirimFiyat = Convert.ToInt32(txt_fiyat.Text),
                Saat       = DateTime.Now.Hour.ToString(),
                SevkTarihi = DateTime.Now,
                Taburcu    = false,
            };

            SevkProvider.Ekle(s);
            MessageBox.Show("Eklendi");
            h = HastaProvider.Get("select * from Hasta where DosyaNo=" + h.DosyaNo.ToString());
            lbl_hasta_bilgileri.Text = string.Format("TC:{0} ,DosyaNo:{1},AdSoyad:{2} ", h.TC, h.DosyaNo, h.AdSoyad);
            List <Sevk> liste  = SevkProvider.GetAllSevkler(h.DosyaNo);
            int         toplam = liste.Sum(p => p.Miktar * p.BirimFiyat);

            lbl_toplamtutar.Text    += ": " + toplam.ToString();
            dataGridView1.DataSource = liste;
        }
示例#2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (txt_sorgu.Text == "")
     {
         return;
     }
     if (txt_sorgu.AutoCompleteCustomSource.Contains(txt_sorgu.Text))
     {
         string sorgu = "select * from Hasta where ";
         if (comboBox1.SelectedIndex == 0)
         {
             sorgu += "DosyaNo=" + txt_sorgu.Text;
         }
         else
         {
             sorgu += "TC='" + txt_sorgu.Text + "'";
         }
         try
         {
             h = HastaProvider.Get(sorgu);
             lbl_hasta_bilgileri.Text = string.Format("TC:{0} ,DosyaNo:{1},AdSoyad:{2} ", h.TC, h.DosyaNo, h.AdSoyad);
             List <Sevk> liste = SevkProvider.GetAllSevkler(h.DosyaNo);
             dataGridView1.DataSource = liste;
             int toplam = liste.Sum(p => p.Miktar * p.BirimFiyat);
             lbl_toplamtutar.Text += ": " + toplam.ToString();
             button6.Enabled       = true;
             button7.Enabled       = true;
             button8.Enabled       = true;
         }
         catch (Exception)
         {
         }
     }
     else
     {
         MessageBox.Show("Bulanamadı!!!");
     }
 }