Browse Source

Не знаю, что уже работает

Drenbb 2 years ago
parent
commit
e71460395d

+ 164 - 12
RedmineOracle/ListIstIssues.cs

@@ -1,8 +1,10 @@
 using Redmine.Net.Api;
+using Redmine.Net.Api.Async;
 using Redmine.Net.Api.Types;
 using System;
 using System.Collections.Generic;
 using System.Collections.Specialized;
+using System.IO;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -39,22 +41,137 @@ namespace RedmineOracle
             public string VisibilityDateLastComment { get; set; }
         }
 
+        public struct Userss
+        {
+            public int Id { get; set; }
+            public string UserName { get; set; }
+
+        }
+
 
         public ListIstIssues()
         {
 
         }
 
+
+        public void UploadAttachment(int idIssue, string path)
+        {
+            var host = "http://testred.ru/";
+            var parameters = new NameValueCollection();
+            RedmineManager a = new RedmineManager(host, infoAuth.loginRm, infoAuth.passwordRm);
+            //read document from a specified path
+            //string documentPath = "<document-local-path>";
+            FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
+
+            // Create a byte array of file stream length
+            byte[] ImageData = new byte[fs.Length];
+
+            //Read block of bytes from stream into the byte array
+            fs.Read(ImageData, 0, System.Convert.ToInt32(fs.Length));
+
+            //Close the File Stream
+            fs.Close();
+            byte[] documentData = ImageData;
+
+            //upload attachment to redmine
+            Upload attachment = a.UploadFile(documentData);
+
+            //set attachment properties
+            attachment.FileName = Path.GetFileName(path);
+            attachment.Description = "";
+            attachment.ContentType = Path.GetExtension(path);
+
+            //create a list of attachments to be added to issue
+            IList<Upload> attachments = new List<Upload>();
+            attachments.Add(attachment);
+            parameters.Add("issue_id", idIssue.ToString());
+            parameters.Add("include", "journals");
+            Issue issues = a.GetObject<Issue>(idIssue.ToString(), parameters);
+            issues.Uploads = attachments;
+            a.UpdateObject(issues.Id.ToString(), issues);
+            //get project
+
+        }
+
+        public List<Userss> allUsers()
+        {
+            List<Userss> users = new List<Userss>();
+
+            var host = "http://testred.ru/";
+            var parameters = new NameValueCollection();
+            RedmineManager a = new RedmineManager(host, infoAuth.loginRm, infoAuth.passwordRm);
+            IList<User> us = a.GetObjects<User>();
+            foreach (User user in us)
+            {
+                Userss u = new Userss();
+                u.Id = user.Id;
+                u.UserName = user.Login;
+                users.Add(u);
+            }
+            return users;
+        }
+
+        public List<Issues> getRespondIss(int id)
+        {
+            List<Issues> Issuess = new List<Issues>();
+            var host = "http://testred.ru/";
+            var parameters = new NameValueCollection();
+            parameters.Add("include", "journals");
+            parameters.Add("project_id", "5");
+            parameters.Add("status_id", "1|2|4");
+            parameters.Add(RedmineKeys.ASSIGNED_TO_ID, id.ToString());
+            RedmineManager a = new RedmineManager(host, infoAuth.loginRm, infoAuth.passwordRm);
+            IList<Issue> issues = a.GetObjects<Issue>(parameters);
+            if (issues != null)
+                foreach (var issue in issues)
+                {
+                    Issues issue2 = new Issues();
+                    issue2.Id = issue.Id;
+                    issue2.Name = issue.Subject;
+                    issue2.Description = issue.Description;
+                    issue2.IssueAuthor = issue.Author.Name;
+                    issue2.Project = issue.Project.Name;
+                    issue2.DateComplite = Convert.ToDateTime(issue.DueDate);
+                    issue2.Status = issue.Status.Name;
+                    issue2.LastUpdate = Convert.ToDateTime(issue.UpdatedOn);
+                    if (issue.AssignedTo.Name != null)
+                        issue2.Responsible = issue.AssignedTo.Name;
+                    issue2.CreatedOn = Convert.ToDateTime(issue.CreatedOn);
+                    foreach (var cf in issue.CustomFields)
+                    {
+                        if (cf.Values != null)
+                            issue2.idLRP = cf.Values[0].Info;
+                    }
+                    issue2.VisibilityDateLastComment = "Collapsed";
+                    IList<Journal> issuesjournal = a.GetObject<Issue>(issue.Id.ToString(), parameters).Journals;
+                    if (issuesjournal != null)
+                        foreach (var journal in issuesjournal)
+                        {
+                            if (journal.Notes != null)
+                            {
+                                issue2.Journal = journal.Notes;
+                                issue2.DateLastComment = Convert.ToDateTime(journal.CreatedOn);
+                                issue2.VisibilityDateLastComment = "Visible";
+                            }
+
+                        }
+                    Issuess.Add(issue2);
+
+                }
+            Issuess = Issuess.OrderBy(x => x.LastUpdate).ToList();
+            Issuess.Reverse();
+            return Issuess;
+        }
+
         public List<Issues> createList()
         {
             List<Issues> Issuess = new List<Issues>();
             var host = "http://testred.ru/";
             var parameters = new NameValueCollection();
             parameters.Add("include", "journals");
-            parameters.Add("project", "5");
-            parameters.Add("status_id", "1");
-            parameters.Add("status_id", "2");
-            //parameters.Add("status_id", "3");
+            parameters.Add("project_id", "5");
+            parameters.Add("status_id", "1|2|4");
             RedmineManager a = new RedmineManager(host, infoAuth.loginRm, infoAuth.passwordRm);
             IList<Issue> issues = a.GetObjects<Issue>(parameters);
             foreach (var issue in issues)
@@ -90,10 +207,10 @@ namespace RedmineOracle
 
                     }
                 Issuess.Add(issue2);
-                
+
             }
-            Issuess= Issuess.OrderBy(x=>x.LastUpdate).ToList();
-            Issuess.Reverse(); 
+            Issuess = Issuess.OrderBy(x => x.LastUpdate).ToList();
+            Issuess.Reverse();
             return Issuess;
         }
 
@@ -103,16 +220,12 @@ namespace RedmineOracle
             var parameters = new NameValueCollection();
             parameters.Add("issue_id", id.ToString());
             parameters.Add("include", "journals");
