Inheritance: OptimizedPersistable
Esempio n. 1
0
 public Component(User user, string componentName, string compopnentDescription, Project componentProject)
 {
   name = componentName;
   description = compopnentDescription;
   project = componentProject;
   createdBy = user;
 }
Esempio n. 2
0
 public Issue(User reportedBy, PriorityEnum priority, Project project, CategoryEnum category, Component component, ProductVersion version, Resolution resolution,
   string summary, string description, string environment, User assignedTo, DateTime dueDate, SortedSetAny<Attachment> attachments, StatusEnum status = StatusEnum.Open)
 {
   if (attachments != null)
     m_attachments = attachments;
   else
     m_attachments = new SortedSetAny<Attachment>();
   m_reportedBy = reportedBy;
   m_project = project;
   m_component = component;
   m_affectedComponentSet = new SortedSetAny<Component>(1);
   if (component != null)
     m_affectedComponentSet.Add(component);
   m_affectedVersionSet = new SortedSetAny<ProductVersion>(1);
   if (version != null)
     m_affectedVersionSet.Add(version);
   m_voteSet = new SortedSetAny<Vote>(1);
   m_relatedIssueSet = new SortedSetAny<Issue>(1);
   m_fixedInVersionSet = new SortedSetAny<ProductVersion>(1);
   m_subTaskSet = new SortedSetAny<SubTask>(1);
   m_labelSet = new SortedSetAny<ProductLabel>(1);
   m_version = version;
   m_summary = summary;
   m_description = description;
   m_environment = environment;
   m_category = category;
   m_priority = priority;
   m_fixResolution = resolution;
   m_dateTimeCreated = DateTime.Now;
   m_dateTimeLastUpdated = m_dateTimeCreated;
   m_fixmessage = null;
   m_lastUpdatedBy = reportedBy;
   m_dueDate = dueDate;
   m_status = status;
   AssignedTo = assignedTo;
   m_subscribers = null; // to do
   m_testCase = null;// to do
 }
Esempio n. 3
0
 public Issue(User reportedBy, PriorityEnum priority, Project project, CategoryEnum category, Component component, ProductVersion version, Resolution resolution,
   string summary, string description, string environment, User assignedTo, DateTime dueDate, SortedSetAny<Attachment> attachments, StatusEnum status = StatusEnum.Open)
 {
   if (attachments != null)
     this.attachments = attachments;
   else
     this.attachments = new SortedSetAny<Attachment>();
   this.reportedBy = reportedBy;
   this.project = project;
   this.component = component;
   affectedComponentSet = new SortedSetAny<Component>(1);
   if (component != null)
     affectedComponentSet.Add(component);
   affectedVersionSet = new SortedSetAny<ProductVersion>(1);
   if (version != null)
     affectedVersionSet.Add(version);
   voteSet = new SortedSetAny<Vote>(1);
   relatedIssueSet = new SortedSetAny<Issue>(1);
   fixedInVersionSet = new SortedSetAny<ProductVersion>(1);
   subTaskSet = new SortedSetAny<SubTask>(1);
   labelSet = new SortedSetAny<ProductLabel>(1);
   this.version = version;
   this.summary = summary;
   this.description = description;
   this.environment = environment;
   this.category = category;
   this.priority = priority;
   fixResolution = resolution;
   dateTimeCreated = DateTime.Now;
   dateTimeLastUpdated = dateTimeCreated;
   fixmessage = null;
   lastUpdatedBy = reportedBy;
   this.dueDate = dueDate;
   this.status = status;
   this.AssignedTo = assignedTo;
   subscribers = null; // to do
   testCase = null;// to do
 }
Esempio n. 4
0
 public void Create4Projects(int numberOfProjects)
 {
   Project project = null;
   Project priorProject = null;
   for (int i = 0; i < numberOfProjects; i++)
     using (SessionNoServer session = new SessionNoServer(systemDir))
     {
       session.BeginUpdate();
       IssueTracker issueTracker = session.AllObjects<IssueTracker>(false).FirstOrDefault();
       User user = issueTracker.UserSet.Keys[rand.Next(issueTracker.UserSet.Keys.Count - 1)];
       string p = "project" + i.ToString();
       string d = "pdescription" + i.ToString();
       project = new Project(user, p, d);
       session.Persist(project);
       priorProject = project;
       issueTracker.ProjectSet.Add(project);
       session.Commit();
     }
 }
Esempio n. 5
0
 public void Create4Projects(int numberOfProjects)
 {
   Project project = null;
   Project priorProject = null;
   for (int i = 0; i < numberOfProjects; i++)
     using (SessionNoServer session = new SessionNoServer(systemDir))
     {
       session.BeginUpdate();
       IssueTracker issueTracker = (IssueTracker)session.Open(IssueTracker.PlaceInDatabase, 1, 1, false);
       User user = issueTracker.UserSet.Keys[rand.Next(issueTracker.UserSet.Keys.Count - 1)];
       string p = "project" + i.ToString();
       string d = "pdescription" + i.ToString();
       project = new Project(user, p, d);
       project.Persist(session, priorProject ?? project);
       priorProject = project;
       issueTracker.ProjectSet.Add(project);
       session.Commit();
     }
 }
