Browse Source

Изменение дизайна

Drenbb 2 years ago
parent
commit
286112ede6

+ 8 - 0
RedmineOracle.sln

@@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RedmineOracle", "RedmineOra
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "redmine-net-api", "redmine-net-api-master\src\redmine-net-api\redmine-net-api.csproj", "{AEC82A67-3C55-475F-B45F-C60DB15F9387}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTestProject1", "UnitTestProject1\UnitTestProject1.csproj", "{5A7A50BF-691D-434F-9EF5-6366ED40E7E8}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -26,6 +28,12 @@ Global
 		{AEC82A67-3C55-475F-B45F-C60DB15F9387}.DebugJson|Any CPU.Build.0 = DebugJson|Any CPU
 		{AEC82A67-3C55-475F-B45F-C60DB15F9387}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{AEC82A67-3C55-475F-B45F-C60DB15F9387}.Release|Any CPU.Build.0 = Release|Any CPU
+		{5A7A50BF-691D-434F-9EF5-6366ED40E7E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{5A7A50BF-691D-434F-9EF5-6366ED40E7E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{5A7A50BF-691D-434F-9EF5-6366ED40E7E8}.DebugJson|Any CPU.ActiveCfg = Debug|Any CPU
+		{5A7A50BF-691D-434F-9EF5-6366ED40E7E8}.DebugJson|Any CPU.Build.0 = Debug|Any CPU
+		{5A7A50BF-691D-434F-9EF5-6366ED40E7E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{5A7A50BF-691D-434F-9EF5-6366ED40E7E8}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 8 - 1
RedmineOracle/App.xaml

@@ -4,6 +4,13 @@
              xmlns:local="clr-namespace:RedmineOracle"
              StartupUri="MainWindow.xaml">
     <Application.Resources>
-         
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" />
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
     </Application.Resources>
 </Application>

+ 12 - 13
RedmineOracle/ListIstIssues.cs

@@ -18,6 +18,7 @@ namespace RedmineOracle
     {
         public struct JournaleNotes
         {
+            public int idNote { get; set; }
             public string NoteAuthor { get; set; }
             public string NoteDescription { get; set; }
             public DateTime CreatedOn { get; set; }
@@ -60,29 +61,28 @@ namespace RedmineOracle
             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());
@@ -90,7 +90,7 @@ namespace RedmineOracle
             Issue issues = a.GetObject<Issue>(idIssue.ToString(), parameters);
             issues.Uploads = attachments;
             a.UpdateObject(issues.Id.ToString(), issues);
-            //get project
+            
 
         }
 
@@ -225,7 +225,6 @@ namespace RedmineOracle
             IList<Issue> issues = a.GetObjects<Issue>(parameters);
             foreach (var issue in issues)
             {
-
                 issue2.Id = issue.Id;
                 issue2.Name = issue.Subject;
                 issue2.Description = issue.Description;
@@ -280,6 +279,7 @@ namespace RedmineOracle
                         JournaleNotes jn = new JournaleNotes();
                         if (journal.Notes != "")
                         {
+                            jn.idNote = journal.Id;
                             jn.NoteAuthor = journal.User.Name;
                             jn.NoteDescription = journal.Notes;
                             jn.CreatedOn = Convert.ToDateTime(journal.CreatedOn);
@@ -329,9 +329,8 @@ namespace RedmineOracle
                 Description = FullInf,
                 Project = new IdentifiableName { Id = 5 },
                 StartDate = DateTime.Now,
-                CreatedOn = DateTime.Now,                         // Дата создание
-                //DueDate = DateTime.Now,                           // Дата окончания
-                Tracker = new IdentifiableName { Id = 1 },        // Трекер
+                CreatedOn = DateTime.Now,                         
+                Tracker = new IdentifiableName { Id = 1 },        
                 Status = new IdentifiableName { Id = 1 },
                 Priority = new IdentifiableName { Id = 1 },
                 CustomFields = fields,

+ 2 - 1
RedmineOracle/MainWindow.xaml

@@ -5,7 +5,8 @@
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:local="clr-namespace:RedmineOracle"
         mc:Ignorable="d"
-        Title="MainWindow" Height="450" Width="800">
+        Title="MainWindow" Height="450" Width="800"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes">
    
     <Grid>
         <Grid.ColumnDefinitions>

+ 163 - 17
RedmineOracle/OracleWork.cs

@@ -16,6 +16,11 @@ namespace RedmineOracle
         DbProviderFactory factory;
         DbConnection connection;
 
+        public struct StatusInfo
+        {
+            public string idStatus { get; set; }
+            public string statusName { get; set; }
+        }
         public struct FileInfo
         {
             public string id { get; set; }
@@ -56,6 +61,7 @@ namespace RedmineOracle
             public OracleNumber TimeWorke { get; set; }
             public string Respond { get; set; }
             public string FullInf { get; set; }
+            public string CountFileLRP { get; set; }
         }
         OracleConnection oracleConnection;
         public OracleWork()
@@ -72,6 +78,62 @@ namespace RedmineOracle
         }
 
 
+        public void updateStatus(string idLrp,string currSt,string newSt,string idSt)
+        {
+            if (oracleConnection.State != ConnectionState.Open)
+                oracleConnection.Open();
+            string updStatus = "update fault_data set lrp_status_id =" + idSt + " where lrp_id = " + idLrp;
+            OracleCommand upd = new OracleCommand(updStatus, oracleConnection);
+            upd.ExecuteNonQuery();
+            oracleConnection.Close();
+            string comm = "Изменение `Статус`: `" + currSt + "`->`" + newSt + "`";
+            insertComm(Convert.ToInt32(idLrp),"",comm);
+        }
+
+        public List<StatusInfo> getAllStatus(string currSt)
+        {
+            List<StatusInfo> allSt = new List<StatusInfo>();
+
+            string findCurrSt = "Select lrp_status_id,lrp_status_name from lrp_status where lrp_status_name like '" + currSt + "'";
+
+
+            string findAllS = "Select lrp_status_id,lrp_status_name from lrp_status where lrp_status_name not like '%Test%' and lrp_status_name not like '" + currSt + "'";
+            if (oracleConnection.State != ConnectionState.Open)
+                oracleConnection.Open();
+            OracleCommand cmdCurrS = new OracleCommand(findCurrSt, oracleConnection);
+
+            OracleDataReader rearCurr = cmdCurrS.ExecuteReader();
+            while (rearCurr.Read())
+            {
+                StatusInfo si = new StatusInfo();
+                si.idStatus = rearCurr[0].ToString();
+                si.statusName = rearCurr[1].ToString();
+                allSt.Add(si);
+            }
+            OracleCommand oracleCommand = new OracleCommand(findAllS, oracleConnection);
+
+            OracleDataReader reader;
+            if (oracleConnection.State != ConnectionState.Open)
+            {
+                oracleConnection.Open();
+                reader = oracleCommand.ExecuteReader();
+            }
+            else
+            {
+                reader = oracleCommand.ExecuteReader();
+            }
+            while (reader.Read())
+            {
+                StatusInfo si = new StatusInfo();
+                si.idStatus = reader[0].ToString();
+                si.statusName = reader[1].ToString();
+                allSt.Add(si);
+            }
+            reader.Close();
+            oracleConnection.Close();
+            return allSt;
+        }
+
         public string FindRmIssue(string idLRP)
         {
             string iss = "Н/З";
@@ -93,6 +155,7 @@ namespace RedmineOracle
                 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;
@@ -105,6 +168,8 @@ namespace RedmineOracle
                 oracleConnection.Open();
             string commDon = "select Max(lrp_id) from fault_data where lrp_status_id in(1)";
             OracleCommand cmd = new OracleCommand(commDon, oracleConnection);
+            if (oracleConnection.State != ConnectionState.Open)
+                oracleConnection.Open();
             max = Convert.ToInt32(cmd.ExecuteScalar());
             oracleConnection.Close();
             return max;
@@ -117,6 +182,8 @@ namespace RedmineOracle
                 oracleConnection.Open();
             string commDon = "select Count(lrp_id) from fault_data where lrp_status_id in(1)";
             OracleCommand cmd = new OracleCommand(commDon, oracleConnection);
+            if (oracleConnection.State == ConnectionState.Closed)
+                oracleConnection.Open();
             count = Convert.ToInt32(cmd.ExecuteScalar());
             oracleConnection.Close();
             return count;
@@ -146,6 +213,30 @@ namespace RedmineOracle
             return fi;
         }
 
+        public List<FileInfo> listFileLRP(string id_lrp)
+        {
+            List<FileInfo> fi = new List<FileInfo>();
+            if (oracleConnection.State != ConnectionState.Open)
+                oracleConnection.Open();
+            string commDon = "select LRP_ID,LRP_BLOB,LRP_INF, TYPE_FILE from lrp_file where lrp_id =" + id_lrp;
+            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)
@@ -163,12 +254,29 @@ namespace RedmineOracle
             oracleConnection.Close();
         }
 
+        public void DonLRPFIle(string id, string id_file)
+        {
+            if (oracleConnection.State != ConnectionState.Open)
+                oracleConnection.Open();
+            FileInfo fileInfo = listFileLRP(id).FirstOrDefault(x => x.id == id_file);
+            string commDon = "select LRP_BLOB from LRP_FILE where lrp_id =" + id + " and lrp_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();
+            if (oracleConnection.State != ConnectionState.Open)
+                oracleConnection.Open();
             OracleCommand comd = new OracleCommand(commUsers, oracleConnection);
             OracleDataReader reader = comd.ExecuteReader();
             while (reader.Read())
@@ -246,19 +354,37 @@ namespace RedmineOracle
             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++)
 
+            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, " +
+                string commandCount = "Select Count(drp_change) from lrp_drp where lrp_id = " + dt1.Rows[i].ItemArray[0].ToString();
+                OracleCommand command2 = new OracleCommand(commandCount, oracleConnection);
+                command1.CommandText = "";
+                if (oracleConnection.State != ConnectionState.Open)
+                    oracleConnection.Open();
+                if (Convert.ToInt32(command2.ExecuteScalar()) > 0)
+                {
+                    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) " +
+                    "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_change = (select MAX(t.time_change) " +
                     "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";
+                }
+                else
+                {
+                    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, " +
+                        "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, 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 = " +
+                        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
                 {
@@ -397,11 +523,13 @@ namespace RedmineOracle
         public InfoLrp CurrentLRP(int id)
         {
             InfoLrp currLRP = new InfoLrp();
-            string commCurr = "select ft.lrp_id,ft.lrp_prioritet_id,ft.lrp_mini_inf,lsl.system_name,ls.lrp_status_name,ft.lrp_time_open, ft.Time_Worke,t.time_create,t.drp_change,u.Lastname,u.Firstname,u.Secondname,us.Lastname,us.Firstname,us.Secondname,ft.lrp_inf " +
-                "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 =" + id + ") and ft.lrp_id =" + id + "" +
+            string commCurr = commCurr = "select ft.lrp_id,ft.lrp_prioritet_id,ft.lrp_mini_inf,lsl.system_name,ls.lrp_status_name,ft.lrp_time_open, ft.Time_Worke,u.Lastname,u.Firstname,u.Secondname,us.Lastname,us.Firstname,us.Secondname,ft.lrp_inf " +
+                "from fault_data ft, lrp_system_list lsl,lrp_status ls,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 =" + id + "" +
                 " and ft.lrp_opener = u.user_id and ft.lrp_respondent_id = us.user_id";
-            oracleConnection.Open();
+            if (oracleConnection.State != ConnectionState.Open)
+                oracleConnection.Open();
+            //oracleConnection.Open();
             OracleCommand comd = new OracleCommand(commCurr, oracleConnection);
             OracleDataReader reader = comd.ExecuteReader();
             while (reader.Read())
@@ -413,11 +541,12 @@ namespace RedmineOracle
                 currLRP.Status = reader[4].ToString();
                 currLRP.TimeStart = Convert.ToDateTime(reader[5].ToString());
                 currLRP.TimeWorke = reader.GetOracleNumber(6);
-                currLRP.LastCommentDate = Convert.ToDateTime(reader[7].ToString());
-                currLRP.LastComment = reader[8].ToString();
-                currLRP.LRPAuthor = reader[9].ToString() + " " + reader[10].ToString() + " " + reader[11].ToString();
-                currLRP.Respond = reader[12].ToString() + " " + reader[13].ToString() + " " + reader[14].ToString();
-                currLRP.FullInf = reader[15].ToString();
+                currLRP.LRPAuthor = reader[7].ToString() + " " + reader[8].ToString() + " " + reader[9].ToString();
+                currLRP.Respond = reader[10].ToString() + " " + reader[11].ToString() + " " + reader[12].ToString();
+                currLRP.FullInf = reader[13].ToString();
+                string findFileComm = "Select Count(*) from lrp_file where lrp_id = " + id.ToString();
+                OracleCommand findCount = new OracleCommand(findFileComm, oracleConnection);
+                currLRP.CountFileLRP = findCount.ExecuteScalar().ToString();
             }
             oracleConnection.Close();
             return currLRP;
@@ -449,11 +578,28 @@ namespace RedmineOracle
             return lComm;
         }
 
-        public void insertComm(int id_lrp, string comm_s)
+        public string InserCommToRB(int idDRP)
+        {
+            string comm = "";
+            if (oracleConnection.State != ConnectionState.Open)
+                oracleConnection.Open();
+            string commComment = "Select DRP_AVTOR,DRP_CHANGE,SECRET_COMMENTS from lrp_drp where drp_id =" + idDRP;
+            OracleCommand comd = new OracleCommand(commComment, oracleConnection);
+            OracleDataReader reader = comd.ExecuteReader();
+            while (reader.Read())
+            {
+                comm = "Автор " + reader[0].ToString() + "\n" + "Комментарий " + reader[1].ToString();
+            }
+            reader.Close();
+            oracleConnection.Close();
+            return comm;
+        }
+
+        public void insertComm(int id_lrp, string comm_s, string comm)
         {
             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 + "')";
+            string insertComm = "insert into lrp_drp t (t.drp_id, t.lrp_id, t.drp_avtor, t.secret_comments,drp_change,time_change) " +
+                "values((select max(drp_id) + 1 from lrp_drp),  " + id_lrp + ", '" + infoAuth.loginForum + "', '" + comm_s + "','" + comm + "',to_date('" + DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss") + "','dd.mm.yyyy HH24:mi:ss'))";
             OracleCommand comd = new OracleCommand(insertComm, oracleConnection);
             comd.ExecuteNonQuery();
             oracleConnection.Close();

+ 16 - 0
RedmineOracle/RedmineOracle.csproj

@@ -53,6 +53,12 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="MaterialDesignColors, Version=2.0.6.0, Culture=neutral, PublicKeyToken=df2a72020bd7962a, processorArchitecture=MSIL">
+      <HintPath>..\packages\MaterialDesignColors.2.0.6\lib\net452\MaterialDesignColors.dll</HintPath>
+    </Reference>
+    <Reference Include="MaterialDesignThemes.Wpf, Version=4.5.0.0, Culture=neutral, PublicKeyToken=df2a72020bd7962a, processorArchitecture=MSIL">
+      <HintPath>..\packages\MaterialDesignThemes.4.5.0\lib\net452\MaterialDesignThemes.Wpf.dll</HintPath>
+    </Reference>
     <Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
       <HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.6.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
     </Reference>
@@ -107,6 +113,7 @@
     </ApplicationDefinition>
     <Compile Include="classes\IdNewIss.cs" />
     <Compile Include="classes\infoAuth.cs" />
+    <Compile Include="classes\ListInfo.cs" />
     <Compile Include="classes\LoadPages.cs" />
     <Compile Include="OracleWork.cs" />
     <Compile Include="pgAuthForum.xaml.cs">
@@ -133,6 +140,9 @@
     <Compile Include="windDrpFile.xaml.cs">
       <DependentUpon>windDrpFile.xaml</DependentUpon>
     </Compile>
+    <Compile Include="windLRPFile.xaml.cs">
+      <DependentUpon>windLRPFile.xaml</DependentUpon>
+    </Compile>
     <Page Include="MainWindow.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
@@ -182,6 +192,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="windLRPFile.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="pgTestDonF.xaml.cs">
@@ -244,5 +258,7 @@
       <ErrorText>Данный проект ссылается на пакеты NuGet, отсутствующие на этом компьютере. Используйте восстановление пакетов NuGet, чтобы скачать их.  Дополнительную информацию см. по адресу: http://go.microsoft.com/fwlink/?LinkID=322105. Отсутствует следующий файл: {0}.</ErrorText>
     </PropertyGroup>
     <Error Condition="!Exists('..\packages\System.Text.Json.6.0.0\build\System.Text.Json.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Text.Json.6.0.0\build\System.Text.Json.targets'))" />
+    <Error Condition="!Exists('..\packages\MaterialDesignThemes.4.5.0\build\MaterialDesignThemes.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MaterialDesignThemes.4.5.0\build\MaterialDesignThemes.targets'))" />
   </Target>
+  <Import Project="..\packages\MaterialDesignThemes.4.5.0\build\MaterialDesignThemes.targets" Condition="Exists('..\packages\MaterialDesignThemes.4.5.0\build\MaterialDesignThemes.targets')" />
 </Project>

+ 15 - 0
RedmineOracle/classes/ListInfo.cs

@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Controls;
+
+namespace RedmineOracle
+{
+    public class ListInfo
+    {
+        public static ListBox lbRedmine;
+        public static ListBox lbForum;
+    }
+}

+ 2 - 0
RedmineOracle/classes/infoAuth.cs

@@ -12,5 +12,7 @@ namespace RedmineOracle
         public static string passwordRm;
         public static string loginForum;
         public static string passwordForum;
+        public static bool isAuthForum = false;
+        public static bool isAuthRM = false;
     }
 }

+ 2 - 0
RedmineOracle/packages.config

@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <packages>
+  <package id="MaterialDesignColors" version="2.0.6" targetFramework="net472" />
+  <package id="MaterialDesignThemes" version="4.5.0" targetFramework="net472" />
   <package id="Microsoft.Bcl.AsyncInterfaces" version="6.0.0" targetFramework="net472" />
   <package id="Oracle.ManagedDataAccess" version="21.5.0" targetFramework="net472" />
   <package id="System.Buffers" version="4.5.1" targetFramework="net472" />

+ 6 - 8
RedmineOracle/pgAuthForum.xaml

@@ -6,16 +6,14 @@
       xmlns:local="clr-namespace:RedmineOracle"
       mc:Ignorable="d" 
       d:DesignHeight="450" d:DesignWidth="800"
-      Title="pgAuthForum">
-
+      Title="pgAuthForum"
+      xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes">
     <Grid>
         <StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center">
-            <GroupBox  Header="Логин" Width="200" Height="50">
-                <TextBox x:Name="tbLogin"/>
-            </GroupBox>
-            <GroupBox Header="Пароль" Width="200" Height="50">
-                <TextBox x:Name="tbPass"/>
-            </GroupBox>
+
+            <TextBox x:Name="tbLogin"  materialDesign:HintAssist.Hint="Логин" Width="200px"/>
+            <TextBox x:Name="tbPass" materialDesign:HintAssist.Hint="Пароль" Width="200px" Margin="0 15"/>
+            
             <Button x:Name="btnAuth" Content="Войти" Click="btnAuth_Click"/>
         </StackPanel>
     </Grid>

+ 1 - 0
RedmineOracle/pgAuthForum.xaml.cs

@@ -40,6 +40,7 @@ namespace RedmineOracle
                 LoadPages.forumFrame.Navigate(new pgListLRP());
                 infoAuth.loginForum = tbLogin.Text;
                 infoAuth.passwordForum = tbPass.Text;
+                infoAuth.isAuthForum = true;
             }
             else
                 MessageBox.Show("Неправильные учетные данные!");

+ 5 - 8
RedmineOracle/pgAuthRm.xaml

@@ -6,17 +6,14 @@
       xmlns:local="clr-namespace:RedmineOracle"
       mc:Ignorable="d" 
       d:DesignHeight="450" d:DesignWidth="800"
-      Title="pgAuthRm">
+      Title="pgAuthRm"
+      xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes">
 
     <Grid>
         <StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center">
-            <GroupBox  Header="Логин" Width="200" Height="50">
-                <TextBox x:Name="tbLogin"/>
-            </GroupBox>
-            <GroupBox Header="Пароль" Width="200" Height="50">
-                <TextBox x:Name="tbPass"/>
-            </GroupBox>
-            <Button x:Name="btnAuth" Content="Войти" Click="btnAuth_Click"/>
+            <TextBox x:Name="tbLogin" materialDesign:HintAssist.Hint="Логин" Width="200px"/>
+            <TextBox x:Name="tbPass"  materialDesign:HintAssist.Hint="Пароль" Width="200px" Margin="0 15"/>
+            <Button x:Name="btnAuth" Content="Войти" Click="btnAuth_Click" />
         </StackPanel>
     </Grid>
 </Page>

+ 1 - 0
RedmineOracle/pgAuthRm.xaml.cs

@@ -44,6 +44,7 @@ namespace RedmineOracle
                     var host = "http://testred.ru/";       
                     var a = new RedmineManager(host, login, pass);
                     User currUser = a.GetCurrentUser();
+                    infoAuth.isAuthForum = true;
                     Application.Current.Dispatcher.Invoke(() =>
                     {
                         LoadPages.rmFrame.Navigate(new pgRmList());

+ 11 - 8
RedmineOracle/pgIssue.xaml

@@ -6,17 +6,20 @@
       xmlns:local="clr-namespace:RedmineOracle"
       mc:Ignorable="d" 
       d:DesignHeight="450" d:DesignWidth="800"
-      Title="pgIssue">
+      Title="pgIssue"
+      xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes">
     <Page.Resources>
         <DataTemplate x:Key="listNotes">
             <StackPanel>
-               
-                <StackPanel Orientation="Horizontal">
-                    <TextBlock Text="{Binding NoteAuthor}"></TextBlock>
-                    <TextBlock  Text=" | " ></TextBlock>
-                    <TextBlock Text="{Binding CreatedOn}"></TextBlock>
+                <StackPanel>
+                    <StackPanel Orientation="Horizontal">
+                        <TextBlock Text="{Binding NoteAuthor}"></TextBlock>
+                        <TextBlock  Text=" | " ></TextBlock>
+                        <TextBlock Text="{Binding CreatedOn}"></TextBlock>
+                    </StackPanel>
+                    <TextBox Text="{Binding NoteDescription}" TextWrapping="Wrap"></TextBox>
                 </StackPanel>
-                <TextBox Text="{Binding NoteDescription}" TextWrapping="Wrap"></TextBox>
+                <Button Uid="{Binding idNote}" Name="btnAddComm" Click="btnAddComm_Click">Перенести</Button>
             </StackPanel>
         </DataTemplate>
     </Page.Resources>
@@ -38,7 +41,7 @@
                 <TextBlock  Text=" | " ></TextBlock>
                 <TextBlock Text="{Binding Project}"></TextBlock>
                 <TextBlock  Text=" | " ></TextBlock>
-                <TextBlock  Text="{Binding idLRP}" Loaded="TextBlock_Loaded"></TextBlock>
+                <TextBlock Name="tbIdLRP" Text="{Binding idLRP}" Loaded="TextBlock_Loaded"></TextBlock>
             </StackPanel>
             <TextBlock Text="{Binding Description}"></TextBlock>
             <StackPanel Orientation="Horizontal">

+ 21 - 3
RedmineOracle/pgIssue.xaml.cs

@@ -22,19 +22,22 @@ namespace RedmineOracle
     public partial class pgIssue : Page
     {
         ListIstIssues li;
+        OracleWork ow;
         int id;
         bool flag;
         public pgIssue(int id, bool flag)
         {
             InitializeComponent();
+            ow = new OracleWork();
             this.flag = flag;
             this.id = id;
             li = new ListIstIssues();
             DataContext = li.currIss(id);
             lbJournal.ItemsSource = li.listNotes(id);
-            
+            ListInfo.lbRedmine = lbJournal;
+
         }
-        
+
 
         private void btnSave_Click(object sender, RoutedEventArgs e)
         {
@@ -72,7 +75,22 @@ namespace RedmineOracle
 
         private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e)
         {
-            Clipboard.SetText("http://testred.ru/issues/"+tbIdIss.Text);  
+            Clipboard.SetText("http://testred.ru/issues/" + tbIdIss.Text);
+            MessageBox.Show("Номер задачи скопирован в буфер обмена!");
+        }
+
+        private void btnAddComm_Click(object sender, RoutedEventArgs e)
+        {
+            Button btn = (Button)sender;
+            int idNote = Convert.ToInt32(btn.Uid);
+            MessageBoxResult result = MessageBox.Show("Внести изменнения?", "Внесение изменений", MessageBoxButton.YesNo, MessageBoxImage.Information);
+            if (result == MessageBoxResult.Yes)
+            {
+                ListIstIssues.JournaleNotes jn = new ListIstIssues.JournaleNotes();
+                jn = li.listNotes(id).FirstOrDefault(x => x.idNote == idNote);
+                ow.insertComm(Convert.ToInt32(tbIdLRP.Text), "", jn.NoteDescription);
+                ListInfo.lbForum.ItemsSource = ow.CreateListComm(Convert.ToInt32(tbIdLRP.Text));
+            }
         }
     }
 }

+ 25 - 10
RedmineOracle/pgLRP.xaml

@@ -6,7 +6,8 @@
       xmlns:local="clr-namespace:RedmineOracle"
       mc:Ignorable="d" 
       d:DesignHeight="450" d:DesignWidth="800"
-      Title="pgLRP">
+      Title="pgLRP"
+      xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes">
     <Page.Resources>
         <DataTemplate x:Key="dtOutComm">
             <StackPanel>
@@ -19,19 +20,29 @@
                 <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>
+                <Button Uid="{Binding IdDRP}" Name="btnInsert" Click="btnInsert_Click">Перенсти</Button >
             </StackPanel>
         </DataTemplate>
     </Page.Resources>
 
     <Grid>
-        <StackPanel>
-            <Button Name="btnCreateIss" Content="Созадть задачу" Click="btnCreateIss_Click"></Button>
-            <StackPanel Orientation="Horizontal">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="121*"/>
+            <RowDefinition Height="266*"/>
+            <RowDefinition Height="63*"/>
+        </Grid.RowDefinitions>
+        <StackPanel Grid.Row="0">
+            <Button Name="btnCreateIss" Content="Созадть задачу" Click="btnCreateIss_Click" ></Button>
+            <Button Name="btnRefreshComm" Content="Обновить" Click="btnRefreshComm_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>
+                <ComboBox Name="cbStatus" SelectionChanged="cbStatus_SelectionChanged"></ComboBox>
+                <TextBlock Text=" | "></TextBlock>
+                <TextBlock Text=" | "></TextBlock>
                 <TextBlock Name="tbMiniInf" Text="{Binding MinInfo}"></TextBlock>
                 <TextBlock Text=" | "></TextBlock>
                 <TextBlock Name="tbIdIss"></TextBlock>
@@ -48,14 +59,18 @@
             <StackPanel>
                 <TextBox Name="tbFullInf" Text="{Binding FullInf}"  TextWrapping="Wrap"></TextBox>
             </StackPanel>
-            <ListBox Name="lbComm" ItemTemplate="{StaticResource dtOutComm}" Height="300px"></ListBox>
+            <TextBlock Text="{Binding CountFileLRP}" Uid="{Binding IdLRP}" Name="tbDonFile" MouseDown="tbDonFile_MouseDown" Background="BlueViolet"></TextBlock>
+        </StackPanel>
+        <ListBox Name="lbComm" ItemTemplate="{StaticResource dtOutComm}" Grid.Row="1"></ListBox>
+        <StackPanel Grid.Row="2">
             <StackPanel Orientation="Horizontal">
-                <TextBlock Text="Комментарий"></TextBlock>
-                <TextBox></TextBox>
-                <TextBlock  Text="Скр.Комментарий"></TextBlock>
-                <TextBox Name="tbSComm"></TextBox>
-                <Button Click="Button_Click">Занести</Button>
+                <TextBlock Text="Комментарий" Margin="0 0 10 0 "></TextBlock>
+                <TextBox Name="tbComm" AcceptsReturn="True" MinWidth="100px"></TextBox>
+                <TextBlock  Text="Скр.Комментарий" Margin="0 0 10 0 "></TextBlock>
+                <TextBox Name="tbSComm" AcceptsReturn="True" MinWidth="100px"></TextBox>
             </StackPanel>
+            <Button Click="Button_Click">Занести</Button>
         </StackPanel>
+
     </Grid>
 </Page>

+ 77 - 9
RedmineOracle/pgLRP.xaml.cs

@@ -22,23 +22,40 @@ namespace RedmineOracle
     {
         OracleWork ow;
         int id;
+        int check;
+        string currSt;
+        ListIstIssues li;
+
+        List<OracleWork.StatusInfo> statuses;
         public pgLRP(int id)
         {
             InitializeComponent();
+            check = 0;
             this.id = id;
             ow = new OracleWork();
+            li = new ListIstIssues();
             DataContext = ow.CurrentLRP(id);
+            statuses = ow.getAllStatus(ow.CurrentLRP(id).Status);
+            cbStatus.ItemsSource = ow.getAllStatus(ow.CurrentLRP(id).Status);
+            cbStatus.SelectedValuePath = "idStatus";
+            cbStatus.DisplayMemberPath = "statusName";
+            cbStatus.SelectedIndex = 0;
+            currSt = cbStatus.SelectedValue.ToString();
             lbComm.ItemsSource = ow.CreateListComm(id);
             tbIdIss.Text = ow.FindRmIssue(id.ToString());
             if (tbIdIss.Text != "Н/З")
                 LoadPages.rmFrame.Navigate(new pgIssue(Convert.ToInt32(tbIdIss.Text), true));
+
+            ListInfo.lbForum = lbComm;
         }
 
         private void Button_Click(object sender, RoutedEventArgs e)
         {
-
-            ow.insertComm(Convert.ToInt32(tbId.Text), tbSComm.Text);
+            ow.insertComm(Convert.ToInt32(tbId.Text), tbSComm.Text, tbComm.Text);
             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 TextBlock_MouseDown(object sender, MouseButtonEventArgs e)
@@ -50,19 +67,70 @@ namespace RedmineOracle
 
         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)
+            new windCreateIssLRP(tbId.Text, tbMiniInf.Text, tbFullInf.Text, tbModule.Text).ShowDialog();
+            tbIdIss.Text = ow.FindRmIssue(id.ToString());
+            if (tbIdIss.Text != "Н/З")
+                LoadPages.rmFrame.Navigate(new pgIssue(Convert.ToInt32(tbIdIss.Text), true));
+        }
+
+        private void btnInsert_Click(object sender, RoutedEventArgs e)
+        {
+            Button btn = sender as Button;
+            int idDRP = Convert.ToInt32(btn.Uid);
+            MessageBoxResult result = MessageBox.Show("Внести изменнения?", "Внесение изменений", MessageBoxButton.YesNo, MessageBoxImage.Information);
+            if (result == MessageBoxResult.Yes)
+            {
+                if (tbIdIss.Text != "Н/З")
+                {
+                    ListIstIssues li = new ListIstIssues();
+                    li.AddNewComm(Convert.ToInt32(tbIdIss.Text), ow.InserCommToRB(idDRP));
+                    ListInfo.lbRedmine.ItemsSource = li.listNotes(Convert.ToInt32(tbIdIss.Text));
+                }
+                else
+                    MessageBox.Show("Для данной проблемы нет связной задачи !");
+            }
+        }
+
+        private void tbDonFile_MouseDown(object sender, MouseButtonEventArgs e)
+        {
+            TextBlock tb = sender as TextBlock;
+            string id = tb.Uid;
+            new windLRPFile(id).ShowDialog();
+        }
+
+        private void btnRefreshComm_Click(object sender, RoutedEventArgs e)
+        {
+            ow = new OracleWork();
+            lbComm.ItemsSource = ow.CreateListComm(id);
+        }
+
+        private void cbStatus_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            if (check > 0)
             {
-                tbSComm.Text = "http://testred.ru/issues/" + IdNewIss.id.ToString();
-                tbIdIss.Text = IdNewIss.id.ToString();
+                MessageBoxResult result = MessageBox.Show("Внести изменнения?", "Внесение изменений", MessageBoxButton.YesNo, MessageBoxImage.Information);
+                if (result == MessageBoxResult.Yes)
+                {
+                    OracleWork.StatusInfo curr = statuses.FirstOrDefault(x => x.idStatus == currSt);
+                    OracleWork.StatusInfo newS = statuses.FirstOrDefault(x => x.idStatus == cbStatus.SelectedValue.ToString());
+                    string currS = curr.statusName;
+                    string newSt = newS.statusName;
+                    ow.updateStatus(tbId.Text, currS, newSt, cbStatus.SelectedValue.ToString());
+                    currSt = cbStatus.SelectedValue.ToString();
+
+                }
+                else
+                {
+                    check = 0;
+                    cbStatus.SelectedIndex = 0;
+                }
+                check++;
             }
+            check++;
         }
     }
 }