-/*            parameters.Add("project", "5");
-            parameters.Add("status_id", "1");
-            parameters.Add("status_id", "2");*/
-            //parameters.Add("status_id", "3");
             Issues issue2 = new Issues();
             RedmineManager a = new RedmineManager(host, infoAuth.loginRm, infoAuth.passwordRm);
             IList<Issue> issues = a.GetObjects<Issue>(parameters);
             foreach (var issue in issues)
             {
-               
+
                 issue2.Id = issue.Id;
                 issue2.Name = issue.Subject;
                 issue2.Description = issue.Description;
@@ -190,5 +303,44 @@ namespace RedmineOracle
             a.UpdateObject(issues.Id.ToString(), issues);
         }
 
+        public void CreateIss(string idLRPP, string MiniInf, string FullInf, string idRespond)
+        {
+            var host = "http://testred.ru/";
+            var redmine = new RedmineManager(host, infoAuth.loginRm, infoAuth.passwordRm);
+
+            redmine.ImpersonateUser = infoAuth.loginRm;
+            User user = redmine.GetCurrentUser();
+            IList<IssueCustomField> fields = new List<IssueCustomField>();
+            IList<CustomFieldValue> fieldss = new List<CustomFieldValue>();
+            IssueCustomField cs = new IssueCustomField();
+            CustomFieldValue cf = new CustomFieldValue();
+
+            cf.Info = idLRPP;
+            cs.Id = 10;
+            fieldss.Add(cf);
+            cs.Values = fieldss;
+            fields.Add(cs);
+            Issue redminetask = new Issue()
+            {
+
+                AssignedTo = new IdentifiableName() { Id = Convert.ToInt32(idRespond) },
+                Author = new IdentifiableName() { Id = user.Id },
+                Subject = MiniInf,
+                Description = FullInf,
+                Project = new IdentifiableName { Id = 5 },
+                StartDate = DateTime.Now,
+                CreatedOn = DateTime.Now,                         // Дата создание
+                //DueDate = DateTime.Now,                           // Дата окончания
+                Tracker = new IdentifiableName { Id = 1 },        // Трекер
+                Status = new IdentifiableName { Id = 1 },
+                Priority = new IdentifiableName { Id = 1 },
+                CustomFields = fields,
+                IsPrivate = false,
+                Category = new IdentifiableName { Id = 1 },
+            };
+            redmine.CreateObject(redminetask);
+            IdNewIss.id = redminetask.Id;
+        }
+
     }
 }

+ 1 - 0
RedmineOracle/MainWindow.xaml.cs

@@ -32,6 +32,7 @@ namespace RedmineOracle
             LoadPages.forumFrame = frmForum;
             frmRm.Navigate(new pgAuthRm());
             frmForum.Navigate(new pgAuthForum());
+            //frmForum.Navigate(new pgTestDonF());
 
         }
 

+ 293 - 14
RedmineOracle/OracleWork.cs

@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Data;
 using System.Data.Common;
 using System.Data.OracleClient;
+using System.IO;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -14,6 +15,22 @@ namespace RedmineOracle
     {
         DbProviderFactory factory;
         DbConnection connection;
+
+        public struct FileInfo
+        {
+            public string id { get; set; }
+            public string id_drp { get; set; }
+            public string Name { get; set; }
+            public string Type { get; set; }
+        }
+        public struct Users
+        {
+            public int Id { get; set; }
+            public string SystemName { get; set; }
+            public string Name { get; set; }
+            public string SecondName { get; set; }
+            public string LastName { get; set; }
+        }
         public struct Comments
         {
             public string Name { get; set; }
@@ -21,6 +38,8 @@ namespace RedmineOracle
             public DateTime Created { get; set; }
             public string Change { get; set; }
             public string SecreteComm { get; set; }
+            public string IdDRP { get; set; }
+            public string CountFile { get; set; }
         }
 
         public struct InfoLrp
@@ -45,7 +64,7 @@ namespace RedmineOracle
             factory = DbProviderFactories.GetFactory("System.Data.OracleClient");
             connection = factory.CreateConnection();
             connection.ConnectionString = "Data Source=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.111.197)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = NIS)));Password=dtrnjh340;User ID=ais_disp2";
-            
+
             oracleConnection = new OracleConnection();
             oracleConnection.ConnectionString = "Data Source=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = "
                  + "192.168.111.197" + ")(PORT = " + "1521" + "))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = "
@@ -53,25 +72,217 @@ namespace RedmineOracle
         }
 
 
