Ejemplo n.º 1
0
        private void pictureBox4_Click(object sender, EventArgs e)
        {
            Otel yeni = new Otel();

            yeni.Show();
            this.Hide();
        }
Ejemplo n.º 2
0
        private void konaklamaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Otel otel = new Otel();

            this.Hide();
            otel.Show();
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 5
0
        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));
        }
Ejemplo n.º 6
0
        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));
        }
Ejemplo n.º 7
0
        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());
        }
Ejemplo n.º 8
0
        private void cbStatu_SelectedIndexChanged(object sender, EventArgs e)
        {
            Otel o = (Otel)cbStatu.SelectedItem;

            txtStatu.Text   = o.StatuAd.ToString();
            txtStatuID.Text = o.StatuID.ToString();
        }
Ejemplo n.º 9
0
        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);
            }
        }
Ejemplo n.º 10
0
        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);
            }
        }
Ejemplo n.º 12
0
 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;
        }
Ejemplo n.º 14
0
        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"));
        }
Ejemplo n.º 17
0
        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));
        }
Ejemplo n.º 20
0
        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;
        }
Ejemplo n.º 21
0
        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);
            }
        }
Ejemplo n.º 22
0
        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);
            }
        }
Ejemplo n.º 23
0
 public IActionResult Guncelle(Otel otel)
 {
     try
     {
         _otelService.Update(otel);
         return(Ok());
     }
     catch (Exception)
     {
         return(BadRequest(otel));
     }
 }
Ejemplo n.º 24
0
 public IActionResult Ekle(Otel otel)
 {
     try
     {
         _otelService.Add(otel);
         return(Ok());
     }
     catch (Exception)
     {
         return(BadRequest(otel));
     }
 }
Ejemplo n.º 25
0
        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;
            }
        }
Ejemplo n.º 26
0
        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));
        }
Ejemplo n.º 27
0
        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"));
        }
Ejemplo n.º 29
0
        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());
        }