Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "PostID,PostText,FK_UserID,TopicName,Topic")] Post post)
 {
     if (ModelState.IsValid)
     {
         db.Entry(post).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.FK_UserID = new SelectList(db.myUsers, "UserID", "Name", post.FK_UserID);
     ViewBag.Topic     = new SelectList(db.Topics, "TopicID", "TopicName", post.Topic);
     return(View(post));
 }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "ResponseID,RespronsText,FK_CoachID,FK_ResponseID,FK_PostID,Topic")] Response response)
 {
     if (ModelState.IsValid)
     {
         db.Entry(response).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.FK_CoachID    = new SelectList(db.Coaches, "CoachID", "Name", response.FK_CoachID);
     ViewBag.FK_PostID     = new SelectList(db.Posts, "PostID", "PostText", response.FK_PostID);
     ViewBag.FK_ResponseID = new SelectList(db.Responses, "ResponseID", "RespronsText", response.FK_ResponseID);
     ViewBag.Topic         = new SelectList(db.Topics, "TopicID", "TopicName", response.Topic);
     return(View(response));
 }
Ejemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "UserID,Name,Surname,Username,FK_TitleID,FK_GenderID,FK_RelationshipStatusIdn,FK_ActiveID,FK_CityID,LoginID")] myUser myUser)
 {
     if (ModelState.IsValid)
     {
         db.Entry(myUser).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.FK_ActiveID = new SelectList(db.Actives, "ActiveID", "ActiveDescription", myUser.FK_ActiveID);
     ViewBag.FK_CityID   = new SelectList(db.Cities, "Id", "Name", myUser.FK_CityID);
     ViewBag.FK_GenderID = new SelectList(db.Genders, "GenderID", "GenderDescription", myUser.FK_GenderID);
     ViewBag.FK_RelationshipStatusIdn = new SelectList(db.RelationshipStatus, "RelationshipStatusID", "RelationshipStatusDescription", myUser.FK_RelationshipStatusIdn);
     ViewBag.FK_TitleID = new SelectList(db.Titles, "TitleID", "Titledescription", myUser.FK_TitleID);
     ViewBag.LoginID    = new SelectList(db.userLogins, "UserLoginID", "Username", myUser.LoginID);
     return(View(myUser));
 }
Ejemplo n.º 4
0
 public ActionResult Edit([Bind(Include = "CoachID,Name,Surname,Username,FK_TitleID,FK_GenderID,FK_ActiveID,FK_CityID,LoginID,CoachExperience,University")] Coach coach)
 {
     if (ModelState.IsValid)
     {
         db.Entry(coach).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.FK_ActiveID     = new SelectList(db.Actives, "ActiveID", "ActiveDescription", coach.FK_ActiveID);
     ViewBag.FK_CityID       = new SelectList(db.Cities, "Id", "Name", coach.FK_CityID);
     ViewBag.CoachExperience = new SelectList(db.ExperienceLevels, "ExperienceID", "ExperienceDescription", coach.CoachExperience);
     ViewBag.FK_GenderID     = new SelectList(db.Genders, "GenderID", "GenderDescription", coach.FK_GenderID);
     ViewBag.FK_TitleID      = new SelectList(db.Titles, "TitleID", "Titledescription", coach.FK_TitleID);
     ViewBag.LoginID         = new SelectList(db.userLogins, "UserLoginID", "Username", coach.LoginID);
     ViewBag.University      = new SelectList(db.Universities, "UniversityID", "UniversityName", coach.University);
     return(View(coach));
 }