Exemplo n.º 1
0
 public void AddProjectMantis(LoginData credentials, ProjectData projectData)
 {
     Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
     Mantis.ProjectData project = new Mantis.ProjectData();
     project.name = projectData.ProjectName;
     client.mc_project_add(credentials.UserName, credentials.Password, project);
 }
Exemplo n.º 2
0
        public List <ProjectData> GetAllProjects(LoginData credentials, ProjectData projectData)
        {
            List <ProjectData> projects = new List <ProjectData>();

            driver.Url = baseURL + "/manage_proj_page.php";
            Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
            Mantis.ProjectData accessibleProjects     = new Mantis.ProjectData();
            accessibleProjects.name = projectData.ProjectName;
            accessibleProjects.name = projectData.Id;
            client.mc_projects_get_user_accessible(credentials.UserName, credentials.Password);

            IList <IWebElement> rows = driver.FindElements(By.CssSelector("tbody tr"));

            foreach (IWebElement row in rows)
            {
                IWebElement link = driver.FindElement(By.TagName("a"));
                string      name = link.Text;
                string      href = link.GetAttribute("href");
                Match       m    = Regex.Match(href, @"\d+$");
                string      id   = m.Value;

                projects.Add(new ProjectData()
                {
                    ProjectName = name,
                    Id          = id
                });
            }
            return(projects);
        }
Exemplo n.º 3
0
 public void Create(AccountData account, ProjectData projectData)
 {
     Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
     Mantis.ProjectData project = new Mantis.ProjectData();
     project.name = projectData.Name;
     client.mc_project_add(account.Name, account.Password, project);
 }
Exemplo n.º 4
0
 public void CreateProjectByAPI(ProjectData project, AccountData account)
 {
     Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
     Mantis.ProjectData mProject = new Mantis.ProjectData();
     mProject.name = project.Name;
     client.mc_project_add(account.Name, account.Password, mProject);
 }
Exemplo n.º 5
0
 public void AddProjects(AccountData acc, ProjectData proj)
 {
     Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
     Mantis.ProjectData project = new Mantis.ProjectData();
     project.name = proj.Name;
     client.mc_project_add(acc.Name, acc.Pass, project);
 }
Exemplo n.º 6
0
 public void Create(ProjectData projectData, AccountData account)
 {
     Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
     Mantis.ProjectData projects = new Mantis.ProjectData();
     projects.name = projectData.Name;
     client.mc_project_add(account.Username, account.Password, projects);
 }
Exemplo n.º 7
0
        public static List <ProjectData> GetAllProjects(AccountData account)
        {
            Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
            Mantis.ProjectData[] projectData          =
                client.mc_projects_get_user_accessible(account.Username, account.Password);

            ProjectData        pr      = new ProjectData();
            List <ProjectData> project = new List <ProjectData>();

            foreach (Mantis.ProjectData data in projectData)
            {
                pr.Id     = (data.id).ToString();
                pr.Name   = data.name;
                pr.Status = (data.status.id).ToString();
                if (data.inherit_global == true)
                {
                    pr.InheritGlobal = "1";
                }
                else
                {
                    pr.InheritGlobal = "0";
                }
                pr.ViewState   = (data.view_state.id).ToString();
                pr.Description = data.description;

                project.Add(pr);
            }

            return(project);
        }
Exemplo n.º 8
0
 public string CreateNewProject(AccountData account, ProjectData project)
 {
     Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
     Mantis.ProjectData projectData            = new Mantis.ProjectData();
     projectData.name = project.Name;
     return(client.mc_project_add(account.Name, account.Password, projectData));
 }
Exemplo n.º 9
0
 public void CreateProject(ProjectData project)
 {
     Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
     Mantis.ProjectData newProject             = new Mantis.ProjectData();
     newProject.name = project.Name;
     client.mc_project_add(account.Name, account.Password, newProject);
 }
Exemplo n.º 10
0
        public List <string> GetProjectsListNamesAPI(AccountData account)
        {
            Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
            var projectDataList = client.mc_projects_get_user_accessible(account.Name, account.Password);

            return(projectDataList.Select(p => p.name).ToList());
        }
 public void Remove(AccountData account, ProjectData project)
 {
     Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
     Mantis.ProjectData projectM = new Mantis.ProjectData();
     projectM.id = project.Id;
     client.mc_project_delete(account.Username, account.Password, projectM.id);
 }
 public void CreateNewProjectFromAPI(AccountData account, ProjectData project)
 {
     Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
     Mantis.ProjectData project_new            = new Mantis.ProjectData();
     project_new.name        = project.Pr_name;
     project_new.description = project.Pr_description;
     client.mc_project_add(account.Name, account.Password, project_new);
 }
Exemplo n.º 13
0
 public void AddProject(AccountData account, ProjectData pr)
 {
     Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
     Mantis.ProjectData project = new Mantis.ProjectData();
     project.name = pr.Name;
     //project.name = "APIAPI";
     client.mc_project_add(account.Name, account.Password, project);
 }
Exemplo n.º 14
0
 public void CreateNewProject(ProjectData project)
 {
     Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
     Mantis.ProjectData apiProject             = new Mantis.ProjectData();
     apiProject.name        = project.Name;
     apiProject.description = project.Description;
     client.mc_project_add(AdminData.Name, AdminData.Password, apiProject);
 }