-        public int chechAuth(string login, string pass)
+        public string FindRmIssue(string idLRP)
+        {
+            string iss = "Н/З";
+            if (oracleConnection.State != ConnectionState.Open)
+                oracleConnection.Open();
+            string commDon = "select secret_comments from lrp_drp where secret_comments like '%http://testred.ru/issues/%' and lrp_id=" + idLRP;
+            OracleCommand cmd = new OracleCommand(commDon, oracleConnection);
+            if (cmd.ExecuteScalar() != null)
+                iss = cmd.ExecuteScalar().ToString();
+            oracleConnection.Close();
+            iss = iss.Replace("http://testred.ru/issues/", "");
+            return iss;
+        }
+
+        public int CheckMaxDrp()
+        {
+            int max;
+            if (oracleConnection.State != ConnectionState.Open)
+                oracleConnection.Open();
+            string commDon = "select Max(drp_id) from lrp_drp";
+            OracleCommand cmd = new OracleCommand(commDon, oracleConnection);
+            max = Convert.ToInt32(cmd.ExecuteScalar());
+            oracleConnection.Close();
+            return max;
+        }
+
+        public int CheckMaxOpen()
+        {
+            int max;
+            if (oracleConnection.State != ConnectionState.Open)
+                oracleConnection.Open();
+            string commDon = "select Max(lrp_id) from fault_data where lrp_status_id in(1)";
+            OracleCommand cmd = new OracleCommand(commDon, oracleConnection);
+            max = Convert.ToInt32(cmd.ExecuteScalar());
+            oracleConnection.Close();
+            return max;
+        }
+
+        public int CheckCountOpen()
+        {
+            int count;
+            if (oracleConnection.State == ConnectionState.Closed)
+                oracleConnection.Open();
+            string commDon = "select Count(lrp_id) from fault_data where lrp_status_id in(1)";
+            OracleCommand cmd = new OracleCommand(commDon, oracleConnection);
+            count = Convert.ToInt32(cmd.ExecuteScalar());
+            oracleConnection.Close();
+            return count;
+        }
+
+        public List<FileInfo> listFile(string id_drp)
+        {
+            List<FileInfo> fi = new List<FileInfo>();
+            if (oracleConnection.State != ConnectionState.Open)
+                oracleConnection.Open();
+            string commDon = "select DPR_ID,DRP_BLOB,INF, TYPE_FILE from DRP_FILE where dpr_id =" + id_drp;
+            OracleCommand cmd = new OracleCommand(commDon, oracleConnection);
+            OracleDataReader reader = cmd.ExecuteReader();
+            int i = 0;
+            while (reader.Read())
+            {
+                FileInfo f = new FileInfo();
+                f.id_drp = reader[0].ToString();
+                f.Name = reader[2].ToString();
+                f.Type = reader[3].ToString();
+                f.id = i.ToString();
+                i++;
+                fi.Add(f);
+            }
+            reader.Close();
+            oracleConnection.Close();
+            return fi;
+        }
+
+        public void TestDonD(string id, string id_file)
+        {
+            if (oracleConnection.State != ConnectionState.Open)
+                oracleConnection.Open();
+            FileInfo fileInfo = listFile(id).FirstOrDefault(x => x.id == id_file);
+            string commDon = "select DRP_BLOB from DRP_FILE where dpr_id =" + id + " and inf =" + "'" + fileInfo.Name + "'";
+            OracleCommand cmd = new OracleCommand(commDon, oracleConnection);
+            if (oracleConnection.State != ConnectionState.Open)
+                oracleConnection.Open();
+            byte[] buffer = (byte[])cmd.ExecuteScalar();
+            using (FileStream fs = new FileStream(@"D:\" + fileInfo.Name + "." + fileInfo.Type, FileMode.Create))
+            {
+                fs.Write(buffer, 0, buffer.Length);
+            }
+            oracleConnection.Close();
+        }
+
+        public List<Users> listUsers()
+        {
+            List<Users> users = new List<Users>();
+            string commUsers = "Select t.Firstname ||' '|| t.Secondname ||' '|| t.Lastname as Respond,t.Login,t.USER_ID from spd.T_USERS t ";
+            if (oracleConnection.State != ConnectionState.Open) ;
+            oracleConnection.Open();
+            OracleCommand comd = new OracleCommand(commUsers, oracleConnection);
+            OracleDataReader reader = comd.ExecuteReader();
+            while (reader.Read())
+            {
+                Users user = new Users();
+                if (reader[0].ToString() != "")
+                    user.Name = reader.GetString(0);
+                if (reader[1].ToString() != "")
+                    user.SystemName = reader.GetString(1);
+                if (reader[2].ToString() != "")
+                    user.Id = reader.GetInt32(2);
+                users.Add(user);
+            }
+            oracleConnection.Close();
+            return users;
+        }
+
+        public async Task<int> chechAuth(string login, string pass)
+        {
+            int result = -1;
+            await Task.Run(() =>
+            {
+                string commandFindUser = "select t.* from spd.T_USERS t where t.pass='" + pass + "' and t.login ='" + login + "'";
+                oracleConnection.Open();
+                OracleCommand comd = new OracleCommand(commandFindUser, oracleConnection);
+                OracleDataReader reader = comd.ExecuteReader();
+
+                if (reader.HasRows)
+                    result = 1;
+                else
+                    result = -1;
+                oracleConnection.Close();
+
+            });
+            return result;
+
+        }
+
+        public int findLRP(string id)
         {
-            string commandFindUser = "select t.* from spd.T_USERS t where t.pass='" + pass + "' and t.login ='" + login+"'";
+            string commandFindLRP = "select t.* from fault_data t where t.lrp_id =" + id.ToString();
             oracleConnection.Open();
-            OracleCommand comd = new OracleCommand(commandFindUser, oracleConnection);
+            OracleCommand comd = new OracleCommand(commandFindLRP, oracleConnection);
             OracleDataReader reader = comd.ExecuteReader();
+            int result;
             if (reader.HasRows)
-                return 1;
-            else 
-                return -1;
+                result = 1;
+            else
+                result = -1;
+            oracleConnection.Close();
+            return result;
         }
 
-        public DataTable dtLrp()
+
+        public DataTable outputOpen()
         {
             connection.Open();
             DbCommand command = factory.CreateCommand(); //create a new command
             DbCommand command1 = factory.CreateCommand(); //create a new command
-            DataTable dt ;
-            command.CommandText = "select ft.lrp_id from fault_data ft where lrp_status_id not in(3, 7) order by lrp_status_id";
+            DataTable dt;
+            command.CommandText = "select ft.lrp_id from fault_data ft where lrp_status_id in(1) order by lrp_time_open desc";
+            command.Connection = connection; //connect the command
+            DbDataAdapter adapter = factory.CreateDataAdapter();//create new adapter
+            adapter.SelectCommand = command;
+            DataTable dt1;
+            DataSet ds = new DataSet(); //create a new dataset
+            try
+            {
+                adapter.Fill(ds, command.CommandText);
+            }
+            catch (Exception e)
+            {
+                MessageBox.Show(e.Message);
+            }
+            dt1 = ds.Tables[0];
+            command1.Connection = connection; //connect the command
+            DataSet secds = new DataSet(); //create a new dataset
+            for (int i = 0; i < dt1.Rows.Count; i++)
+
+            {
+                DbDataAdapter adapter1 = factory.CreateDataAdapter();//create new adapter
+                command1.CommandText = "select ft.lrp_id ,ft.lrp_prioritet_id,ft.lrp_mini_inf,lsl.system_name,ls.lrp_status_name,ft.lrp_time_open, t.time_change,t.drp_change, " +
+                    "u.Lastname || ' ' || u.Firstname || ' ' || u.Secondname as drp_creator, us.Lastname || ' ' || us.Firstname || ' ' || us.Secondname as respond " +
+                    "from fault_data ft, lrp_system_list lsl, lrp_status ls,lrp_drp t, spd.T_Users u, spd.T_Users us " +
+                    "where ft.System_Id = lsl.system_id and ft.lrp_status_id = ls.lrp_status_id and ft.lrp_id = t.lrp_id and t.time_create = (select MAX(t.time_create) " +
+                    "from lrp_drp t where t.lrp_id = " +
+                   dt1.Rows[i].ItemArray[0].ToString() +
+                    ") and ft.lrp_id =" +
+                  dt1.Rows[i].ItemArray[0].ToString() +
+                    "and ft.lrp_opener = u.user_id and ft.lrp_respondent_id = us.user_id";
+                adapter1.SelectCommand = command1;
+                try
+                {
+                    adapter1.Fill(secds);
+                }
+                catch (Exception e)
+                {
+                    MessageBox.Show(e.Message);
+                }
+
+            }
+            dt = secds.Tables[0]; //copy the table from the dataset to the dataTable
+            connection.Close();
+            //dt.DefaultView.Sort = "time_change desc";
+            return dt;
+        }
+        public DataTable dtLrp()
+        {
+            if (connection.State != ConnectionState.Open)
+                connection.Open();
+            DbCommand command = factory.CreateCommand(); //create a new command
+            DbCommand command1 = factory.CreateCommand(); //create a new command
+            DataTable dt;
+            command.CommandText = "select ft.lrp_id from fault_data ft where lrp_status_id not in(1,3,7)";
             command.Connection = connection; //connect the command
             DbDataAdapter adapter = factory.CreateDataAdapter();//create new adapter
             adapter.SelectCommand = command;
@@ -102,7 +313,7 @@ namespace RedmineOracle
                    dt1.Rows[i].ItemArray[0].ToString() +
                     ") and ft.lrp_id =" +
                   dt1.Rows[i].ItemArray[0].ToString() +
-                    "and ft.lrp_opener = u.user_id and ft.lrp_respondent_id = us.user_id"; 
+                    "and ft.lrp_opener = u.user_id and ft.lrp_respondent_id = us.user_id";
                 adapter1.SelectCommand = command1;
                 try
                 {
@@ -116,9 +327,73 @@ namespace RedmineOracle
             }
             dt = secds.Tables[0]; //copy the table from the dataset to the dataTable
             connection.Close();
+            dt.DefaultView.Sort = "time_change desc";
+            dt = dt.DefaultView.ToTable();
             return dt;
         }
 
+        public DataTable findRespondLRP(string idUser)
+        {
+            connection.Open();
+            DbCommand command = factory.CreateCommand(); //create a new command
+            DbCommand command1 = factory.CreateCommand(); //create a new command
+            DataTable dt;
+            command.CommandText = "select ft.lrp_id from fault_data ft where lrp_status_id not in(1,3,7) and LRP_RESPONDENT_ID=" + idUser;
+            command.Connection = connection; //connect the command
+            DbDataAdapter adapter = factory.CreateDataAdapter();//create new adapter
+            adapter.SelectCommand = command;
+            DataTable dt1;
+            DataSet ds = new DataSet(); //create a new dataset
+            try
+            {
+                adapter.Fill(ds, command.CommandText);
+            }
+            catch (Exception e)
+            {
+                MessageBox.Show(e.Message);
+            }
+            dt1 = ds.Tables[0];
+            command1.Connection = connection; //connect the command
+
+
+            DataSet secds = new DataSet(); //create a new dataset
+            for (int i = 0; i < dt1.Rows.Count; i++)
+
+            {
+                DbDataAdapter adapter1 = factory.CreateDataAdapter();//create new adapter
+                command1.CommandText = "select ft.lrp_id ,ft.lrp_prioritet_id,ft.lrp_mini_inf,lsl.system_name,ls.lrp_status_name,ft.lrp_time_open, t.time_change,t.drp_change, " +
+                    "u.Lastname || ' ' || u.Firstname || ' ' || u.Secondname as drp_creator, us.Lastname || ' ' || us.Firstname || ' ' || us.Secondname as respond " +
+                    "from fault_data ft, lrp_system_list lsl, lrp_status ls,lrp_drp t, spd.T_Users u, spd.T_Users us " +
+                    "where ft.System_Id = lsl.system_id and ft.lrp_status_id = ls.lrp_status_id and ft.lrp_id = t.lrp_id and t.time_create = (select MAX(t.time_create) " +
+                    "from lrp_drp t where t.lrp_id = " +
+                   dt1.Rows[i].ItemArray[0].ToString() +
+                    ") and ft.lrp_id =" +
+                  dt1.Rows[i].ItemArray[0].ToString() +
+                    "and ft.lrp_opener = u.user_id and ft.lrp_respondent_id = us.user_id";
+                adapter1.SelectCommand = command1;
+                try
+                {
+                    adapter1.Fill(secds);
+                }
+                catch (Exception e)
+                {
+                    MessageBox.Show(e.Message);
+                }
+
+            }
+            try
+            {
+                dt = secds.Tables[0];
+                connection.Close();
+                dt.DefaultView.Sort = "time_change desc";
+                dt = dt.DefaultView.ToTable();
+                return dt;
+            }
+            catch { }
+            //copy the table from the dataset to the dataTable
+            return dtLrp();
+        }
+
         public InfoLrp CurrentLRP(int id)
         {
             InfoLrp currLRP = new InfoLrp();
@@ -151,7 +426,7 @@ namespace RedmineOracle
         public List<Comments> CreateListComm(int id)
         {
             List<Comments> lComm = new List<Comments>();
-            string commComment = "select t.comments,t.time_create,t.drp_avtor, t.drp_change, t.secret_comments from lrp_drp t where t.lrp_id =" + id+" order by t.time_create desc";
+            string commComment = "select t.comments,t.time_create,t.drp_avtor, t.drp_change, t.secret_comments,t.drp_id from lrp_drp t where t.lrp_id =" + id + " order by t.time_create desc";
             oracleConnection.Open();
             OracleCommand comd = new OracleCommand(commComment, oracleConnection);
             OracleDataReader reader = comd.ExecuteReader();
@@ -163,6 +438,10 @@ namespace RedmineOracle
                 cs.Name = reader[2].ToString();
                 cs.Change = reader[3].ToString();
                 cs.SecreteComm = reader[4].ToString();
+                cs.IdDRP = reader[5].ToString();
+                string FindC = "Select Count(*) from drp_file where dpr_id =" + reader[5].ToString();
+                OracleCommand cmFindCount = new OracleCommand(FindC, oracleConnection);
+                cs.CountFile = cmFindCount.ExecuteScalar().ToString();
                 lComm.Add(cs);
             }
             reader.Close();
@@ -174,12 +453,12 @@ namespace RedmineOracle
         {
             oracleConnection.Open();
             string insertComm = "insert into lrp_drp t (t.drp_id, t.lrp_id, t.drp_avtor, t.secret_comments) " +
-                "values((select max(drp_id) + 1 from lrp_drp),  "+id_lrp+", '"+infoAuth.loginForum+"', '"+comm_s+"')";
+                "values((select max(drp_id) + 1 from lrp_drp),  " + id_lrp + ", '" + infoAuth.loginForum + "', '" + comm_s + "')";
             OracleCommand comd = new OracleCommand(insertComm, oracleConnection);
             comd.ExecuteNonQuery();
             oracleConnection.Close();
         }
-        
+
     }
 
 

+ 22 - 0
RedmineOracle/RedmineOracle.csproj

@@ -105,6 +105,7 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </ApplicationDefinition>
+    <Compile Include="classes\IdNewIss.cs" />
     <Compile Include="classes\infoAuth.cs" />
     <Compile Include="classes\LoadPages.cs" />
     <Compile Include="OracleWork.cs" />
@@ -126,6 +127,12 @@
     <Compile Include="pgRmList.xaml.cs">
       <DependentUpon>pgRmList.xaml</DependentUpon>
     </Compile>
+    <Compile Include="windCreateIssLRP.xaml.cs">
+      <DependentUpon>windCreateIssLRP.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="windDrpFile.xaml.cs">
+      <DependentUpon>windDrpFile.xaml</DependentUpon>
+    </Compile>
     <Page Include="MainWindow.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
@@ -163,8 +170,23 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="pgTestDonF.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="windCreateIssLRP.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="windDrpFile.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="pgTestDonF.xaml.cs">
+      <DependentUpon>pgTestDonF.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Properties\AssemblyInfo.cs">
       <SubType>Code</SubType>
     </Compile>

+ 13 - 0
RedmineOracle/classes/IdNewIss.cs

@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace RedmineOracle
+{
+    internal class IdNewIss
+    {
+        public static int id;
+    }
+}

+ 8 - 3
RedmineOracle/pgAuthForum.xaml.cs

@@ -26,9 +26,16 @@ namespace RedmineOracle
         }
 
         private void btnAuth_Click(object sender, RoutedEventArgs e)
+        {
+
+            check();
+
+        }
+
+        async void check()
         {
             OracleWork ow = new OracleWork();
-            if (ow.chechAuth(tbLogin.Text, tbPass.Text) == 1)
+            if (await ow.chechAuth(tbLogin.Text, tbPass.Text) == 1)
             {
                 LoadPages.forumFrame.Navigate(new pgListLRP());
                 infoAuth.loginForum = tbLogin.Text;
@@ -36,8 +43,6 @@ namespace RedmineOracle
             }
             else
                 MessageBox.Show("Неправильные учетные данные!");
-                
-
         }
     }
 }

