示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
 public ActionResult Edit([Bind(Include = "ProjectID,Thumbnail,ProjectName,Description,GitHubLink,Feature")] Project project)
 {
     if (ModelState.IsValid)
     {
         db.Entry(project).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(project));
 }
 public ActionResult Edit([Bind(Include = "ProjectID,Name,Description,GitLink,HardDrivePath,VideoLink")] Project project)
 {
     if (ModelState.IsValid)
     {
         db.Entry(project).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(project));
 }
示例#5
0
 public ActionResult Edit([Bind(Include = "ProjectID,ProjectTitle,ProjectDescription,LanguagesUsed,ProjectImageURL,ProjectLink,GitHubLink")] Project project)
 {
     if (ModelState.IsValid)
     {
         db.Entry(project).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(project));
 }
示例#6
0
 public ActionResult Edit([Bind(Include = "ScreenshotID,ProjectID,Name,ImagePath")] Screenshot screenshot)
 {
     if (ModelState.IsValid)
     {
         db.Entry(screenshot).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ProjectID = new SelectList(db.Projects, "ProjectID", "Name", screenshot.ProjectID);
     return(View(screenshot));
 }
示例#7
0
 public ActionResult Edit([Bind(Include = "FeatureID,ProjectID,Name")] Feature feature)
 {
     if (ModelState.IsValid)
     {
         db.Entry(feature).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ProjectID = new SelectList(db.Projects, "ProjectID", "Name", feature.ProjectID);
     return(View(feature));
 }