Exemplo n.º 15
0
 public void CreateNewProject(AccountData account, ProjectData projectData)
 {
     Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
     Mantis.ProjectData project = new Mantis.ProjectData();
     project.name        = projectData.Name;
     project.description = projectData.Description;
     client.mc_project_add(account.Username, account.Password, project);
 }
Exemplo n.º 16
0
 public void CreateProjectForRemove(AccountData account, ProjectData project)
 {
     Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
     Mantis.ProjectData addedProject           = new Mantis.ProjectData();
     addedProject.name        = project.Name;
     addedProject.description = project.Description;
     client.mc_project_add(account.Name, account.Password, addedProject);
 }
 public void Create(AccountData account, ProjectData project)
 {
     Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
     Mantis.ProjectData projectM = new Mantis.ProjectData();
     projectM.id   = project.Id;
     projectM.name = project.ProjectName;
     client.mc_project_add(account.Username, account.Password, projectM);
 }
Exemplo n.º 18
0
 public static List <ProjectData> GetAll(AccountData account)
 {
     Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
     Mantis.ProjectData[] projects             = client.mc_projects_get_user_accessible(account.Name, account.Password);
     return(projects.Select(proj => new ProjectData()
     {
         Name = proj.name, Description = proj.description, Id = proj.id
     }).ToList());
 }
Exemplo n.º 19
0
        public void CreateProject(AccountData account)
        {
            var project = new Mantis.ProjectData();

            project.name = "Mantis Project";
            project.id   = "10";
            Mantis.MantisConnectPortTypeClient projectsList = new Mantis.MantisConnectPortTypeClient();
            projectsList.mc_project_add(account.Name, account.Password, project);
        }
Exemplo n.º 20
0
        //получение списка элементов

        public List <Mantis.ProjectData> GetProjectList(AccountData account)
        {
            driver.Navigate().Refresh();
            Mantis.MantisConnectPortTypeClient client  = new Mantis.MantisConnectPortTypeClient();
            List <Mantis.ProjectData>          project = client.mc_projects_get_user_accessible(account.Username, account.Password).ToList();


            return(project);
        }
Exemplo n.º 21
0
        public void CreateIfNotExist(ProjectData projectData, AccountData accountData)
        {
            var client = new Mantis.MantisConnectPortTypeClient();

            if (ProjectData.GetAllFromMantisApi(accountData).Count < 1)
            {
                client.mc_project_add(accountData.Name, accountData.Password, projectData);
            }
        }
Exemplo n.º 22
0
 public void AddNewProjectIfNoProjects(ProjectData project)
 {
     Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
     Mantis.ProjectData[] projects             = client.mc_projects_get_user_accessible("administrator", "root");
     if (projects.Length == 0)
     {
         AddNewProject(project);
     }
 }
Exemplo n.º 23
0
        public void ProjectCreationWithAPI(AccountData account, ProjectData project)
        {
            Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
            Mantis.ProjectData projectAPI             = new Mantis.ProjectData();
            projectAPI.name = project.Name;


            client.mc_project_add(account.Username, account.Password, projectAPI);
        }
Exemplo n.º 24
0
 public void CreateProject(AccountData account, ProjectData project)
 {
     Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
     Mantis.ProjectData m_project = new Mantis.ProjectData()
     {
         name        = project.Name,
         description = project.Description
     };
     client.mc_project_add(account.Name, account.Password, m_project);
 }
Exemplo n.º 25
0
        //mc_project_get_id_from_name

        internal string SoapRemove(AccountData account)
        {
            Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
            Mantis.ProjectData[] lists = client.mc_projects_get_user_accessible(account.Username, account.Password);
            string name = lists[0].name;
            var    id   = client.mc_project_get_id_from_name(account.Username, account.Password, lists[0].name);

            client.mc_project_delete(account.Username, account.Password, id);
            return(name);
        }
Exemplo n.º 26
0
        public void DeleteIfProjectExist(AccountData account, ProjectData project)
        {
            Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
            string projectId = client.mc_project_get_id_from_name(account.Name, account.Password, project.Name);

            if (projectId != null && projectId != "0")
            {
                Remove(account, projectId);
            }
        }
Exemplo n.º 27
0
        public string CreateFromSoap(ProjectData project)
        {
            Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();

            Mantis.ProjectData mc_project = new Mantis.ProjectData();
            mc_project.name        = project.Name;
            mc_project.description = project.Description;

            return(client.mc_project_add("administrator", "root", mc_project)); //веб-сервис возвращает идентификатор созданного проекта
        }
Exemplo n.º 28
0
        public void AddProject(AccountData account, ProjectData project)
        {
            List <ProjectData> list = new List <ProjectData>();

            Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
            Mantis.ProjectData mProject = new Mantis.ProjectData();
            mProject.name = project.Name;
            client.mc_project_add(account.Name, account.Password, mProject);
            client.Close();
        }
Exemplo n.º 29
0
        public ProjectHelper Remove(AccountData account, ProjectData project)
        {
            Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
            Mantis.ProjectData projectData            = new Mantis.ProjectData();
            string             index = GetProjectIndex(account, project.Name);

            projectData.id = index;
            client.mc_project_delete(account.Name, account.Password, index);
            return(this);
        }
Exemplo n.º 30
0
 public void AddProjectByAPI(ProjectData project, AccountData account)
 {
     Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
     Mantis.ProjectData issue = new Mantis.ProjectData
     {
         name        = project.ProjectName,
         description = project.Description
     };
     client.mc_project_add(account.Name, account.Password, issue);
 }