+ 8 - 5
RedmineOracle/pgIssue.xaml

@@ -10,20 +10,22 @@
     <Page.Resources>
         <DataTemplate x:Key="listNotes">
             <StackPanel>
+               
                 <StackPanel Orientation="Horizontal">
                     <TextBlock Text="{Binding NoteAuthor}"></TextBlock>
                     <TextBlock  Text=" | " ></TextBlock>
                     <TextBlock Text="{Binding CreatedOn}"></TextBlock>
                 </StackPanel>
-                <TextBlock Text="{Binding NoteDescription}"></TextBlock>
+                <TextBox Text="{Binding NoteDescription}" TextWrapping="Wrap"></TextBox>
             </StackPanel>
         </DataTemplate>
     </Page.Resources>
 
     <Grid>
         <StackPanel>
+            <Button Name="btnRefresh" Content="Обновить" Click="btnRefresh_Click"></Button>
             <StackPanel Orientation="Horizontal">
-                <TextBlock  Text="{Binding Id}" ></TextBlock>
+                <TextBlock Name="tbIdIss"  Text="{Binding Id}" MouseDown="TextBlock_MouseDown"></TextBlock>
                 <TextBlock  Text=" | " ></TextBlock>
                 <TextBlock Text="{Binding Name}"></TextBlock>
             </StackPanel>
