public ActionResult DeleteConfirmed(int id)
        {
            DrawingsType drawingsType = db.drawingTypes.Find(id);

            db.drawingTypes.Remove(drawingsType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ObjectDatabase(string champ, string name, float time, DrawingsType drawingsType = DrawingsType.Circle, System.Drawing.Color color = default(System.Drawing.Color))
 {
     Name     = name;
     Champ    = champ;
     Time     = time;
     Enabled  = false;
     DrawType = drawingsType;
     Color    = color == default(System.Drawing.Color) ? System.Drawing.Color.White : color;
 }
 public ActionResult Edit([Bind(Include = "DrawingTypeId,Name")] DrawingsType drawingsType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(drawingsType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(drawingsType));
 }
        public ActionResult Create([Bind(Include = "DrawingTypeId,Name")] DrawingsType drawingsType)
        {
            if (ModelState.IsValid)
            {
                db.drawingTypes.Add(drawingsType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(drawingsType));
        }
        // GET: Admin/DrawingsTypes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DrawingsType drawingsType = db.drawingTypes.Find(id);

            if (drawingsType == null)
            {
                return(HttpNotFound());
            }
            return(View(drawingsType));
        }
Ejemplo n.º 6
0
 public ObjectDatabase(string champ, string name, float time, DrawingsType drawingsType = DrawingsType.Circle, System.Drawing.Color color = default(System.Drawing.Color))
 {
     Name = name;
     Champ = champ;
     Time = time;
     Enabled = false;
     DrawType = drawingsType;
     Color = color == default(System.Drawing.Color) ? System.Drawing.Color.White : color;
 }