+ 5 - 3
RedmineOracle/pgListLRP.xaml

@@ -6,7 +6,8 @@
       xmlns:local="clr-namespace:RedmineOracle"
       mc:Ignorable="d" 
       d:DesignHeight="450" d:DesignWidth="800"
-      Title="pgListLRP">
+      Title="pgListLRP"
+      xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes">
     <Page.Resources>
         <DataTemplate x:Key="dtListLRP">
             <Border BorderBrush="Black" BorderThickness="1,1">
@@ -44,9 +45,10 @@
             <RowDefinition Height="219*"/>
         </Grid.RowDefinitions>
         <StackPanel Orientation="Horizontal">
-            <TextBox Name="tbIdLRP" Width="100px"></TextBox>
-            <Button x:Name="btnFind" Content="Найти ЛРП" Click="btnFind_Click"></Button>
+            <TextBox Name="tbIdLRP" Width="100px" Height="60px"></TextBox>
+            <Button x:Name="btnFind" Content="Найти ЛРП" Click="btnFind_Click" Width="100px" Height="60px"></Button>
             <ComboBox Name="tbResrond" TextBoxBase.TextChanged="tbResrond_TextChanged" SelectionChanged="tbResrond_SelectionChanged" IsEditable="True" IsTextSearchEnabled="False"></ComboBox>