@@ -36,7 +38,7 @@
                 <TextBlock  Text=" | " ></TextBlock>
                 <TextBlock Text="{Binding Project}"></TextBlock>
                 <TextBlock  Text=" | " ></TextBlock>
-                <TextBlock  Text="{Binding idLRP}" ></TextBlock>
+                <TextBlock  Text="{Binding idLRP}" Loaded="TextBlock_Loaded"></TextBlock>
             </StackPanel>
             <TextBlock Text="{Binding Description}"></TextBlock>
             <StackPanel Orientation="Horizontal">
@@ -44,9 +46,10 @@
                 <TextBlock  Text=" | " ></TextBlock>
                 <TextBlock Text="{Binding LastUpdate}"></TextBlock>
             </StackPanel>
-            <ListBox Name="lbJournal" ItemTemplate="{StaticResource listNotes}"></ListBox>
-            <TextBox Name="tbNewComm"></TextBox>
+            <ListBox Name="lbJournal" ItemTemplate="{StaticResource listNotes}" Height="250px"></ListBox>
+            <TextBox Name="tbNewComm" TextWrapping="Wrap"></TextBox>
             <Button Name="btnSave" Content="Сохранить" Click="btnSave_Click"></Button>
+            <Button Click="Button_Click">Добавить</Button>
         </StackPanel>
     </Grid>
 </Page>

+ 41 - 3
RedmineOracle/pgIssue.xaml.cs

@@ -1,4 +1,5 @@
-using System;
+using Microsoft.Win32;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -22,19 +23,56 @@ namespace RedmineOracle
     {
         ListIstIssues li;
         int id;
-        public pgIssue(int id)
+        bool flag;
+        public pgIssue(int id, bool flag)
         {
             InitializeComponent();
+            this.flag = flag;
             this.id = id;
             li = new ListIstIssues();
             DataContext = li.currIss(id);
             lbJournal.ItemsSource = li.listNotes(id);
+            
         }
+        
 
         private void btnSave_Click(object sender, RoutedEventArgs e)
         {
-            li.AddNewComm(id,tbNewComm.Text);
+            li.AddNewComm(id, tbNewComm.Text);
             lbJournal.ItemsSource = li.listNotes(id);
         }
+
+        private void Button_Click(object sender, RoutedEventArgs e)
+        {
+            OpenFileDialog ofd = new OpenFileDialog();
+            var result = ofd.ShowDialog();
+            if (result == true)//если файл выбран
+            {
+                li.UploadAttachment(id, ofd.FileName);
+            }
+
+
+        }
+
+        private void TextBlock_Loaded(object sender, RoutedEventArgs e)
+        {
+            TextBlock tb = (TextBlock)sender;
+            OracleWork ow = new OracleWork();
+            if (!flag)
+                if (ow.findLRP(tb.Text) == 1)
+                {
+                    LoadPages.forumFrame.Navigate(new pgLRP(Convert.ToInt32(tb.Text)));
+                }
+        }
+
+        private void btnRefresh_Click(object sender, RoutedEventArgs e)
+        {
+            lbJournal.ItemsSource = li.listNotes(id);
+        }
+
+        private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e)
+        {
+            Clipboard.SetText("http://testred.ru/issues/"+tbIdIss.Text);  
+        }
     }
 }

