Example #1
0
        public ActionResult Edit([Bind(Include = "ID,Title,Details,PromotorID,PromotorName,IsTaken,IsAccepted,IsRejected,IsProposed,TakenByID, TypeOf")] Topics topics)
        {
            if (ModelState.IsValid)
            {
                db.Entry(topics).State = EntityState.Modified;
                topics.PromotorName    = LINQueries.GetNameByID(topics.PromotorID);
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }
            return(View(topics));
        }
Example #2
0
        public ActionResult StudentProposition([Bind(Include = "ID,Title,Details,PromotorID,PromotorName,IsTaken,IsAccepted,IsRejected,IsProposed, TakenByID, TypeOf")] Topics topics)
        {
            if (ModelState.IsValid)
            {
                db.Topics.Add(topics);
                topics.TakenBy      = User.Identity.Name.ToString();
                topics.TakenByID    = User.Identity.GetUserId().ToString();
                topics.IsProposed   = true;
                topics.PromotorName = LINQueries.GetNameByID(topics.PromotorID);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(topics));
        }