示例#1
0
        public void InsertTest()
        {
            PersonalProject project = new PersonalProject();

            project.Name             = "Test Project";
            project.Languages        = "Test Languages";
            project.Description      = "Test Description";
            project.GitHubRepository = "Test GitHub Repo";
            project.Demonstration    = "Test Demo";
            project.Insert();
            project.LoadById();
            Assert.AreEqual("Test Demo", project.Demonstration);
        }
示例#2
0
 public ActionResult Create(PersonalProject project)
 {
     if (Session["user"] != null)
     {
         try
         {
             project.Insert();
             return(RedirectToAction("Index"));
         }
         catch
         {
             return(View(project));
         }
     }
     else
     {
         return(RedirectToAction("Login", "Login"));
     }
 }