+ 10 - 6
RedmineOracle/pgLRP.xaml

@@ -15,22 +15,26 @@
                     <TextBlock Text=" | "></TextBlock>
                     <TextBlock Text="{Binding Created}"></TextBlock>
                 </StackPanel>
-                <TextBox Text="{Binding Description}" TextWrapping="WrapWithOverflow"></TextBox>
-                <TextBox Text="{Binding Change}" TextWrapping="WrapWithOverflow" Background="Yellow"></TextBox>
-                <TextBox Text="{Binding SecreteComm}" TextWrapping="WrapWithOverflow" Background="Aqua"></TextBox>
+                <TextBox Text="{Binding Description}" TextWrapping="Wrap" MouseDoubleClick="AddCommToRM"></TextBox>
+                <TextBox Text="{Binding Change}" TextWrapping="Wrap" Background="Yellow" MouseDoubleClick="AddCommToRM"></TextBox>
+                <TextBox Text="{Binding SecreteComm}" TextWrapping="Wrap" Background="Aqua" MouseDoubleClick="AddCommToRM"></TextBox>
+                <TextBlock Text="{Binding CountFile}" Uid="{Binding IdDRP}" MouseDown="TextBlock_MouseDown" Background="BlueViolet"></TextBlock>
             </StackPanel>
         </DataTemplate>
     </Page.Resources>
 
     <Grid>
         <StackPanel>
+            <Button Name="btnCreateIss" Content="Созадть задачу" Click="btnCreateIss_Click"></Button>
             <StackPanel Orientation="Horizontal">
                 <TextBlock Name="tbId" Text="{Binding IdLRP}"></TextBlock>
                 <TextBlock Text="("></TextBlock>
                 <TextBlock Text="{Binding Priority}"></TextBlock>
                 <TextBlock Text=")"></TextBlock>
                 <TextBlock Text=" | "></TextBlock>
-                <TextBlock Text="{Binding MinInfo}"></TextBlock>
+                <TextBlock Name="tbMiniInf" Text="{Binding MinInfo}"></TextBlock>
+                <TextBlock Text=" | "></TextBlock>
+                <TextBlock Name="tbIdIss"></TextBlock>
             </StackPanel>
             <StackPanel Orientation="Horizontal">
                 <TextBlock Text="{Binding TimeStart}"></TextBlock>
@@ -39,10 +43,10 @@
                 <TextBlock Text=" | "></TextBlock>
                 <TextBlock Text="{Binding Respond}"></TextBlock>
                 <TextBlock Text=" | "></TextBlock>
-                <TextBlock Text="{Binding Module}"></TextBlock>
+                <TextBlock Name="tbModule" Text="{Binding Module}"></TextBlock>
             </StackPanel>
             <StackPanel>
-                <TextBox Text="{Binding MinInfo}"  TextWrapping="Wrap"></TextBox>
+                <TextBox Name="tbFullInf" Text="{Binding FullInf}"  TextWrapping="Wrap"></TextBox>
             </StackPanel>
             <ListBox Name="lbComm" ItemTemplate="{StaticResource dtOutComm}" Height="300px"></ListBox>
             <StackPanel Orientation="Horizontal">

+ 29 - 2
RedmineOracle/pgLRP.xaml.cs

@@ -29,13 +29,40 @@ namespace RedmineOracle
             ow = new OracleWork();
             DataContext = ow.CurrentLRP(id);
             lbComm.ItemsSource = ow.CreateListComm(id);
+            tbIdIss.Text = ow.FindRmIssue(id.ToString());
+            if (tbIdIss.Text != "Н/З")
+                LoadPages.rmFrame.Navigate(new pgIssue(Convert.ToInt32(tbIdIss.Text), true));
         }
 
         private void Button_Click(object sender, RoutedEventArgs e)
         {
-            
-            ow.insertComm(Convert.ToInt32(tbId.Text),tbSComm.Text);
+
+            ow.insertComm(Convert.ToInt32(tbId.Text), tbSComm.Text);
             lbComm.ItemsSource = ow.CreateListComm(id);
         }
+
+        private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e)
+        {
+            TextBlock tb = sender as TextBlock;
+            string id = tb.Uid;
+            new windDrpFile(id).ShowDialog();
+        }
+
+        private void AddCommToRM(object sender, MouseButtonEventArgs e)
+        {
+            TextBox tb = (TextBox)sender;
+            ListIstIssues li = new ListIstIssues();
+            li.AddNewComm(Convert.ToInt32(tbIdIss.Text), "Ответ пользователя:\n" + tb.Text);
+        }
+
+        private void btnCreateIss_Click(object sender, RoutedEventArgs e)
+        {
+            new windCreateIssLRP(tbId.Text, tbMiniInf.Text,tbFullInf.Text,tbModule.Text).ShowDialog();
+            if (IdNewIss.id > 0)
+            {
+                tbSComm.Text = "http://testred.ru/issues/" + IdNewIss.id.ToString();
+                tbIdIss.Text = IdNewIss.id.ToString();
+            }
+        }
     }
 }

+ 14 - 3
RedmineOracle/pgListLRP.xaml

@@ -26,7 +26,7 @@
                         <TextBlock Text="{Binding RESPOND}"></TextBlock>
                         <TextBlock Text="{Binding LRP_MINI_INF}"></TextBlock>
                     </StackPanel>
-                    
+
                     <StackPanel Orientation="Horizontal">
                         <TextBlock Text="{Binding TIME_CHANGE}"></TextBlock>
                         <TextBlock Text=" | "></TextBlock>
@@ -34,10 +34,21 @@
                     </StackPanel>
                 </StackPanel>
             </Border>
-            
+
         </DataTemplate>
     </Page.Resources>
     <Grid>
