Example #1
0
        private void fillProjects(User u)
        {
            VestnDB vestnDB = new VestnDB();
            Project project = new Project
            {
                name = "Test Project",
                description = "Test Description",
            };

            //Project Elements
            ProjectElement_Information informationElement;
            ProjectElement_Experience experienceElement;
            ProjectElement_Document documentElement;
            ProjectElement_Video videoElement;
            ProjectElement_Picture pictureElement;
            List<ProjectElement> projectElements;

            informationElement = new ProjectElement_Information
            {

                location = "Here",
                email = "*****@*****.**",
                school= "Univeristy of Nebraska- Lincoln",
                phone = "402-402-4111",
                major = "Actuarial Science",
                minor = "Business Administration",
                description = "tetetetetet"
            };
            documentElement = new ProjectElement_Document
            {
                description = "im a document",
                documentLocation = "asdfasdf"
            };
            experienceElement = new ProjectElement_Experience
            {
                jobTitle = "Owner",
                description = "I'm CEO Bitch.",
                startDate = new DateTime(1991, 6, 12),
                endDate = new DateTime(2011, 6, 12)
            };
            pictureElement = new ProjectElement_Picture
            {
                description = "im a picture",
                pictureLocation = "sadfsadfsa"
            };
            videoElement = new ProjectElement_Video
            {
                //put a test id you know in here haun
                videoId = "xxxxx",
                description = "asdfsadfasdf"
            };

            projectElements = new List<ProjectElement>();
            projectElements.Add(informationElement);
            projectElements.Add(experienceElement);
            projectElements.Add(documentElement);
            projectElements.Add(pictureElement);
            projectElements.Add(videoElement);

            //Save elements to project
            project.projectElements = projectElements;

            //Save Changes to DB
            VestnDB db = new VestnDB();
            db.projects.Add(project);
            if (u.projects == null)
            {
                u.projects = new List<Project>();
            }
            u.projects.Add(project);
            db.Entry(u).State = EntityState.Modified;
            db.SaveChanges();
        }
Example #2
0
 public JsonModels.Artifact AddVideoElement(int projectId, string description, string id, string videoType)
 {
     Project p = pa.GetProject(projectId);
     ProjectElement_Video pe = new ProjectElement_Video
     {
         title = "New Video",
         description = description,
         videoId = id,
         videoType = videoType
     };
     int pID = pa.AddProjectElement(p, pe);
     return new JsonModels.Artifact { id = pID, artifactLocation = pe.videoId, title = pe.title, fileLocation = videoType, type = "video", description = description };
 }