コード例 #1
0
 public Hotel(HotelParam _hotel)
 {
     this.Name       = _hotel.Name;
     this.Star       = _hotel.Star;
     this.CreateDate = DateTimeOffset.Now.LocalDateTime;
     this.CreateBy   = "";//isi
 }
コード例 #2
0
 public virtual void Update(HotelParam _hotel)
 {
     this.Id         = _hotel.Id;
     this.Name       = _hotel.Name;
     this.Star       = _hotel.Star;
     this.UpdateDate = DateTimeOffset.Now.LocalDateTime;
     this.UpdateBy   = "";//isi
 }
コード例 #3
0
 public ActionResult Create(HotelParam _hotelparam)
 {
     if (ModelState.IsValid)
     {
         _ihotelservice.Insert(_hotelparam);
         return(RedirectToAction("Index"));
     }
     return(View(_hotelparam));
 }
コード例 #4
0
        public bool Insert(HotelParam _hotelparam)
        {
            var push = new Hotel(_hotelparam);

            context.Hotels.Add(push);
            var result = context.SaveChanges();

            if (result > 0)
            {
                status = true;
            }
            return(status);

            throw new NotImplementedException();
        }
コード例 #5
0
        public bool Update(HotelParam _hotelparam)
        {
            var getHotel = Get(_hotelparam.Id);

            getHotel.Update(_hotelparam);
            context.Entry(getHotel).State = System.Data.Entity.EntityState.Modified;
            var result = context.SaveChanges();

            if (result > 0)
            {
                status = true;
            }
            return(status);

            throw new NotImplementedException();
        }
コード例 #6
0
        public bool Update(HotelParam _hotelparam)
        {
            return(_ihotelrepository.Update(_hotelparam));

            throw new NotImplementedException();
        }
コード例 #7
0
        public bool Insert(HotelParam _hotelparam)
        {
            return(_ihotelrepository.Insert(_hotelparam));

            throw new NotImplementedException();
        }
コード例 #8
0
 public ActionResult Edit(HotelParam _hotelparam)
 {
     _ihotelservice.Update(_hotelparam);
     return(RedirectToAction("Index"));
 }
コード例 #9
0
        //GET
        public ActionResult Edit(int?id)
        {
            HotelParam _hotelparam = new HotelParam(_ihotelservice.Get(id));

            return(View(_hotelparam));
        }