Пример #1
0
 public void DeleteRoom(OdaDto oda)
 {
     using (BaseRepository <Room> _repo = new BaseRepository <Room>())
     {
         var bilgiler = _repo.Query <Room>().FirstOrDefault(x => x.Id == oda.Id);
         _repo.Delete(bilgiler);
     }
 }
Пример #2
0
        public ActionResult Sil(int Id)
        {
            OdaDto oda = new OdaDto();

            oda.Id = Id;
            Services.OtelService.DeleteRoom(oda);

            return(Redirect("/Otel/Index"));
        }
Пример #3
0
        public ActionResult OdaEkle(OdaDto oda)
        {
            var otelID = Convert.ToInt32(Session["OtelId"]);

            oda.OtelId = otelID;
            Services.OtelService.InsertNewRoom(oda);

            return(Redirect("/Otel/Index"));
        }
Пример #4
0
        public void InsertNewRoom(OdaDto Oda)
        {
            Room otelBilgiler = new Room()
            {
                Name        = Oda.Name,
                Price       = Oda.Price,
                PersonCount = Oda.PersonCount,
                Tel         = Oda.Tel,
                TV          = Oda.TV,
                Clima       = Oda.Clima,
                MiniBar     = Oda.MiniBar,
                Jakuzi      = Oda.Jakuzi,
                Balcony     = Oda.Balcony,
                Bathroom    = Oda.Bathroom,
                Dryer       = Oda.Dryer,
                OtelId      = Oda.OtelId,
                Cover       = Oda.Cover
            };

            using (BaseRepository <Room> _repo = new BaseRepository <Room>())
            {
                _repo.Add(otelBilgiler);
            }
        }