private void pictureBox4_Click(object sender, EventArgs e) { Otel yeni = new Otel(); yeni.Show(); this.Hide(); }
private void konaklamaToolStripMenuItem_Click(object sender, EventArgs e) { Otel otel = new Otel(); this.Hide(); otel.Show(); }
private void konaklamaToolStripMenuItem1_Click(object sender, EventArgs e) { Otel yeni = new Otel(); this.Hide(); yeni.Show(); }
public DataTable Yorumlar(int id) { Otel ot = m.Otel.Where(x => x.ID == id).FirstOrDefault(); ViewBag.otel = ot; int kid = Convert.ToInt32(Session["id"]); ViewBag.kullanıcı = m.Kullanıcı.Where(x => x.ID == kid).FirstOrDefault(); DataSet ds = new DataSet(); string constr = ConfigurationManager.ConnectionStrings["OtelModel1"].ConnectionString; var builder = new EntityConnectionStringBuilder(constr); constr = builder.ProviderConnectionString; using (SqlConnection con = new SqlConnection(constr)) { string com = "select oy.*,k.Ad as kAd,k.Soyad as kSoyad from (select * from OtelYorum where OtelID=" + id + ") as oy inner join Kullanıcı as k on oy.KullanıcıID=k.ID"; using (SqlCommand cmd = new SqlCommand(com)) { cmd.Connection = con; using (SqlDataAdapter sda = new SqlDataAdapter(cmd)) { sda.Fill(ds); } } } return(ds.Tables[0]); // return View("Yorumlar",ds); }
public ActionResult Create(Otel otel, HttpPostedFileBase otelResim) { int sess = Convert.ToInt32(Session["userID"]); if (ModelState.IsValid) { if (otelResim != null) { WebImage img = new WebImage(otelResim.InputStream); FileInfo fotoinfo = new FileInfo(otelResim.FileName); string newfoto = Guid.NewGuid().ToString() + fotoinfo.Extension; img.Resize(150, 150); img.Save("~/Uploads/OtelPhoto/" + newfoto); otel.otelResim = "/Uploads/OtelPhoto/" + newfoto; otel.userID = sess; otel.isDeleted = false; db.Otels.Add(otel); db.SaveChanges(); return(RedirectToAction("Index", "Otel")); } else { otel.userID = sess; otel.isDeleted = false; db.Otels.Add(otel); db.SaveChanges(); return(RedirectToAction("Index", "Otel")); } } return(View(otel)); }
public IActionResult CreateOtel(OtelModel model) { if (ModelState.IsValid) //validasyon işlemi başarılıysa { var entity = new Otel() { OtelAdı = model.OtelAdı, Fiyat = (double)model.Fiyat, OtelAdres = model.OtelAdres, ImageUrl = model.ImageUrl, CategoryID = model.CategoryID, OtelKategorisi = model.OtelKategorisi }; _otelService.Create(entity); //TempData["message"] = $"{entity.OtelAdı} isimli Otel eklendi."; var msg = new AlertMessage() { Message = $"{entity.OtelAdı} isimli Otel eklendi.", AlertType = "success" }; TempData["message"] = JsonConvert.SerializeObject(msg); //Json formatını kullanabilmek icin newtonsoft nuget arat. Projeye yükledim.Json kullanmadıgımda Tempdata'dan serileştirme hatası aldım. return(RedirectToAction("OtelList")); } return(View(model)); }
public ActionResult RezervasyonEkleForm(int id, int?kisi, string giris = "", string cıkıs = "") { if (giris == "" || cıkıs == "") { ViewBag.gt = ""; ViewBag.ct = ""; } else { DateTime a = Convert.ToDateTime(giris); giris = a.ToString("dd-MM-yyyy"); DateTime b = Convert.ToDateTime(cıkıs); cıkıs = b.ToString("dd-MM-yyyy"); ViewBag.gt = giris; ViewBag.ct = cıkıs; } Oda o = m.Oda.Where(x => x.ID == id).FirstOrDefault(); ViewBag.kisiSayı = kisi; ViewBag.oda = o; int oid = o.OtelID; Otel k = m.Otel.Where(x => x.ID == oid).FirstOrDefault(); ViewBag.oteladı = k.OtelAdı; return(View()); }
private void cbStatu_SelectedIndexChanged(object sender, EventArgs e) { Otel o = (Otel)cbStatu.SelectedItem; txtStatu.Text = o.StatuAd.ToString(); txtStatuID.Text = o.StatuID.ToString(); }
public void InsertNewOtel(OtelDto otel) { Otel otelBilgiler = new Otel() { Name = otel.Name, Description = otel.Description, Email = otel.Email, Restaurant = otel.Restaurant, Address = otel.Address, Bar = otel.Bar, Breakfast = otel.Breakfast, CarPark = otel.CarPark, Cover = otel.Cover, Gym = otel.Gym, Pool = otel.Pool, RoomService = otel.RoomService, Spa = otel.Spa, Star = otel.Star, Tel = otel.Tel, Status = otel.Status, Wifi = otel.Wifi }; using (BaseRepository <Otel> _repo = new BaseRepository <Otel>()) { _repo.Add(otelBilgiler); } }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Description,longitude,latitude,Stars,KurortId,MapLink,WebsiteLink")] Otel otel, string Longitude, string Latitude) { if (id != otel.Id) { return(NotFound()); } ParseCoords(otel, Longitude, Latitude); if (ModelState.IsValid) { try { _context.Update(otel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OtelExists(otel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["KurortId"] = new SelectList(_context.Kurorti, "Id", "Name", otel.KurortId); return(View(otel)); }
private Otel[] ile_gore(string il) { Otel[] otel = new Otel[0]; int hash1 = SifreOlustur(il) % Iller; int sayac = 0; int nulldeger = 0; for (int i = 0; i < Ilceler; i++) { if (table[hash1, i] == null) { continue; } else { LinkedHashEntry entry = table[hash1, i]; while (entry != null && entry.Anahtar1 == il) { nulldeger++; Array.Resize(ref otel, otel.Length + 1); otel[sayac++] = (Otel)entry.deger; entry = entry.Next; } } } if (nulldeger == 0) { return(null); } else { return(otel); } }
public Oda(Otel oteller, OdaTipi odaTipi, double ucret, string odaNo) { Oteller = oteller; OdaNo = odaNo; OdaTipi = odaTipi; BosMu = true; Ucret = ucret; }
private void YorumForm_Load(object sender, EventArgs e) { Otel otel = (Otel)label1.Tag; OtellerAgac agac = new OtellerAgac(); OtellerAgac.YorumTable.Rows.Clear(); agac.YorumGetir(otel, (int)data1.Tag); data1.DataSource = OtellerAgac.YorumTable; }
public YorumItem(Yorum currentYorum, Otel currentOtel) { InitializeComponent(); _currentYorum = currentYorum; LblYorumBasligi.Text = _currentYorum.YorumBasligi; lblYorumlar.Text = _currentYorum.YorumIcerigi; lblOtelAdi.Text = currentOtel.Adi; }
public ActionResult OtelGüncelleForm() { int yid = Convert.ToInt32(Session["yid"]); OtelYöneticisi o = m.OtelYöneticisi.Where(x => x.ID == yid).FirstOrDefault(); ViewBag.oy = o; Otel otel = m.Otel.Where(x => x.YöneticiID == yid).FirstOrDefault(); return(View(otel)); }
public ActionResult OtelGüncelle(Otel o) { Otel k = m.Otel.Where(x => x.ID == o.ID).FirstOrDefault(); k.OtelAdı = o.OtelAdı; k.OtelTürüID = o.OtelTürüID; k.YıldızSayısı = o.YıldızSayısı; m.SaveChanges(); return(RedirectToAction("OtelGüncelleForm", "OtelYöneticisi")); }
public void OtelSil(Otel otel) { if (otel == null) { throw new ArgumentNullException("otel"); } _otelDepo.Sil(otel); _önbellekYönetici.KalıpİleSil(OTEL_PATTERN_KEY); _olayYayınlayıcı.OlaySilindi(otel); }
public ActionResult OtelGüncelleForm(int otelID) { Otel otel = m.Otel.Where(x => x.ID == otelID).FirstOrDefault(); int? yid = otel.YöneticiID; OtelYöneticisi y = m.OtelYöneticisi.Where(x => x.ID == yid).FirstOrDefault(); ViewBag.yonetici = y; ViewBag.otel = otel; return(View()); }
public ActionResult Fotolar() { int id = Convert.ToInt32(Session["yid"]); Otel o = m.Otel.Where(x => x.YöneticiID == id).FirstOrDefault(); int oid = o.ID; ViewBag.otel = o; List <OtelFoto> list = m.OtelFoto.Where(x => x.OtelID == oid).ToList(); return(View(list)); }
private void Form1_Load(object sender, EventArgs e) { dateTimePickerBas.Value = DateTime.Now; dateTimePickerBit.Value = DateTime.Now.AddDays(1); // Yatak Tipi Atama comboBoxYatakTipi.DataSource = Enum.GetValues(typeof(YatakTipi)); // Otel Oluşturma otel = new Otel("Gedik Otel", "Seferihisar İzmir", OtelTipi.Otel); labelOtelAdi.Text = otel.Adi; }
public FrmYorumlar(Otel otel) { InitializeComponent(); _currentOtel = otel; lblOtelAdiYorumlar.Text = _currentOtel.Adi; foreach (Yorum item in otel.Yorumlar) { YorumItem yorumlar = new YorumItem(item, otel); flpYorumlar.Controls.Add(yorumlar); } }
private void Oteller_Load(object sender, EventArgs e) { int id = 0; Rezerv r = new Rezerv(); int kontrol = r.RezervleriKontrolEt(); if (kontrol > 0) { id = r.RezDurumuGuncelle(); r.idBul(id, txtoid.Text, txttid.Text); r.odasayisiniguncelle(txtoid, txttid); } Otel o = new Otel(); o.SehirAd = Genel.UlkeAdiOtel; o.GirisTarihi = Genel.GirisTarihi; o.CikisTarihi = Genel.CikisTarihi; o.OdaTipi = Genel.OdaTipi; ds = o.OtelleriGetir(o); dgvOteller.DataSource = ds.Tables["Oteller"]; ((DataGridViewImageColumn)dgvOteller.Columns[0]).ImageLayout = DataGridViewImageCellLayout.Stretch; dgvOteller.Columns[1].Visible = false; dgvOteller.Columns[7].Visible = false; dgvOteller.Columns[8].Visible = false; dgvOteller.Columns[9].Visible = false; dgvOteller.Columns[2].Width = 120; dgvOteller.Columns[3].Width = 90; dgvOteller.Columns[4].Width = 90; dgvOteller.Columns[5].Width = 90; dgvOteller.Columns[2].HeaderText = "Oteller"; dgvOteller.Columns[3].HeaderText = "Dereceler"; dgvOteller.Columns[4].HeaderText = "Statu"; dgvOteller.Columns[5].HeaderText = "Oda Tipi"; dtpBaslangic.Value = Convert.ToDateTime(Genel.GirisTarihi); dtpBitis.Value = Convert.ToDateTime(Genel.CikisTarihi); TimeSpan ts = dtpBitis.Value - dtpBaslangic.Value; lblGece.Text = ts.TotalDays.ToString(); lblGun.Text = (ts.TotalDays - 1).ToString(); cbAdet.SelectedItem = "1"; txtFiyat.Text = "0"; for (DateTime i = Convert.ToDateTime(Genel.GirisTarihi); i <= Convert.ToDateTime(Genel.CikisTarihi); i = i.AddDays(1.0)) { string gun = i.ToShortDateString(); Gunler.Add(gun); } }
public IActionResult Guncelle(Otel otel) { try { _otelService.Update(otel); return(Ok()); } catch (Exception) { return(BadRequest(otel)); } }
public IActionResult Ekle(Otel otel) { try { _otelService.Add(otel); return(Ok()); } catch (Exception) { return(BadRequest(otel)); } }
private void ParseCoords(Otel otel, string longitude, string latitude) { double converted; if (Double.TryParse(longitude, out converted)) { otel.Longitude = converted; } if (Double.TryParse(latitude, out converted)) { otel.Latitude = converted; } }
public JsonResult DeleteOtelRecord(int otelID) { bool result = false; Otel otl = db.Otels.SingleOrDefault(x => x.otelID == otelID); if (otl != null) { otl.isDeleted = true; db.SaveChanges(); result = true; } return(Json(result, JsonRequestBehavior.AllowGet)); }
public async Task <IActionResult> Create([Bind("Id,Name,Description,Stars,KurortId,MapLink,WebsiteLink")] Otel otel, string Longitude, string Latitude) { ParseCoords(otel, Longitude, Latitude); if (ModelState.IsValid) { _context.Add(otel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["KurortId"] = new SelectList(_context.Kurorti, "Id", "Name", otel.KurortId); return(View(otel)); }
public ActionResult OdaEkle(Oda o) { int yid = Convert.ToInt32(Session["yid"]); Otel ot = m.Otel.Where(x => x.YöneticiID == yid).FirstOrDefault(); ot.OdaSayısı++; o.OtelID = ot.ID; m.Oda.Add(o); m.SaveChanges(); //string b = Url.Action("OtelGüncelleForm", "OtelYöneticisi", new { id = ot.ID }); return(RedirectToAction("Odalar", "OtelYöneticisi")); }
public IActionResult Details(int?id) { if (id == null) { return(NotFound()); } Otel otel = _otelService.GetOtelDetails((int)id); if (otel == null) { return(NotFound()); } return(View(new OtelDetailModel { Otel = otel, CategoryOtel = otel.CategoryOtel })); }
public ActionResult Index() { /* * int id = Convert.ToInt32(Session["yid"]); * List<Oda> list = m.Database.SqlQuery<Oda>("select * from Oda where otelID in (select ID from Otel where YöneticiID=@yid )", new SqlParameter("yid", id)).ToList(); * * Otel ot = m.Otel.Where(x => x.YöneticiID == id).FirstOrDefault(); * int otelid = ot.ID; * ot.OdaSayısı = m.Oda.Where(x => x.OtelID == otelid).ToList().Count(); * ViewBag.otel = ot; * m.SaveChanges(); */ int yid = Convert.ToInt32(Session["yid"]); Otel otel = m.Otel.Where(x => x.YöneticiID == yid).FirstOrDefault(); ViewBag.otel = otel; return(View()); }