+            <ComboBox Name="cbStatus"></ComboBox>
         </StackPanel>
         <ListBox Name="lbLRPOpen" ItemTemplate="{StaticResource dtListLRP}" Grid.Row="1"></ListBox>
         <ListBox Name="lbLRP" ItemTemplate="{StaticResource dtListLRP}"  Grid.Row="2"></ListBox>

+ 5 - 0
RedmineOracle/pgListLRP.xaml.cs

@@ -44,6 +44,9 @@ namespace RedmineOracle
             refreshTread.Start();
             refreshOpen = new Thread(refreshListOpen);
             refreshOpen.Start();
+            //cbStatus.ItemsSource = ow.getAllStatus();
+            //cbStatus.SelectedValuePath = "idStatus";
+            //cbStatus.DisplayMemberPath = "statusName";
         }
 
         async void refreshListOther()
@@ -95,7 +98,9 @@ namespace RedmineOracle
         private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e)
         {
             TextBlock tb = (TextBlock)sender;
+            MessageBox.Show(lbLRP.Items.Count.ToString());
             LoadPages.forumFrame.Navigate(new pgLRP(Convert.ToInt32(tb.Text)));
+            
         }
 
         private void btnFind_Click(object sender, RoutedEventArgs e)

+ 2 - 1
RedmineOracle/pgRmList.xaml

