Ejemplo n.º 1
0
 public ActionResult Edit(Presentation presentation)
 {
     if (ModelState.IsValid)
     {
         db.Presentation.Attach(presentation);
         db.ObjectStateManager.ChangeObjectState(presentation, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.UserId = new SelectList(db.User, "Id", "Name", presentation.UserId);
     return View(presentation);
 }
Ejemplo n.º 2
0
        public ActionResult Create(Presentation presentation)
        {
            if (ModelState.IsValid)
            {
                db.Presentation.AddObject(presentation);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.UserId = new SelectList(db.User, "Id", "Name", presentation.UserId);
            return View(presentation);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Create a new Presentation object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="userId">Initial value of the UserId property.</param>
 /// <param name="publishTime">Initial value of the PublishTime property.</param>
 /// <param name="link">Initial value of the Link property.</param>
 /// <param name="isActive">Initial value of the IsActive property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="mark">Initial value of the Mark property.</param>
 public static Presentation CreatePresentation(global::System.Int32 id, global::System.Int32 userId, global::System.DateTime publishTime, global::System.String link, global::System.Boolean isActive, global::System.String name, global::System.Int32 mark)
 {
     Presentation presentation = new Presentation();
     presentation.Id = id;
     presentation.UserId = userId;
     presentation.PublishTime = publishTime;
     presentation.Link = link;
     presentation.IsActive = isActive;
     presentation.Name = name;
     presentation.Mark = mark;
     return presentation;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Presentation EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPresentation(Presentation presentation)
 {
     base.AddObject("Presentation", presentation);
 }