Пример #1
0
        public RedirectResult AcceptInvitation(string projectID)
        {
            string email = ((FormsIdentity)System.Web.HttpContext.Current.User.Identity).Name.ToString();
            User signedUser = db.Users.Where(user => user.email.Trim() == email).Single();

            int projectId = Int32.Parse(projectID);

            sif_InviteProjectUser invitation = (from n in db.sif_InviteProjectUsers
                                                where n.idProject == projectId && n.idUser == signedUser.idUser
                                                select n).Single();
            sif_ProjectUser newMembership = new sif_ProjectUser();
            newMembership.idUser = signedUser.idUser;
            newMembership.idProject = projectId;

            db.sif_InviteProjectUsers.DeleteOnSubmit(invitation);
            db.sif_ProjectUsers.InsertOnSubmit(newMembership);
            db.SubmitChanges();

            return Redirect("Index");
        }
Пример #2
0
        public RedirectResult AddNewProject(string projectName, string projectDescription)
        {
            string email = ((FormsIdentity)System.Web.HttpContext.Current.User.Identity).Name.ToString();
            User signedUser = db.Users.Where(user => user.email.Trim() == email).Single();

            Project newProject = new Project();
            newProject.projectName = projectName;
            newProject.description = projectDescription;
            newProject.idOwner = signedUser.idUser;
            newProject.dateCreated = DateTime.Now;

            db.Projects.InsertOnSubmit(newProject);
            db.SubmitChanges();

            sif_ProjectUser newMember = new sif_ProjectUser();
            newMember.idProject = newProject.idProject;
            newMember.idUser = signedUser.idUser;

            db.sif_ProjectUsers.InsertOnSubmit(newMember);
            db.SubmitChanges();
            return Redirect("/Dashboard/Index");
        }
Пример #3
0
		private void detach_sif_ProjectUsers(sif_ProjectUser entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
Пример #4
0
 partial void Deletesif_ProjectUser(sif_ProjectUser instance);
Пример #5
0
 partial void Updatesif_ProjectUser(sif_ProjectUser instance);
Пример #6
0
 partial void Insertsif_ProjectUser(sif_ProjectUser instance);
Пример #7
0
		private void attach_sif_ProjectUsers(sif_ProjectUser entity)
		{
			this.SendPropertyChanging();
			entity.Project = this;
		}