コード例 #1
0
        public ActionResult GezilecekYerEkle(VisitingPlaces visitingPlaces)
        {
            _db.VisitingPlaces.Add(visitingPlaces);

            try
            {
                int result = _db.SaveChanges();
                //result içinde etkilenen satır sayısı tutulur

                if (result > 0)
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    throw new Exception();
                }
            }
            catch (Exception)
            {
                ViewBag.IsSuccess = false;
                return(View());
            }
        }
コード例 #2
0
 public void Update(VisitingPlaces entity)
 {
     _visitingplacesDAL.Update(entity);
 }
コード例 #3
0
 public void Insert(VisitingPlaces entity)
 {
     _visitingplacesDAL.Add(entity);
 }
コード例 #4
0
 public void Delete(VisitingPlaces entity)
 {
     _visitingplacesDAL.Remove(entity);
 }