Пример #1
0
 public int InsertProjectDetails(MODEL.Project project)
 {
     using (dbContext)
     {
         DAC.Project proj = new DAC.Project()
         {
             Project_Name = project.ProjectName,
             Start_Date   = project.ProjectStartDate,
             End_Date     = project.ProjectEndDate,
             Priority     = project.Priority,
             Manager      = project.User.UserId
         };
         dbContext.Projects.Add(proj);
         return(dbContext.SaveChanges());
     }
 }
Пример #2
0
 public int InsertProjectDetails(MODEL.Project project)
 {
     using (dbContext)
     {
         DAC.Project proj = new DAC.Project()
         {
             Project_Name = project.ProjectName,
             Start_Date   = project.ProjectStartDate,
             End_Date     = project.ProjectEndDate,
             Priority     = project.Priority
         };
         dbContext.Projects.Add(proj);
         dbContext.SaveChanges();
         if (dbContext.Users.Where(user => user.User_ID.ToString().Contains(project.User.UserId.ToString())).Count() > 0)
         {
             dbContext.Users.Where(user => user.User_ID.ToString().Contains(project.User.UserId.ToString())).FirstOrDefault().Project_ID = proj.Project_ID;
         }
         return(dbContext.SaveChanges());
     }
 }
Пример #3
0
 public int InsertProjectDetails(MODEL.Project project)
 {
     using (dbContext)
     {
         DAC.Project proj = new DAC.Project()
         {
             Project_Name = project.ProjectName,
             Start_Date   = project.ProjectStartDate,
             End_Date     = project.ProjectEndDate,
             Priority     = project.Priority
         };
         dbContext.Projects.Add(proj);
         dbContext.SaveChanges();
         var editDetails = (from record in dbContext.Users
                            where record.User_ID.ToString().Contains(project.User.UserId.ToString())
                            select record).First();
         if (editDetails != null)
         {
             editDetails.Project_ID = proj.Project_ID;
         }
         return(dbContext.SaveChanges());
     }
 }