示例#1
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            RecognizeMe recognizeMe = db.RecognizeMes.Find(id);

            db.RecognizeMes.Remove(recognizeMe);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "ID,firstName,lastName,bussinessUnit,description,award")] RecognizeMe recognizeMe)
 {
     if (ModelState.IsValid)
     {
         db.Entry(recognizeMe).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(recognizeMe));
 }
示例#3
0
        public ActionResult Create([Bind(Include = "ID,firstName,lastName,bussinessUnit,description,coreValue")] RecognizeMe recognizeMe)
        {
            if (ModelState.IsValid)
            {
                recognizeMe.ID = Guid.NewGuid();
                db.RecognizeMes.Add(recognizeMe);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(recognizeMe));
        }
        public ActionResult Create([Bind(Include = "recognitionID,ID,bussinessUnit,description,CoreValue,CurrentDateTime")] RecognizeMe recognizeMe)
        {
            if (ModelState.IsValid)
            {
                recognizeMe.CurrentDateTime = DateTime.Now;
                db.RecognizeMes.Add(recognizeMe);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ID = new SelectList(db.AccountDetails, "ID", "fullName", recognizeMe.ID);
            return(View(recognizeMe));
        }
示例#5
0
        // GET: RecognizeMe3/Delete/5
        public ActionResult Delete(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            RecognizeMe recognizeMe = db.RecognizeMes.Find(id);

            if (recognizeMe == null)
            {
                return(HttpNotFound());
            }
            return(View(recognizeMe));
        }
        public ActionResult Edit([Bind(Include = "recognitionID,ID,bussinessUnit,description,CoreValue,CurrentDateTime")] RecognizeMe recognizeMe)
        {
            // if (ModelState.IsValid)
            {
                Guid rID;
                Guid.TryParse(TempData["user"].ToString(), out rID);

                recognizeMe.ID = rID;
                db.Entry(recognizeMe).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.ID = new SelectList(db.AccountDetails, "ID", "fullName", recognizeMe.ID);
            return(View(recognizeMe));
        }
        // GET: RecognizeMes/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            RecognizeMe recognizeMe = db.RecognizeMes.Find(id);

            TempData["user"] = recognizeMe.ID;
            if (recognizeMe == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ID = new SelectList(db.AccountDetails, "ID", "fullName", recognizeMe.ID);
            return(View(recognizeMe));
        }