-        <ListBox Name="lbLRP" ItemTemplate="{StaticResource dtListLRP}"></ListBox>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="64*"/>
+            <RowDefinition Height="167*"/>
+            <RowDefinition Height="219*"/>
+        </Grid.RowDefinitions>
+        <StackPanel Orientation="Horizontal">
+            <TextBox Name="tbIdLRP" Width="100px"></TextBox>
+            <Button x:Name="btnFind" Content="Найти ЛРП" Click="btnFind_Click"></Button>
+            <ComboBox Name="tbResrond" TextBoxBase.TextChanged="tbResrond_TextChanged" SelectionChanged="tbResrond_SelectionChanged" IsEditable="True" IsTextSearchEnabled="False"></ComboBox>
+        </StackPanel>
+        <ListBox Name="lbLRPOpen" ItemTemplate="{StaticResource dtListLRP}" Grid.Row="1"></ListBox>
+        <ListBox Name="lbLRP" ItemTemplate="{StaticResource dtListLRP}"  Grid.Row="2"></ListBox>
     </Grid>
 </Page>

+ 97 - 1
RedmineOracle/pgListLRP.xaml.cs

@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using System.Threading;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
@@ -21,12 +22,74 @@ namespace RedmineOracle
     public partial class pgListLRP : Page
     {
         OracleWork ow;
+        Thread refreshTread;
+        Thread refreshOpen;
+        int maxDrp;
+        int maxOpen;
+        int countOpen;
+        int countDrp;
         public pgListLRP()
         {
             InitializeComponent();
             ow = new OracleWork();
-            //lbLRP.ItemsSource = ow.InfoLrpList;
             lbLRP.ItemsSource = ow.dtLrp().DefaultView;
+            lbLRPOpen.ItemsSource = ow.outputOpen().DefaultView;
+            tbResrond.ItemsSource = ow.listUsers();
+            maxDrp = ow.CheckMaxDrp();
+            maxOpen = ow.CheckMaxOpen();
+            countOpen = ow.CheckCountOpen();
+            tbResrond.SelectedValuePath = "Id";
+            tbResrond.DisplayMemberPath = "Name";
+            refreshTread = new Thread(refreshListOther);
+            refreshTread.Start();
+            refreshOpen = new Thread(refreshListOpen);
+            refreshOpen.Start();
+        }
+
+        async void refreshListOther()
+        {
+            while (true)
+            {
+                ow = new OracleWork();
+                if (maxDrp != ow.CheckMaxDrp())
+                {
+                    maxDrp = ow.CheckMaxDrp();
+                    Application.Current.Dispatcher.Invoke(() =>
+                    {
+
+                        if (tbResrond.SelectedIndex == -1)
+                        {
+                            lbLRP.ItemsSource = ow.dtLrp().DefaultView;
+
+                        }
+                        else
+                        {
+                            lbLRP.ItemsSource = ow.findRespondLRP(tbResrond.SelectedValue.ToString()).DefaultView;
+                        }
+
+                    });
+                }
+
+                await Task.Delay(10000);
+            }
+        }
+
+        async void refreshListOpen()
+        {
+            while (true)
+            {
+                ow = new OracleWork();
+                if (maxOpen != ow.CheckMaxOpen() || countOpen != ow.CheckCountOpen())
+                {
+                    Application.Current.Dispatcher.Invoke(() =>
+                    {
+                        lbLRPOpen.ItemsSource = ow.outputOpen().DefaultView;
+                    });
+                    maxOpen = ow.CheckMaxOpen();
+                    countOpen = ow.CheckCountOpen();
+                }
+                await Task.Delay(10000);
+            }
         }
 
         private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e)
@@ -34,5 +97,38 @@ namespace RedmineOracle
             TextBlock tb = (TextBlock)sender;
             LoadPages.forumFrame.Navigate(new pgLRP(Convert.ToInt32(tb.Text)));
         }
+
+        private void btnFind_Click(object sender, RoutedEventArgs e)
+        {
+            if (ow.findLRP(tbIdLRP.Text) == 1)
+            {
+                LoadPages.forumFrame.Navigate(new pgLRP(Convert.ToInt32(tbIdLRP.Text)));
+            }
+            else
+                MessageBox.Show("ЛРП с таким номером не существует!");
+        }
+
+        private void tbResrond_TextChanged(object sender, TextChangedEventArgs e)
+        {
+            if (tbResrond.Text != "")
+            {
+                tbResrond.ItemsSource = ow.listUsers().Where(x => x.Name.Contains(tbResrond.Text));
+
+            }
+            else
+            {
+                tbResrond.ItemsSource = ow.listUsers();
+                tbResrond.SelectedIndex = -1;
+            }
+            tbResrond.SelectedValuePath = "Id";
+            tbResrond.DisplayMemberPath = "Name";
+        }
+
+        private void tbResrond_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            //MessageBox.Show(tbResrond.SelectedValue.ToString());
+            if (tbResrond.SelectedValue != null)
+                lbLRP.ItemsSource = ow.findRespondLRP(tbResrond.SelectedValue.ToString()).DefaultView;
+        }
     }
 }

+ 10 - 2
RedmineOracle/pgRmList.xaml

@@ -35,10 +35,18 @@
                     </StackPanel>
                 </StackPanel>
             </Border>
-            
+
         </DataTemplate>
     </Page.Resources>
     <Grid>
-        <ListBox Name="lbRmIssues" ItemTemplate="{StaticResource tmpList}"></ListBox>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="32*"/>
+            <RowDefinition Height="193*"/>
+        </Grid.RowDefinitions>
+        <StackPanel Grid.Row="0" Orientation="Horizontal">
+            <ComboBox Name="cbRespIss"  SelectionChanged="cbRespIss_SelectionChanged"></ComboBox>
+            <Button Name="btnClear" Click="btnClear_Click" Content="Сбросить"></Button>
+        </StackPanel>
+        <ListBox Name="lbRmIssues" ItemTemplate="{StaticResource tmpList}" Grid.Row="1"></ListBox>
     </Grid>
 </Page>

+ 37 - 13
RedmineOracle/pgRmList.xaml.cs