Esempio n. 6
0
 public IEnumerable<Project> SelectProject(UInt64 Id)
 {
   try
   {
     Project project;
     if (Id > 0)
     {
       project = (Project)s_sharedReadOnlySession.Open(Id);
     }
     else
       project = new Project();
     List<Project> list = new List<Project>(1);
     list.Add(project);
     return list;
   }
   catch (System.Exception ex)
   {
     this.errorLabel.Text = ex.ToString();
   }
   return null;
 }
Esempio n. 7
0
 public void UpdateProject(EditedProject newValues)
 {
   try
   {
     string dataPath = HttpContext.Current.Server.MapPath("~/tracker");
     using (SessionNoServer session = new SessionNoServer(dataPath, 2000, true, true))
     {
       session.BeginUpdate();
       if (newValues.Id == 0)
       {
         if (newValues.Name == null)
           Console.WriteLine("Project null storeName detected in Update method");
         else
         {
           IssueTracker issueTracker = session.AllObjects<IssueTracker>(false).FirstOrDefault();
           User user = lookupUser(issueTracker, session);
           Project newProject = new Project(user, newValues.Name, newValues.Description);
           session.Persist(newProject);
           issueTracker.ProjectSet.Add(newProject);
         }
       }
       else
       {
         Project existingProject = (Project)session.Open(newValues.Id);
         existingProject.Name = newValues.Name;
         existingProject.Description = newValues.Description;
       }
       session.Commit();
       s_sharedReadOnlySession.ForceDatabaseCacheValidation();
     }
   }
   catch (System.Exception ex)
   {
     this.errorLabel.Text = ex.ToString();
   }
 }
Esempio n. 8
0
    void createInitialObjects(IssueTracker issueTracker, User user, SessionBase session)
    {
      Project project = new Project(user, "VelocityDB", "Object Database Management System");
      session.Persist(project);
      issueTracker.ProjectSet.Add(project);

      Component webSite = new Component(user, "Web Site", "VelocityDB.com", project);
      session.Persist(webSite);
      issueTracker.ComponentSet.Add(webSite);

      Component samples = new Component(user, "Samples", "Samples applications provided", project);
      session.Persist(samples);
      issueTracker.ComponentSet.Add(samples);

      Component collections = new Component(user, "Collections", "Any of the collection classes", project);
      session.Persist(collections);
      issueTracker.ComponentSet.Add(collections);

      Component performance = new Component(user, "Performance", "Any performance issue", project);
      session.Persist(performance);
      issueTracker.ComponentSet.Add(performance);

      ProductVersion version = new ProductVersion(user, "5.0.16", "First initial version", new DateTime(2015, 11, 29));
      session.Persist(version);
      issueTracker.VersionSet.Add(version);
      version = new ProductVersion(user, "4.7", "June 13 version", new DateTime(2015, 06, 13));
      session.Persist(version);
      issueTracker.VersionSet.Add(version);
    }
Esempio n. 9
0
 public IEnumerable<Project> SelectProject(UInt64 Id)
 {
   try
   {
     Project project;
     if (Id > 0)
     {
       using (SessionNoServer session = new SessionNoServer(dataPath, 2000, true, true))
       {
         session.BeginRead();
         project = (Project)session.Open(Id);
         session.Commit();
       }
     }
     else
       project = new Project();
     List<Project> list = new List<Project>(1);
     list.Add(project);
     return list;
   }
   catch (System.Exception ex)
   {
     this.errorLabel.Text = ex.ToString();
   }
   return null;
 }
Esempio n. 10
0
 public void UpdateProject(EditedProject newValues)
 {
   try
   {
     using (SessionNoServer session = new SessionNoServer(dataPath, 2000, true, true))
     {
       session.BeginUpdate();
       if (newValues.Id == 0)
       {
         if (newValues.Name == null)
           Console.WriteLine("Project null storeName detected in Update method");
         else
         {
           IssueTracker issueTracker = (IssueTracker)session.Open(IssueTracker.PlaceInDatabase, 1, 1, false);
           User user = lookupUser(issueTracker, session);
           Project newProject = new Project(user, newValues.Name, newValues.Description);
           Placement placer = new Placement(newProject.PlacementDatabaseNumber, 1, 1, 10000, 10000);
           newProject.Persist(placer, session);
           issueTracker.ProjectSet.Add(newProject);
         }
       }
       else
       {
         Project existingProject = (Project)session.Open(newValues.Id);
         existingProject.Name = newValues.Name;
         existingProject.Description = newValues.Description;
       }
       session.Commit();
     }
   }
   catch (System.Exception ex)
   {
     this.errorLabel.Text = ex.ToString();
   }
 }