Пример #1
0
 public void UpdateProject(ProjectViewModel m)
 {
     using (new TransactionScope(TransactionScopeOption.Suppress))
     {
         var now = DateTime.UtcNow;
         var d = new ProjectsDataContext();
         var p = new Project();
         p.ProjectName = (m.ProjectName == "null") ? null : m.ProjectName;
         p.Comment = (m.Comment == "null") ? null : m.Comment;
         p.ProjectID = Guid.NewGuid();
         p.VersionOwnerContactID = m.Creator;
         p.VersionUpdated = now;
         p.VersionUpdatedBy = m.User;
         d.Projects.InsertOnSubmit(p);
         var n = new ProjectPlan();
         n.ProjectPlanID = Guid.NewGuid();
         n.ProjectID = p.ProjectID;
         n.ProjectPlanName = "Resource Modelling";
         n.ResponsibleContactID = m.Creator;
         n.VersionOwnerContactID = m.User;
         n.VersionUpdated = now;
         n.VersionUpdatedBy = m.User;
         d.ProjectPlans.InsertOnSubmit(n);
         var t = new ProjectPlanTask();
         t.ProjectPlanTaskID = Guid.NewGuid();
         t.ProjectPlanID = n.ProjectPlanID;
         t.ProjectTaskName = m.StageName;
         t.VersionOwnerContactID = m.Creator;
         t.VersionUpdated = now;
         t.VersionUpdatedBy = m.User;
         d.ProjectPlanTasks.InsertOnSubmit(t);
         var tr = new ProjectPlanTask();
         tr.ProjectPlanTaskID = Guid.NewGuid();
         tr.ProjectPlanID = n.ProjectPlanID;
         tr.ProjectTaskName = "Review";
         tr.VersionOwnerContactID = m.Reviewer;
         tr.VersionUpdated = now.AddSeconds(-1); //This is not the current task
         tr.VersionUpdatedBy = m.User;
         d.ProjectPlanTasks.InsertOnSubmit(tr);
         var tc = new ProjectPlanTask();
         tc.ProjectPlanTaskID = Guid.NewGuid();
         tc.ProjectPlanID = n.ProjectPlanID;
         tc.ProjectTaskName = "Complete";
         tc.VersionOwnerContactID = m.User;
         tc.VersionUpdated = now.AddSeconds(-1); //This is not the current task
         tc.VersionUpdatedBy = m.User;
         d.ProjectPlanTasks.InsertOnSubmit(tr);
         d.SubmitChanges();
     }
 }
Пример #2
0
 partial void DeleteProjectPlanTask(ProjectPlanTask instance);
Пример #3
0
 partial void UpdateProjectPlanTask(ProjectPlanTask instance);
Пример #4
0
 partial void InsertProjectPlanTask(ProjectPlanTask instance);
Пример #5
0
		private void detach_ProjectPlanTasks(ProjectPlanTask entity)
		{
			this.SendPropertyChanging();
			entity.X_ProjectPlanTask1 = null;
		}
Пример #6
0
		private void attach_ProjectPlanTasks(ProjectPlanTask entity)
		{
			this.SendPropertyChanging();
			entity.ProjectPlan = this;
		}