コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            town town = db.towns.Find(id);

            db.towns.Remove(town);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
            public bool isNeighbour(town fromTown, town toTown)
            {
                path outPath;

                if (paths.TryGetValue(new pathParam(fromTown, toTown), out outPath))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
コード例 #3
0
        // GET: Admin/towns/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            town town = db.towns.Find(id);

            if (town == null)
            {
                return(HttpNotFound());
            }
            return(View(town));
        }
コード例 #4
0
        // GET: towns/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            town town = db.towns.Find(id);

            if (town == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ZoneId = new SelectList(db.zones, "ZoneID", "ZoneName");
            return(View(town));
        }
コード例 #5
0
        public ActionResult Create([Bind(Include = "TownID,TownName,AccountStatusID,ZoneId")] town town)
        {
            if (ModelState.IsValid)
            {
                using (db = new AdminEntities())
                {
                    town.AccountStatusID = 1;
                    db.towns.Add(town);
                    db.SaveChanges();
                }

                return(RedirectToAction("Index"));
            }
            ViewBag.ZoneId = new SelectList(db.zones, "ZoneID", "ZoneName", town.ZoneId);
            return(View(town));
        }
コード例 #6
0
ファイル: Person.cs プロジェクト: alex687/SoftUni-Homeworks
 public Person(string email, string name, int age, town)
 {
     
 }
コード例 #7
0
 public pathParam(town fromTown, town toTown)
 {
     this.fromTown = fromTown;
     this.toTown   = toTown;
 }