Пример #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);
 }
Пример #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);
        }
Пример #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);
 }
Пример #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);
 }
Пример #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);
 }
Пример #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);
 }
Пример #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);
        }
Пример #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));
 }
Пример #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);
 }
Пример #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);
 }
Пример #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);
 }
Пример #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);
 }
 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);
 }
Пример #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);
 }
Пример #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());
 }
Пример #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);
        }
Пример #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);
        }
Пример #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);
            }
        }
Пример #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);
     }
 }
Пример #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);
        }
Пример #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);
 }
Пример #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);
        }
Пример #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);
            }
        }
Пример #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)); //веб-сервис возвращает идентификатор созданного проекта
        }
Пример #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();
        }
Пример #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);
        }
Пример #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);
 }