public IActionResult Get(int id)
        {
            ServiceResponse <Hastane> response = new ServiceResponse <Hastane>();

            Hastane entity = service.GetById(id);

            if (entity == null)
            {
                response.Errors.Add("Hastane bulunamadı");
                response.HasError = true;
                return(BadRequest(response));
            }
            else
            {
                response.entity       = entity;
                response.IsSuccessful = true;
                return(Ok(response));
            }
        }
Esempio n. 2
0
        private void Hastaneler_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e)
        {
            Hastane hastane = Hastaneler[e.Position];

            Bolumler = bolumService.Bolumler(hastane.Id);

            List <string> bolumAdlari = new List <string>();

            foreach (var item in Bolumler)
            {
                bolumAdlari.Add(item.Ad);
            }

            ArrayAdapter adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerItem, bolumAdlari);

            adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            bolumler.Adapter         = adapter;
            btnDoktorGuncelle.Click += BtnDoktorGuncelle_Click;
        }
Esempio n. 3
0
        private void SpinnerHastaneler_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e)
        {
            Hastane hastane = hastaneler[e.Position];

            bolumler = bolumService.Bolumler(hastane.Id);

            List <string> bolumAdlari = new List <string>();

            foreach (var item in bolumler)
            {
                bolumAdlari.Add(item.Ad);
            }

            ArrayAdapter adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerItem, bolumAdlari);

            adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            spinnerBolumler.Adapter  = adapter;
            spinnerDoktorlar.Adapter = null;
            timeGrid.Adapter         = null;
        }
