Esempio n. 1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            buses_type buses_type = await db.buses_type.FindAsync(id);

            db.buses_type.Remove(buses_type);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
        public async Task <ActionResult> Edit([Bind(Include = "bus_type_id,name")] buses_type buses_type)
        {
            if (ModelState.IsValid)
            {
                db.Entry(buses_type).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(buses_type));
        }
Esempio n. 3
0
        public async Task <ActionResult> Create([Bind(Include = "bus_type_id,name")] buses_type buses_type)
        {
            if (ModelState.IsValid)
            {
                db.buses_type.Add(buses_type);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(buses_type));
        }
Esempio n. 4
0
        // GET: buses_type/Edit/5
        /// <summary>
        /// Editing Details of Bus types based on Unique ID
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            buses_type buses_type = await db.buses_type.FindAsync(id);

            if (buses_type == null)
            {
                return(HttpNotFound());
            }
            return(View(buses_type));
        }
Esempio n. 5
0
        // GET: buses_type/Details/5
        /// <summary>
        /// Fectching Details of Bus types based on Unique ID
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            buses_type buses_type = await db.buses_type.FindAsync(id);

            //Validating for Null buses_type
            if (buses_type == null)
            {
                return(HttpNotFound());
            }
            return(View(buses_type));
        }