@@ -25,33 +25,57 @@ namespace RedmineOracle
         public pgRmList()
         {
             InitializeComponent();
-            li=new ListIstIssues();
+            li = new ListIstIssues();
             lbRmIssues.ItemsSource = li.createList();
+            cbRespIss.ItemsSource = li.allUsers();
+            cbRespIss.SelectedValuePath = "Id";
+            cbRespIss.DisplayMemberPath = "UserName";
             Thread refreshTread = new Thread(Refresh);
             refreshTread.Start();
         }
 
         public async void Refresh()
         {
- 
-                while(true)
+
+            while (true)
+            {
+
+                li = new ListIstIssues();
+                Application.Current.Dispatcher.Invoke(() =>
                 {
-                    li = new ListIstIssues();
-                    Application.Current.Dispatcher.Invoke(() =>
+                    if (cbRespIss.SelectedIndex != -1)
                     {
+                        lbRmIssues.ItemsSource = li.getRespondIss(Convert.ToInt32(cbRespIss.SelectedValue.ToString()));
+                    }
+                    else
                         lbRmIssues.ItemsSource = li.createList();
-                    });
-                    await Task.Delay(10000);
-                }
-            
-           
+                });
+                await Task.Delay(10000);
+            }
+
+
         }
-     
+
 
         private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e)
         {
-            TextBlock tb=(TextBlock) sender;
-            LoadPages.rmFrame.Navigate(new pgIssue(Convert.ToInt32(tb.Text)));
+            TextBlock tb = (TextBlock)sender;
+            bool flag = false;
+            LoadPages.rmFrame.Navigate(new pgIssue(Convert.ToInt32(tb.Text),flag));
+        }
+
+        private void cbRespIss_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            if (cbRespIss.SelectedIndex != -1)
+            {
+                lbRmIssues.ItemsSource = li.getRespondIss(Convert.ToInt32(cbRespIss.SelectedValue.ToString()));
+            }
+        }
+
+        private void btnClear_Click(object sender, RoutedEventArgs e)
+        {
+            cbRespIss.SelectedIndex = -1;
+            lbRmIssues.ItemsSource = li.createList();
         }
     }
 }

+ 14 - 0
RedmineOracle/pgTestDonF.xaml

@@ -0,0 +1,14 @@
+<Page x:Class="RedmineOracle.pgTestDonF"
+      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:RedmineOracle"
+      mc:Ignorable="d" 
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="pgTestDonF">
+
+    <Grid>
+        <TextBlock Text="Hello"></TextBlock>
+    </Grid>
+</Page>

+ 31 - 0
RedmineOracle/pgTestDonF.xaml.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace RedmineOracle
+{
+    /// <summary>
+    /// Логика взаимодействия для pgTestDonF.xaml
+    /// </summary>
+    public partial class pgTestDonF : Page
+    {
+        OracleWork ow;
+        public pgTestDonF()
+        {
+            InitializeComponent();
+            ow = new OracleWork();
+            //ow.TestDonD();
+        }
+    }
+}

+ 18 - 0
RedmineOracle/windCreateIssLRP.xaml

@@ -0,0 +1,18 @@
+<Window x:Class="RedmineOracle.windCreateIssLRP"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:RedmineOracle"
+        mc:Ignorable="d"
+        Title="windCreateIssLRP" Height="400" Width="600">
+    <Grid>
+        <StackPanel>
+            <TextBox Name="tbName"></TextBox>
+            <ComboBox Name="cbResponds"></ComboBox>
+            <TextBox Name="tbFullInf"></TextBox>
+            <TextBox Name="tbIdLRP"></TextBox>
+            <Button Name="btnCreate" Content="Создать" Click="btnCreate_Click"></Button>
+        </StackPanel>
+    </Grid>
+</Window>

+ 42 - 0
RedmineOracle/windCreateIssLRP.xaml.cs

@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace RedmineOracle
+{
+    /// <summary>
+    /// Логика взаимодействия для windCreateIssLRP.xaml
+    /// </summary>
+    public partial class windCreateIssLRP : Window
+    {
+        ListIstIssues li;
+        public windCreateIssLRP(string idLRP, string miniInf, string fullInf, string module)
+        {
+            InitializeComponent();
+            li = new ListIstIssues();
+            tbFullInf.Text = fullInf;
+            tbIdLRP.Text = idLRP;
+            tbName.Text = "ЛРП."+ idLRP +"."+ module+"."+ miniInf;
+            cbResponds.ItemsSource = li.allUsers();
+            cbResponds.SelectedValuePath = "Id";
+            cbResponds.DisplayMemberPath = "UserName";
+
+        }
+
+        private void btnCreate_Click(object sender, RoutedEventArgs e)
+        {
+            li.CreateIss(tbIdLRP.Text,tbName.Text,tbFullInf.Text,cbResponds.SelectedValue.ToString());
+            this.Close();
+        }
+    }
+}

+ 22 - 0
RedmineOracle/windDrpFile.xaml

@@ -0,0 +1,22 @@
+<Window x:Class="RedmineOracle.windDrpFile"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:RedmineOracle"
+        mc:Ignorable="d"
+        Title="windDrpFile" Height="300" Width="250">
+    <Window.Resources>
+        <DataTemplate x:Key="dtOutputFile">
+            <Border BorderThickness="1,1,1,1" BorderBrush="Black">
+                <StackPanel>
+                    <TextBlock Text="{Binding Name}"></TextBlock>
+                    <Button Content="Скачать" Click="Button_Click" Uid="{Binding id}"></Button>
+                </StackPanel>
+            </Border>
+        </DataTemplate>
+    </Window.Resources>
+    <Grid>
+        <ListBox Name="lbFile" ItemTemplate="{StaticResource dtOutputFile}"></ListBox>
+    </Grid>
+</Window>

+ 39 - 0
RedmineOracle/windDrpFile.xaml.cs

@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace RedmineOracle
+{
+    /// <summary>
+    /// Логика взаимодействия для windDrpFile.xaml
+    /// </summary>
+    public partial class windDrpFile : Window
+    {
+        OracleWork ow;
+        string id_drp;
+        public windDrpFile(string id_drp)
+        {
+            InitializeComponent();
+            this.id_drp = id_drp;
+            ow = new OracleWork();
+            lbFile.ItemsSource = ow.listFile(id_drp);
+        }
+
+        private void Button_Click(object sender, RoutedEventArgs e)
+        {
+            Button button = sender as Button;
+            string id = button.Uid;
+            ow.TestDonD(id_drp, id);
+        }
+    }
+}

+ 1 - 1
redmine-net-api-master/src/redmine-net-api/Types/Identifiable.cs

@@ -38,7 +38,7 @@ namespace Redmine.Net.Api.Types
         /// Gets the id.
         /// </summary>
         /// <value>The id.</value>
-        public int Id { get; protected set; }
+        public int Id { get;  set; }//protected
         #endregion
 
         #region Implementation of IXmlSerialization