Esempio n. 4
0
 private void button_hastaneleriListele_Click(object sender, EventArgs e)
 {
     lblBaslik.Text = "Hastaneleri Listele";
     try
     {
         BackGroundIslemleri(((Button)sender).Name);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     try
     {
         Hastane h = new Hastane();
         dgvData.DataSource = h.Goster();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        public IActionResult HastaneEkle(Hastane model)
        {
            RemoteService <Hastane>   service  = new RemoteService <Hastane>();
            ServiceResponse <Hastane> response = service.Post(model, "Hastane");

            if (response.isSuccessful)
            {
                return(RedirectToAction("HastaneListesi"));
            }

            if (response.Errors != null)
            {
                foreach (var item in response.Errors)
                {
                    ModelState.AddModelError("Model", item);
                }
            }


            return(View(model));
        }
Esempio n. 6
0
        private void button3_Click(object sender, EventArgs e) //SILME
        {
            DialogResult dialogResult = MessageBox.Show("Bu HASTANE yi sistemden silmek istediğinizden emin misiniz ?",
                                                        "HASTANE Sil", MessageBoxButtons.YesNo);
            Hastane h = new Hastane();

            h.hastaneID = id;

            label_Message.Text = "";
            //connection.Open();
            id = int.Parse(textBox_ID.Text.Trim());
            int x = h.HastaneSil(/*id*/);

            if (x > 0)
            {
                MessageBox.Show("HASTANE, sistemimizden başarıyla kaldırılmıştır.", "Başarılı");
            }
            else
            {
                MessageBox.Show("İşleminizi gerçekleştirirken bir hata oluştu. Lütfen tekrar deneyiniz", "Hata");
            }
        }
Esempio n. 7
0
 public IActionResult HastaneEkle(Hastane hastane)
 {
     if (ModelState.IsValid)
     {
         string connectionString = this.Configuration.GetConnectionString("appDbConnection");
         using (SqlConnection connection = new SqlConnection(connectionString))
         {
             string sql = "Insert Into Hastane (Tesis_Kodu, Hastane_Adi, Hastane_Telefon, Hastane_Adres, Bagli_Oldugu_Grup_Id) Values ('" + hastane.Tesis_Kodu + "','" + hastane.Hastane_Adi + "','" + hastane.Hastane_Telefon + "','" + hastane.Hastene_Adres + "','" + hastane.Bagli_Oldugu_Grup_Id + "')";
             using (SqlCommand command = new SqlCommand(sql, connection))
             {
                 command.CommandType = CommandType.Text;
                 connection.Open();
                 command.ExecuteNonQuery();
                 connection.Close();
             }
             return(RedirectToAction("Hastane_Islemleri"));
         }
     }
     else
     {
         return(View());
     }
 }
Esempio n. 8
0
        private void btnGuncelle_Click(object sender, EventArgs e)
        {
            DialogResult rs = MessageBox.Show("Güncellemek istediğinizden emin misiniz?", "Emin Misininiz?", MessageBoxButtons.YesNo);

            if (rs == DialogResult.Yes)
            {
                BaseBusiness <Hastane> hs = new BaseBusiness <Hastane>();
                Hastane temp = new Hastane();
                temp.Adi    = txtHastaneAdi.Text.YaziyiDuzelt();
                temp.ID     = Convert.ToInt32(lbHastaneler.SelectedValue);
                temp.IlceID = Convert.ToInt32(cbIlce.SelectedValue);
                temp.IlID   = Convert.ToInt32(cbIl.SelectedValue);
                hs.Guncelle(temp);
                MessageBox.Show("Hastane Güncellendi", "Başarılı");
                lbHastaneler.ListboxaHastaneGetir(cbIlce.SelectedValue.ToString());
                txtHastaneAdi.Clear();
            }
            txtHastaneAdi.Text         = "";
            lbHastaneler.SelectedIndex = -1;
            btnGuncelle.Enabled        = false;
            btnKaydet.Enabled          = true;
            lbHastaneler.Enabled       = true;
        }
        public IActionResult Kaydet(Hastane item)
        {
            try
            {
                using (var dbConnection = DatabaseBaglanti.Connection())
                {
                    dbConnection.Open();
                    if (item.Id == 0)
                    {
                        dbConnection.Execute("insert into public.hastane (adi, adres) values(@adi, @adres)", item);
                    }
                    else
                    {
                        dbConnection.Execute("update public.hastane set adi = @adi, adres = @adres where Id = @Id", item);
                    }
                }

                return(Json(new { basarili = true }));
            }
            catch (System.Exception ex)
            {
                return(Json(new { basarisiz = true }));
            }
        }
Esempio n. 10
0
        private void button4_Click(object sender, EventArgs e) //GUNCELLEME
        {
            label_Message.Text = "";
            ad           = textBox_ad.Text.Trim();
            il           = /*comboBox_il.SelectedItem.ToString()*/ comboBox_il.Text;;
            ilce         = /*comboBox_ilce.SelectedItem.ToString()*/ comboBox_ilce.Text;
            hastaneStatu = comboBox_statu.SelectedItem.ToString();
            yoneticiID   = int.Parse(textBox_yonetici.Text.Trim());
            id           = int.Parse(textBox_ID.Text.Trim());

            Hastane obj = new Hastane(ad, il, ilce, hastaneStatu, yoneticiID);

            obj.hastaneID = id;
            int A = obj.HastaneGüncelle();

            if (A > 0)
            {
                label_Message.Text = "Güncelleme başarılı."; label_Message.ForeColor = Color.Green;
            }
            else
            {
                MessageBox.Show("İşleminizi gerçekleştirirken bir hata oluştu. Lütfen tekrar deneyiniz", "Hata");
            }
        }
 public void Guncelle(Hastane hastane)
 {
     hastaneDal.Update(hastane);
 }
 public void Ekle(Hastane hastane)
 {
     hastaneDal.Add(hastane);
 }
Esempio n. 13
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.hastaneGuncelle_layout);


            spinnerHastaneGuncelleIller   = FindViewById <Spinner>(Resource.Id.spinnerHastaneGuncelleIller);
            spinnerHastaneGuncelleIlceler = FindViewById <Spinner>(Resource.Id.spinnerHastaneGuncelleIlceler);
            txtGuncelleHastaneAd          = FindViewById <EditText>(Resource.Id.txtGuncelleHastaneAd);
            btnHastaneGuncelle            = FindViewById <Button>(Resource.Id.btnHastaneGuncelle);

            ArrayAdapter adapterIl = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerItem, iller);

            adapterIl.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            spinnerHastaneGuncelleIller.Adapter = adapterIl;

            spinnerHastaneGuncelleIller.ItemSelected += SpinnerHastaneGuncelleIller_ItemSelected;
            btnHastaneGuncelle.Click += BtnHastaneGuncelle_Click;

            hastane = hastaneService.Getir(Intent.GetIntExtra("guncelleHastaneId", 0));

            txtGuncelleHastaneAd.Text = hastane.Ad;

            if (hastane.Il == "Manisa")
            {
                spinnerHastaneGuncelleIller.SetSelection(0);

                for (int i = 0; i < manisaIlceler.Length; i++)
                {
                    if (manisaIlceler[i] == hastane.Ilce)
                    {
                        seciliIlceIndex = i;
                    }
                }
            }
            else if (hastane.Il == "İstanbul")
            {
                spinnerHastaneGuncelleIller.SetSelection(1);

                for (int i = 0; i < istanbulIlceler.Length; i++)
                {
                    if (istanbulIlceler[i] == hastane.Ilce)
                    {
                        seciliIlceIndex = i;
                    }
                }
            }
            else if (hastane.Il == "İzmir")
            {
                spinnerHastaneGuncelleIller.SetSelection(2);

                for (int i = 0; i < izmiriIlceler.Length; i++)
                {
                    if (izmiriIlceler[i] == hastane.Ilce)
                    {
                        seciliIlceIndex = i;
                    }
                }
            }
            else if (hastane.Il == "Ankara")
            {
                spinnerHastaneGuncelleIller.SetSelection(3);

                for (int i = 0; i < ankaraIlceler.Length; i++)
                {
                    if (ankaraIlceler[i] == hastane.Ilce)
                    {
                        seciliIlceIndex = i;
                    }
                }
            }
            else if (hastane.Il == "Denizli")
            {
                spinnerHastaneGuncelleIller.SetSelection(4);

                for (int i = 0; i < denizliIlceler.Length; i++)
                {
                    if (denizliIlceler[i] == hastane.Ilce)
                    {
                        seciliIlceIndex = i;
                    }
                }
            }
        }
 public void Update(Hastane entity)
 {
     Repo.Update(entity);
 }
 public void Delete(Hastane entity)
 {
     Repo.Delete(entity);
 }
 public void Create(Hastane entity)
 {
     Repo.Create(entity);
 }