Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            LocationServiceCategory locationservicecategory = db.LocationServiceCategory.Find(id);

            db.LocationServiceCategory.Remove(locationservicecategory);
            db.SaveChanges();
            return(RedirectToAction("Index", new { id = locationservicecategory.LocationId }));
        }
Esempio n. 2
0
        public ActionResult Create(int id, LocationServiceCategory locationservicecategory)
        {
            if (ModelState.IsValid)
            {
                locationservicecategory.LocationId = id;
                db.LocationServiceCategory.Add(locationservicecategory);
                db.SaveChanges();
                return(RedirectToAction("Index", new { id = id }));
            }

            ViewBag.LocationId        = id;
            ViewBag.ServiceCategoryId = new SelectList(db.ServiceCategory, "ServiceCategoryId", "ServiceCategoryName", locationservicecategory.ServiceCategoryId);
            return(View(locationservicecategory));
        }
Esempio n. 3
0
        ////
        //// GET: /Admin/ServiceCategory/Edit/5

        //public ActionResult Edit(int id)
        //{
        //    LocationServiceCategory locationservicecategory = db.LocationServiceCategories.Find(id);
        //    ViewBag.LocationId = new SelectList(db.Location, "LocationId", "LocationName", locationservicecategory.LocationId);
        //    ViewBag.ServiceCategoryId = new SelectList(db.ServiceCategory, "ServiceCategoryId", "ServiceCategoryName", locationservicecategory.ServiceCategoryId);
        //    return View(locationservicecategory);
        //}

        ////
        //// POST: /Admin/ServiceCategory/Edit/5

        //[HttpPost]
        //public ActionResult Edit(LocationServiceCategory locationservicecategory)
        //{
        //    if (ModelState.IsValid)
        //    {
        //        db.Entry(locationservicecategory).State = EntityState.Modified;
        //        db.SaveChanges();
        //        return RedirectToAction("Index");
        //    }
        //    ViewBag.LocationId = new SelectList(db.Location, "LocationId", "LocationName", locationservicecategory.LocationId);
        //    ViewBag.ServiceCategoryId = new SelectList(db.ServiceCategory, "ServiceCategoryId", "ServiceCategoryName", locationservicecategory.ServiceCategoryId);
        //    return View(locationservicecategory);
        //}

        //
        // GET: /Admin/ServiceCategory/Delete/5

        public ActionResult Delete(int id)
        {
            LocationServiceCategory locationservicecategory = db.LocationServiceCategory.Find(id);

            return(View(locationservicecategory));
        }