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