@@ -6,7 +6,8 @@
       xmlns:local="clr-namespace:RedmineOracle"
       mc:Ignorable="d" 
       d:DesignHeight="450" d:DesignWidth="800"
-      Title="pgRmList">
+      Title="pgRmList"
+      xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes">
     <Page.Resources>
         <DataTemplate x:Key="tmpList">
             <Border BorderBrush="Black" BorderThickness="1,1">

+ 2 - 1
RedmineOracle/pgTestDonF.xaml

@@ -6,7 +6,8 @@
       xmlns:local="clr-namespace:RedmineOracle"
       mc:Ignorable="d" 
       d:DesignHeight="450" d:DesignWidth="800"
-      Title="pgTestDonF">
+      Title="pgTestDonF"
+      xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes">
 
     <Grid>
         <TextBlock Text="Hello"></TextBlock>

+ 2 - 1
RedmineOracle/windCreateIssLRP.xaml

@@ -5,7 +5,8 @@
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:local="clr-namespace:RedmineOracle"
         mc:Ignorable="d"
-        Title="windCreateIssLRP" Height="400" Width="600">
+        Title="windCreateIssLRP" Height="400" Width="600"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes">
     <Grid>
         <StackPanel>
             <TextBox Name="tbName"></TextBox>

+ 2 - 1
RedmineOracle/windDrpFile.xaml

