public ActionResult Create([Bind(Include = "ProjectID,Thumbnail,ProjectName,Description,GitHubLink,Feature")] Project project) { if (ModelState.IsValid) { db.Projects.Add(project); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(project)); }
public ActionResult Create([Bind(Include = "ProjectID,Name,Description,GitLink,HardDrivePath,VideoLink")] Project project) { if (ModelState.IsValid) { db.Projects.Add(project); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(project)); }
public ActionResult Create([Bind(Include = "ProjectID,ProjectTitle,ProjectDescription,LanguagesUsed,ProjectImageURL,ProjectLink,GitHubLink")] Project project) { if (ModelState.IsValid) { db.Projects.Add(project); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(project)); }
public ActionResult Create([Bind(Include = "ScreenshotID,ProjectID,Name,ImagePath")] Screenshot screenshot) { if (ModelState.IsValid) { db.Screenshots.Add(screenshot); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ProjectID = new SelectList(db.Projects, "ProjectID", "Name", screenshot.ProjectID); return(View(screenshot)); }
public ActionResult Create([Bind(Include = "FeatureID,ProjectID,Name")] Feature feature) { if (ModelState.IsValid) { db.Features.Add(feature); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ProjectID = new SelectList(db.Projects, "ProjectID", "Name", feature.ProjectID); return(View(feature)); }
public static bool SaveAboutus(tbl_AboutUs _AboutUs) { bool _result = true; using (PortfolioDBEntities db = new PortfolioDBEntities()) { try { if (_AboutUs.AboutUs_id == 0) { db.tbl_AboutUs.Add(_AboutUs); } else { db.tbl_AboutUs.Attach(_AboutUs); db.Entry(_AboutUs).State = System.Data.Entity.EntityState.Modified; } db.SaveChanges(); } catch (Exception) { _result = false; } } return(_result); }
public static bool SaveExperienceDetail(tbl_Experiences _Experience) { bool _result = true; using (PortfolioDBEntities db = new PortfolioDBEntities()) { try { if (_Experience.Experience_id == 0) { _Experience.User_id = 1; db.tbl_Experiences.Add(_Experience); } else { db.tbl_Experiences.Attach(_Experience); db.Entry(_Experience).State = System.Data.Entity.EntityState.Modified; } db.SaveChanges(); } catch (Exception) { _result = true; } } return(_result); }