public ActionResult Create(ReferenceKeyword referencekeyword)
        {
            if (!Authorization.GetAccess(table, HttpContext.User.Identity.Name, write))
                return RedirectToAction("Index", "Home");

            if (ModelState.IsValid)
            {
                referencekeyword.ReferenceKeywordID = Guid.NewGuid();
                referencekeyword.CreatedBy = Guid.Parse(Session["userid"].ToString());
                referencekeyword.CreatedOn = DateTime.Now;
                db.ReferenceKeywords.AddObject(referencekeyword);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.KeywordID = new SelectList(db.Keywords, "ID", "Keyword1", referencekeyword.KeywordID);
            ViewBag.ReferenceID = new SelectList(db.References, "ID", "Authors", referencekeyword.ReferenceID);
            ViewBag.CreatedBy = new SelectList(db.Users, "ID", "UserName", referencekeyword.CreatedBy);
            ViewBag.ModifiedBy = new SelectList(db.Users, "ID", "UserName", referencekeyword.ModifiedBy);
            return View(referencekeyword);
        }
Esempio n. 2
0
 /// <summary>
 /// Create a new ReferenceKeyword object.
 /// </summary>
 /// <param name="referenceKeywordID">Initial value of the ReferenceKeywordID property.</param>
 /// <param name="referenceID">Initial value of the ReferenceID property.</param>
 /// <param name="keywordID">Initial value of the KeywordID property.</param>
 public static ReferenceKeyword CreateReferenceKeyword(global::System.Guid referenceKeywordID, global::System.Guid referenceID, global::System.Guid keywordID)
 {
     ReferenceKeyword referenceKeyword = new ReferenceKeyword();
     referenceKeyword.ReferenceKeywordID = referenceKeywordID;
     referenceKeyword.ReferenceID = referenceID;
     referenceKeyword.KeywordID = keywordID;
     return referenceKeyword;
 }
Esempio n. 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the ReferenceKeywords EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToReferenceKeywords(ReferenceKeyword referenceKeyword)
 {
     base.AddObject("ReferenceKeywords", referenceKeyword);
 }