private void BolumDoldur() { sayfaSayisi.Text = _pageModel.ToplamSayfa.ToString(); toplamData.Text = _pageModel.ToplamData.ToString(); Bolumler.DataSource = _pageModel.TabloData; Bolumler.DataBind(); }
public string BolumEkle(string bolumadi) { try { if (!string.IsNullOrWhiteSpace(bolumadi)) { Bolumler Bolumayni = DB.Bolumler.Where(k => k.BolumAdi == bolumadi).FirstOrDefault(); if (Bolumayni == null) { Bolumler bekle = new Bolumler(); bekle.BolumAdi = bolumadi; DB.Bolumler.Add(bekle); if (DB.SaveChanges() > 0) { return("Ekleme Başarılı"); } return("Ekleme Başarısız"); } return("Aynısı var"); } return("Bölüm Adını doldurun"); } catch (Exception) { return("Hata var"); } }
public Olustur FactoryMethod(Bolumler bolumTip) { Olustur olustur = null; switch (bolumTip) { case Bolumler.bolum1: olustur = new bolum1(); break; case Bolumler.bolum2: olustur = new bolum2(); break; case Bolumler.bolum3: olustur = new bolum3(); break; case Bolumler.bolum4: olustur = new bolum4(); break; case Bolumler.bolum5: break; } return(olustur); }
//BolumID'si göre bölüm getiren fonksiyon public Bolumler GetByIDBolum(int BolumID) { cmd = new SqlCommand("select * from Bolumler where BolumID=@BolumId", cnn); cmd.Parameters.AddWithValue("@BolumId", BolumID); Bolumler blm = null; try { cnn.Open(); SqlDataReader reader = cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection); reader.Read(); blm = new Bolumler() { BolumID = Convert.ToInt32(reader["BolumID"]), BolumAd = reader["BolumAd"].ToString(), PoliklinkID = Convert.ToInt32(reader["PoliklinkID"]) }; reader.Close(); return(blm); } catch (Exception) { return(blm); } }
public string BolumSil(int bolumlerid) { try { Bolumler bolumsil = DB.Bolumler.Where(l => l.BolumlerID == bolumlerid).FirstOrDefault(); if (bolumsil != null) { DialogResult silmesaj = MessageBox.Show("Silmek Sitediğinizden emin misiniz?", "Silme Penceresi", MessageBoxButtons.YesNo, MessageBoxIcon.Error); if (silmesaj == DialogResult.Yes) { DB.Bolumler.Remove(bolumsil); if (DB.SaveChanges() > 0) { return("Silme Başarılı"); } return("Silme Başarısız"); } return("İşlemi iptal ettiniz"); } return("Seçim Yapmadınız"); } catch (Exception) { return("hata var"); } }
void bolum_yol_2() { yazi.text = "Bu yolu büyükçe bir kaya kapatmýþ. Geri dönmek için G'ye bas."; if (Input.GetKeyDown(KeyCode.G)) { aktifBolum = Bolumler.orman; } }
public ActionResult AddSection(SectionIndex form) { var section = new Bolumler() { BolumAd = form.Bolumad, BolumID = form.Bolumid }; Database.Session.Save(section); Database.Session.Flush(); return(RedirectToAction("Index", "Section")); }
public DetailsPage(Anime anim) { InitializeComponent(); DataContext = anim; RequestManager api = RequestManager.getInstance(); anime = api.getDetails(anim); ytdl = YtdlMethods.getInstance(); sqlitemanager = SQLiteManager.getInstance(); Bolumler page = new Bolumler(anime, changeFrame); frame.Navigate(page); }
void bolum_orman() { yazi.text = "Gözlerini karanlýk ve ýssýz bir ormanda açtýn. \nOrmandan çýkmak için önünde 3 yol var:\nBirinci yol için 1'e, ikinci yol için 2'ye, üçüncü yol için 3'e bas!"; if (Input.GetKeyDown(KeyCode.Alpha1)) // eger 1'e basarsan yol_1 bolumunu cagiriyor { aktifBolum = Bolumler.yol_1; } else if (Input.GetKeyDown(KeyCode.Alpha2)) { aktifBolum = Bolumler.yol_2; } else if (Input.GetKeyDown(KeyCode.Alpha3)) { aktifBolum = Bolumler.yol_3; } }
private void btnKaydet_Click(object sender, EventArgs e) { if (txtBolum.Text != null && txtBolum.Text.Length >= 4) { Bolumler bolum = new Bolumler(); bolum.Bölüm = txtBolum.Text; db.Bolumler.Add(bolum); db.SaveChanges(); MessageBox.Show("Bölüm başarıyla eklendi.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information); BolumListele(); } else { MessageBox.Show("Bölüm adı boş geçilemez.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
//public ActionResult Index() //{ // return View(); //} public ViewResult Index() { baglanti.ConnectionString = "Data Source =DESKTOP-O1AM6QO\\SQLEXPRESS;Initial Catalog = Ogrencidb;Integrated Security=True"; //baglanti.ConnectionString = "Data Source =localhost;Initial Catalog = OgrenciDb;Integrated Security=True"; SqlCommand komut = new SqlCommand("Select * from Bolumlers", baglanti); DataTable tablo = new DataTable(); SqlDataAdapter Adoptor = new SqlDataAdapter(komut); Adoptor.Fill(tablo); int i = Convert.ToInt32(tablo.Rows.Count); List <Bolumler> BolumListesi = new List <Bolumler>(); Bolumler s = new Bolumler(); for (int j = 0; j < i; j++) { s = new Bolumler(); s.id = Convert.ToInt32(tablo.Rows[j][0]); s.Bolum = Convert.ToString(tablo.Rows[j][1]); BolumListesi.Add(s); } ViewBag.BolumListesi = new SelectList(BolumListesi, "Bolum", "Bolum"); komut = new SqlCommand("Select * from Cities", baglanti); tablo = new DataTable(); Adoptor = new SqlDataAdapter(komut); Adoptor.Fill(tablo); i = Convert.ToInt32(tablo.Rows.Count); List <City> CityList = new List <City>(); City c = new City(); for (int j = 0; j < i; j++) { c = new City(); c.code = Convert.ToString(tablo.Rows[j][0]); c.name = Convert.ToString(tablo.Rows[j][1]); CityList.Add(c); } ViewBag.CityList = new SelectList(CityList, "name", "name"); return(View()); }
void bolum_yol_3() { yazi.text = "Karþýna bir yol ayrýmý çýktý. Hem açsýn hem de susuz. Nehre inmek için N'ye, bahçeye týrmanmak için B'ye bas." + "Geri dönmek için G'ye bas."; if (Input.GetKeyDown(KeyCode.N)) { aktifBolum = Bolumler.nehir; } else if (Input.GetKeyDown(KeyCode.B)) { aktifBolum = Bolumler.bahce; } else if (Input.GetKeyDown(KeyCode.G)) { aktifBolum = Bolumler.orman; } }
void bolum_yol_1() { yazi.text = "Birinci yola saptýn ve uzun bir yürüyüþün ardýndan karþýna bir yol ayrýmý çýktý. " + "Ilk yolun baþýnda bir aslanýn beklediðini gördün. Ikinci yolun baþýnda ise bir yýlan beklemekte. Ne yapacaksýn?" + "\nAslanlý yol için A'ya, yýlanlý yol için Y'ye, geri dönmek için G'ye bas."; if (Input.GetKeyDown(KeyCode.A)) { aktifBolum = Bolumler.aslan; } else if (Input.GetKeyDown(KeyCode.Y)) { aktifBolum = Bolumler.yilan; } else if (Input.GetKeyDown(KeyCode.G)) { aktifBolum = Bolumler.orman; } }
public ActionResult Create(Bolumler model) { using (OIDbEntities db = new OIDbEntities()) { if (!ModelState.IsValid) { return(View(model)); } if (model.ID == 0) { db.Bolumlers.Add(model); } else { db.Entry(model).State = System.Data.Entity.EntityState.Modified; } db.SaveChanges(); return(RedirectToAction("List")); } }
public string Bolumguncelle(int bolumlerid, string bolumadi) { try { Bolumler bolguncel = DB.Bolumler.Where(h => h.BolumlerID == bolumlerid).FirstOrDefault(); if (bolguncel != null) //if(bolumlerid!=0) { if (!string.IsNullOrWhiteSpace(bolumadi)) { Bolumler bolumayni = DB.Bolumler.Where(k => k.BolumAdi == bolumadi).FirstOrDefault(); if (bolumayni == null) { DialogResult guncelle_mesaj = MessageBox.Show("Güncellemek istediğinizden emin misiniz?", "Silme Penceresi", MessageBoxButtons.YesNo, MessageBoxIcon.Error); if (guncelle_mesaj == DialogResult.Yes) { bolguncel.BolumAdi = bolumadi; if (DB.SaveChanges() > 0) { return("Güncelleme Başarılı"); } return("Güncelleme Başarısız"); } return("İşleminiz iptal edildi"); } return("BolumAdi Ayınısı var"); } return("Bolum Adini Boş Bırakmayınız"); } return("Seçim Yapmadınız"); } catch (Exception) { return("hata var"); } }
public ViewResult IndexBolum(Bolumler BolumlerModel) { Context.BolumListesi.Add(BolumlerModel); Context.SaveChanges(); return(View("Tesekkur", BolumlerModel)); }
private Bolumler aktifBolum; //aktif olan bolumu tanimliyor void Start() { aktifBolum = Bolumler.orman; //baslangicta orman bolumunden basliyor }