コード例 #1
0
 public DetailHotel(DetailHotelParam _detailhotel)
 {
     this.Hotels     = _detailhotel.Hotels;
     this.Districts  = _detailhotel.Districts;
     this.Address    = _detailhotel.Address;
     this.CreateDate = DateTimeOffset.Now.LocalDateTime;
     this.CreateBy   = "";//isi
 }
コード例 #2
0
 public ActionResult Create(DetailHotelParam _detailhotelparam)
 {
     if (ModelState.IsValid)
     {
         _idetailhotelservice.Insert(_detailhotelparam);
         return(RedirectToAction("Index"));
     }
     return(View(_detailhotelparam));
 }
コード例 #3
0
 public virtual void Update(DetailHotelParam _detailhotel)
 {
     this.Id         = _detailhotel.Id;
     this.Hotels     = _detailhotel.Hotels;
     this.Districts  = _detailhotel.Districts;
     this.Address    = _detailhotel.Address;
     this.UpdateDate = DateTimeOffset.Now.LocalDateTime;
     this.UpdateBy   = "";//isi
 }
コード例 #4
0
        public bool Insert(DetailHotelParam _detailhotelparam)
        {
            var push = new DetailHotel(_detailhotelparam);

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

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

            throw new NotImplementedException();
        }
コード例 #5
0
        public bool Update(DetailHotelParam _detailhotelparam)
        {
            var getDetailHotel = Get(_detailhotelparam.Id);

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

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

            throw new NotImplementedException();
        }
コード例 #6
0
 public ActionResult Edit(DetailHotelParam _detailhotelparam)
 {
     _idetailhotelservice.Update(_detailhotelparam);
     return(RedirectToAction("Index"));
 }
コード例 #7
0
        //GET
        public ActionResult Edit(int?id)
        {
            DetailHotelParam _detailhotelparam = new DetailHotelParam(_idetailhotelservice.Get(id));

            return(View(_detailhotelparam));
        }
コード例 #8
0
        public bool Update(DetailHotelParam _detailhotelparam)
        {
            return(_idetailhotelrepository.Update(_detailhotelparam));

            throw new NotImplementedException();
        }