public ActionResult DeleteConfirmed(int id)
        {
            DreamText dreamText = db.DreamTexts.Find(id);

            db.DreamTexts.Remove(dreamText);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public override void Awake()
 {
     base.Awake();
     r_sleepingAndWaking = player.GetComponent <SleepingAndWaking>();
     r_dreamController   = GameObject.Find("MainController").GetComponent <DreamController>();
     r_cellManager       = GameObject.Find("CellManager").GetComponent <CellManager>();
     r_rotate            = GetComponent <Rotate>();
     r_dreamText         = GameObject.Find("Dream Canvas").GetComponent <DreamText>();
 }
 public ActionResult Edit([Bind(Include = "Id,Summary,Lucid,NScenes,NDirectPeople,NBackgroundPeople,NKnownPeople,NFantasyCharacters,NArchitypicalCharacters,NFalseAwakenings,Fly,Run,TFly,TRun,Control,Relate,Real,Yourself,Colorful,RecogniseSurroundings,PastMemories,Emotion,Conflict,Resolution,RelatedConflict,Prophetic,Spiritual,Rating,Insight,Length,DetailedText")] DreamText dreamText)
 {
     if (ModelState.IsValid)
     {
         dreamText.AspId           = User.Identity.GetUserId();
         dreamText.Date            = DateTime.Now;
         db.Entry(dreamText).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(dreamText));
 }
 void Awake()
 {
     player             = GameObject.Find("Player");
     _sleepingAndWaking = player.GetComponent <SleepingAndWaking>();
     _needs             = player.GetComponent <Needs>();
     _FPSController     = player.GetComponent <FirstPersonController>();
     _dreamText         = GameObject.Find("Dream Canvas").GetComponent <DreamText>();
     _dayManager        = GetComponent <DayManager>();
     m_CamBackground    = Camera.main.gameObject.GetComponent <CamBackgroundColor>();
     r_sleepScript      = GameObject.Find("Player").GetComponent <SleepingAndWaking>();
     LoadScene(Scenes.Cell);
 }
        // GET: Dream/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DreamText dreamText = db.DreamTexts.Find(id);

            if (dreamText == null)
            {
                return(HttpNotFound());
            }
            return(View(dreamText));
        }