@@ -5,7 +5,8 @@
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:local="clr-namespace:RedmineOracle"
         mc:Ignorable="d"
-        Title="windDrpFile" Height="300" Width="250">
+        Title="windDrpFile" Height="300" Width="250"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes">
     <Window.Resources>
         <DataTemplate x:Key="dtOutputFile">
             <Border BorderThickness="1,1,1,1" BorderBrush="Black">

+ 23 - 0
RedmineOracle/windLRPFile.xaml

@@ -0,0 +1,23 @@
+<Window x:Class="RedmineOracle.windLRPFile"
+        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="windLRPFile" Height="450" Width="800"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes">
+    <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/windLRPFile.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>
+    /// Логика взаимодействия для windLRPFile.xaml
+    /// </summary>
+    public partial class windLRPFile : Window
+    {
+        OracleWork ow;
+        string id_lrp;
+        public windLRPFile(string id_lrp)
+        {
+            InitializeComponent();
+            this.id_lrp = id_lrp;
+            ow = new OracleWork();
+            lbFile.ItemsSource = ow.listFileLRP(id_lrp);
+        }
+
+        private void Button_Click(object sender, RoutedEventArgs e)
+        {
+            Button button = sender as Button;
+            string id = button.Uid;
+            ow.DonLRPFIle(id_lrp, id);
+        }
+    }
+}

