public ActionResult Create(CitationType citationtype) { if (!Authorization.GetAccess(table, HttpContext.User.Identity.Name, write)) return RedirectToAction("Index", "Home"); if (ModelState.IsValid) { citationtype.ID = Guid.NewGuid(); citationtype.CreatedBy = Guid.Parse(Session["userid"].ToString()); citationtype.CreatedOn = DateTime.Now; db.CitationTypes.AddObject(citationtype); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.CreatedBy = new SelectList(db.Users, "ID", "UserName", citationtype.CreatedBy); ViewBag.ModifiedBy = new SelectList(db.Users, "ID", "UserName", citationtype.ModifiedBy); return View(citationtype); }
/// <summary> /// Deprecated Method for adding a new object to the CitationTypes EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToCitationTypes(CitationType citationType) { base.AddObject("CitationTypes", citationType); }
/// <summary> /// Create a new CitationType object. /// </summary> /// <param name="id">Initial value of the ID property.</param> /// <param name="citationType1">Initial value of the CitationType1 property.</param> public static CitationType CreateCitationType(global::System.Guid id, global::System.String citationType1) { CitationType citationType = new CitationType(); citationType.ID = id; citationType.CitationType1 = citationType1; return citationType; }