コード例 #1
0
        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);
        }
コード例 #2
0
 /// <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;
 }
コード例 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the LicenseTypes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToLicenseTypes(LicenseType licenseType)
 {
     base.AddObject("LicenseTypes", licenseType);
 }