+ 20 - 0
UnitTestProject1/Properties/AssemblyInfo.cs

@@ -0,0 +1,20 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("UnitTestProject1")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("UnitTestProject1")]
+[assembly: AssemblyCopyright("Copyright ©  2022")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+[assembly: ComVisible(false)]
+
+[assembly: Guid("5a7a50bf-691d-434f-9ef5-6366ed40e7e8")]
+
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 26 - 0
UnitTestProject1/UnitTest1.cs

@@ -0,0 +1,26 @@
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using RedmineOracle;
+using System;
+
+namespace UnitTestProject1
+{
+    [TestClass]
+    public class UnitTest1
+    {
+        OracleWork ow;
+
+        [TestMethod]
+        public void TestMethod2()
+        {
+            ow = new OracleWork();
+            Assert.AreNotEqual(-1, ow.chechAuth("HELPDESK_SA", "LMN_509ss8"));
+        }
+
+        [TestMethod]
+        public void TestMethod3()
+        {
+            ow = new OracleWork();
+            Assert.IsNotNull(ow.findLRP("100100"));
+        }
+    }
+}

+ 75 - 0
UnitTestProject1/UnitTestProject1.csproj

@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="..\packages\MSTest.TestAdapter.2.2.7\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.2.2.7\build\net45\MSTest.TestAdapter.props')" />
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{5A7A50BF-691D-434F-9EF5-6366ED40E7E8}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>UnitTestProject1</RootNamespace>
+    <AssemblyName>UnitTestProject1</AssemblyName>
+    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
+    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
+    <IsCodedUITest>False</IsCodedUITest>
+    <TestProjectType>UnitTest</TestProjectType>
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\MSTest.TestFramework.2.2.7\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\MSTest.TestFramework.2.2.7\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="UnitTest1.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="app.config" />
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\RedmineOracle\RedmineOracle.csproj">
+      <Project>{f7016c66-ff28-4f65-8a35-5b1163161b9d}</Project>
+      <Name>RedmineOracle</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>Данный проект ссылается на пакеты NuGet, отсутствующие на этом компьютере. Используйте восстановление пакетов NuGet, чтобы скачать их.  Дополнительную информацию см. по адресу: http://go.microsoft.com/fwlink/?LinkID=322105. Отсутствует следующий файл: {0}.</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.2.7\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.2.7\build\net45\MSTest.TestAdapter.props'))" />
+    <Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.2.7\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.2.7\build\net45\MSTest.TestAdapter.targets'))" />
+  </Target>
+  <Import Project="..\packages\MSTest.TestAdapter.2.2.7\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.2.2.7\build\net45\MSTest.TestAdapter.targets')" />
+</Project>

+ 15 - 0
UnitTestProject1/app.config

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
+</configuration>

+ 5 - 0
UnitTestProject1/packages.config

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="MSTest.TestAdapter" version="2.2.7" targetFramework="net472" />
+  <package id="MSTest.TestFramework" version="2.2.7" targetFramework="net472" />
+</packages>