업무일지 시간 요약화면에 휴일 데이터를 추가 함.

This commit is contained in:
chi
2021-06-25 14:18:23 +09:00
parent 139c48721f
commit acc368d065
24 changed files with 712 additions and 165 deletions

View File

@@ -1,4 +1,5 @@
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Linq;
using System.Net.Http;
@@ -8,16 +9,42 @@ namespace WebServer
{
public class CommonController : BaseController
{
[HttpGet]
public HttpResponseMessage Index()
{
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
var db = new EEEntities();
var sb = new System.Text.StringBuilder();
sb.AppendLine("List");
sb.AppendLine("Paramter Gcode");
sb.AppendLine("Paramter Grp");
//System.Web.Http.Results.JsonResult<string>
//var json = JsonConvert.SerializeObject(liast);
return new HttpResponseMessage()
{
Content = new StringContent(
sb.ToString(),
System.Text.Encoding.UTF8,
"text/html")
};
}
[HttpGet]
public HttpResponseMessage List()
{
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
var db = new EEEntities();
var liast = db.Common.Where(t => t.gcode == "EET1P").OrderBy(t => t.code).ToArray();
var vGcode = "EET1P";
var vGrp = "99";
var liast = db.Common.Where(t => t.gcode == vGcode && t.grp == vGrp).OrderBy(t => t.code).ToArray();
//System.Web.Http.Results.JsonResult<string>
var json = JObject.FromObject(liast);
var json = JsonConvert.SerializeObject(liast);
return new HttpResponseMessage()
{
Content = new StringContent(

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Web.Http;
@@ -8,13 +9,13 @@ namespace WebServer
public class HomeController : BaseController
{
[HttpPost]
public void Index([FromBody]string value)
public void Index([FromBody] string value)
{
}
// PUT api/values/5
public void Put(int id, [FromBody]string value)
public void Put(int id, [FromBody] string value)
{
}
@@ -64,13 +65,20 @@ namespace WebServer
{
//로그인이 되어있지않다면 로그인을 가져온다
MethodResult result;
result = View();
var model = GetGlobalModel();
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
var contents = string.Empty;
//기본값을 찾아서 없애줘야한다
var contents = result.Content;
Dictionary<string, string> list = new Dictionary<string, string>();
list.Add("공용코드 목록", "/Common/List/?Gcode=EET1P&Grp=99");
list.Add("사용자 목록", "/User/List/?Gcode=EET1P");
foreach (var item in list)
{
contents += $"<a target='_blank' href='{item.Value}'>{item.Key}</a>";
}
//공용값 적용
ApplyCommonValue(ref contents);
@@ -88,6 +96,6 @@ namespace WebServer
return resp;
}
}
}

View File

@@ -0,0 +1,58 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Linq;
using System.Net.Http;
using System.Web.Http;
namespace WebServer
{
public class UserController : BaseController
{
[HttpGet]
public HttpResponseMessage Index()
{
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
var db = new EEEntities();
var sb = new System.Text.StringBuilder();
sb.AppendLine("List");
sb.AppendLine("Gcode");
//System.Web.Http.Results.JsonResult<string>
//var json = JsonConvert.SerializeObject(liast);
return new HttpResponseMessage()
{
Content = new StringContent(
sb.ToString(),
System.Text.Encoding.UTF8,
"text/html")
};
}
[HttpGet]
public HttpResponseMessage List()
{
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
using (var db = new EEEntities())
{
var vGcode = "EET1P";
var liast = db.vGroupUser.AsNoTracking().Where(t => t.gcode == vGcode).OrderBy(t => t.id).ToArray();
//System.Web.Http.Results.JsonResult<string>
var json = JsonConvert.SerializeObject(liast);
return new HttpResponseMessage()
{
Content = new StringContent(
json.ToString(),
System.Text.Encoding.UTF8,
"application/json")
};
}
}
}
}

View File

@@ -14,8 +14,10 @@ namespace WebServer
// Start OWIN host
try
{
WebApp.Start<OWIN.Startup>(url: "http://127.0.0.1:9000");
var url = "http://127.0.0.1:9000";
WebApp.Start<OWIN.Startup>(url: url);
Console.WriteLine("start webapp");
Console.WriteLine(url);
Console.ReadLine();
}
catch (Exception ex)

View File

@@ -162,6 +162,7 @@
<Compile Include="Common.cs">
<DependentUpon>Model1.tt</DependentUpon>
</Compile>
<Compile Include="Controller\UserController.cs" />
<Compile Include="Controller\CustomerController.cs" />
<Compile Include="Controller\CommonController.cs" />
<Compile Include="Controller\APIController.cs" />