Example #1
0
        public ActionResult Create(SiteConfig siteconfig)
        {
            if (ModelState.IsValid)
            {
                db.SiteConfigs.AddObject(siteconfig);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.SiteStartCatID = new SelectList(db.Categories, "CatID", "CatName", siteconfig.SiteStartCatID);
            return View(siteconfig);
        }
Example #2
0
 public ActionResult Edit(SiteConfig siteconfig)
 {
     if (ModelState.IsValid)
     {
         db.SiteConfigs.Attach(siteconfig);
         db.ObjectStateManager.ChangeObjectState(siteconfig, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.SiteStartCatID = new SelectList(db.Categories, "CatID", "CatName", siteconfig.SiteStartCatID);
     return View(siteconfig);
 }
Example #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the SiteConfigs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToSiteConfigs(SiteConfig siteConfig)
 {
     base.AddObject("SiteConfigs", siteConfig);
 }
Example #4
0
 /// <summary>
 /// Create a new SiteConfig object.
 /// </summary>
 /// <param name="siteConfigID">Initial value of the SiteConfigID property.</param>
 public static SiteConfig CreateSiteConfig(global::System.Int64 siteConfigID)
 {
     SiteConfig siteConfig = new SiteConfig();
     siteConfig.SiteConfigID = siteConfigID;
     return siteConfig;
 }