Fix dei due metodi API x CSS

This commit is contained in:
Samuele E. Locatelli
2019-09-16 14:56:43 +02:00
parent 2a0a5949a8
commit a0d902f464
5 changed files with 67 additions and 52 deletions
-8
View File
@@ -9,8 +9,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppData", "AppData\AppData.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VersGen", "VersGen\VersGen.csproj", "{175AF851-9AED-4D5F-8571-9CEC8B2D2320}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO", "IO\IO.csproj", "{0990A432-E9A4-45D0-81D6-782B9DC2382E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -36,12 +34,6 @@ Global
{175AF851-9AED-4D5F-8571-9CEC8B2D2320}.Debug-LELE|Any CPU.Build.0 = Debug|Any CPU
{175AF851-9AED-4D5F-8571-9CEC8B2D2320}.Release|Any CPU.ActiveCfg = Release|Any CPU
{175AF851-9AED-4D5F-8571-9CEC8B2D2320}.Release|Any CPU.Build.0 = Release|Any CPU
{0990A432-E9A4-45D0-81D6-782B9DC2382E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0990A432-E9A4-45D0-81D6-782B9DC2382E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0990A432-E9A4-45D0-81D6-782B9DC2382E}.Debug-LELE|Any CPU.ActiveCfg = Debug|Any CPU
{0990A432-E9A4-45D0-81D6-782B9DC2382E}.Debug-LELE|Any CPU.Build.0 = Debug|Any CPU
{0990A432-E9A4-45D0-81D6-782B9DC2382E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0990A432-E9A4-45D0-81D6-782B9DC2382E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
-35
View File
@@ -1,35 +0,0 @@
using System.Collections.Generic;
using System.Web.Http;
namespace NKC_WF.Controllers
{
public class ValuesController : ApiController
{
// GET api/values
public IEnumerable<string> Get()
{
return new string[] { "value1", "value2" };
}
// GET api/values/5
public string Get(int id)
{
return "value";
}
// POST api/values
public void Post([FromBody]string value)
{
}
// PUT api/values/5
public void Put(int id, [FromBody]string value)
{
}
// DELETE api/values/5
public void Delete(int id)
{
}
}
}
+62
View File
@@ -0,0 +1,62 @@
using System;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Web;
using System.Web.Http;
namespace NKC_WF.Controllers
{
public class getMUCssController : ApiController
{
// GET api/<controller>
public HttpResponseMessage Get()
{
string filename = HttpContext.Current.Server.MapPath("~/Content/SheetColor.css");
string answ = File.ReadAllText(filename);
// rendo dinamico in base al secondo pari/dispari il mio #IT00006
int secondi = DateTime.Now.Second;
if (secondi % 2 == 0)
{
answ += "#IT000006 {fill: orange;}";
answ += "#IT000003 {fill: orange; .flashStroke; .strokeThick;}";
}
else
{
answ += "#IT000006 {fill: blue;}";
answ += "#IT000003 {fill: blue; .flashStroke; .strokeThick;}";
}
//return answ;
return new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new StringContent(answ, Encoding.UTF8, "text/css")
};
}
// GET api/<controller>/5
public string Get(int id)
{
return "value";
}
// POST api/<controller>
public void Post([FromBody]string value)
{
}
// PUT api/<controller>/5
public void Put(int id, [FromBody]string value)
{
}
// DELETE api/<controller>/5
public void Delete(int id)
{
}
}
}
@@ -1,18 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace NKC_WF.Controllers
{
public class MachineCssController : ApiController
public class getMUCssRevController : ApiController
{
// GET api/<controller>
public IEnumerable<string> Get()
public int Get()
{
return new string[] { "value1", "value2" };
return DateTime.Now.Second;
}
// GET api/<controller>/5
+2 -2
View File
@@ -362,8 +362,8 @@
<Compile Include="Contact.aspx.designer.cs">
<DependentUpon>Contact.aspx</DependentUpon>
</Compile>
<Compile Include="Controllers\MachineCssController.cs" />
<Compile Include="Controllers\ValuesController.cs" />
<Compile Include="Controllers\getMUCssRevController.cs" />
<Compile Include="Controllers\getMUCssController.cs" />
<Compile Include="Default.aspx.cs">
<DependentUpon>Default.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>