This commit is contained in:
chi
2021-08-02 16:26:53 +09:00
parent 12a33f174b
commit 2311774c42
23 changed files with 3823 additions and 231 deletions

View File

@@ -86,8 +86,7 @@ namespace Project
if (itemcnt == 0)
{
tbody.AppendLine("<tr>");
tbody.AppendLine("<th scope='row'>1</th>");
tbody.AppendLine("<td colspan='6'>자료가 없습니다</td>");
tbody.AppendLine("<td colspan='8'>자료가 없습니다</td>");
tbody.AppendLine("</tr>");
}

View File

@@ -27,6 +27,92 @@ namespace Project
var vals = Request.GetQueryNameValuePairs();
return string.Empty;
}
//[HttpPost]
//public string Edit([FromBody] string value)
//{
// var vals = Request.GetQueryNameValuePairs();
// var req = Request.GetRequestContext();
// return string.Empty;
//}
[HttpPost]
public string Edit(FormCollection value)
{
var vals = Request.GetQueryNameValuePairs();
var req = Request.GetRequestContext();
return string.Empty;
}
[HttpGet]
public HttpResponseMessage Edit(int id)
{
//로그인이 되어있지않다면 로그인을 가져온다
MethodResult result;
result = View("/jobreport/edit");
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
var model = GetGlobalModel();
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
//기본값을 찾아서 없애줘야한다
var searchkey = string.Empty;
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
var tbody = new System.Text.StringBuilder();
//테이블데이터생성
var db = new EEEntitiesJobreport();
var sd = DateTime.Now.ToString("yyyy-MM-01");
var ed = DateTime.Now.ToShortDateString();
var rows = db.vJobReportForUser.AsNoTracking().Where(t => t.gcode == FCOMMON.info.Login.gcode && t.idx == id).FirstOrDefault();
var contents = result.Content;
if (rows == null)
{
//아이템이 없는 메시지를 표시한다
}
else
{
//치환작업을 진행한다
contents = contents.Replace("{pdate}", rows.pdate);
contents = contents.Replace("{status}", rows.status);
contents = contents.Replace("{name}", rows.name);
contents = contents.Replace("{package}", rows.package);
contents = contents.Replace("{process}", rows.process);
contents = contents.Replace("{type}", rows.type);
contents = contents.Replace("{userProcess}", rows.userProcess);
contents = contents.Replace("{projectName}", rows.projectName);
contents = contents.Replace("{hrs}", rows.hrs.ToString());
contents = contents.Replace("{ot}", rows.ot.ToString());
contents = contents.Replace("{requestpart}", rows.requestpart);
contents = contents.Replace("{description}", rows.description);
}
//공용값 적용
ApplyCommonValue(ref contents);
//최종문자 적용
result.Content = contents;
var resp = new HttpResponseMessage()
{
Content = new StringContent(
result.Content,
System.Text.Encoding.UTF8,
"text/html")
};
return resp;
}
[HttpGet]
@@ -224,7 +310,7 @@ namespace Project
//if (searchkey.isEmpty() == false)
{
var db = new EEEntitiesJobreport();
var sd = DateTime.Now.ToString("yyyy-MM-01");
var sd = DateTime.Now.ToShortDateString();
var ed = DateTime.Now.ToShortDateString();
var rows = db.vJobReportForUser.AsNoTracking().Where(t => t.gcode == FCOMMON.info.Login.gcode && t.id == FCOMMON.info.Login.no && t.pdate.CompareTo(sd) >= 0 && t.pdate.CompareTo(ed) <= 1).OrderByDescending(t => t.pdate);
itemcnt = rows.Count();
@@ -242,7 +328,7 @@ namespace Project
tbody.AppendLine($"<td class='text-center'>{item.status}</td>");
tbody.AppendLine($"<td>{item.type}</td>");
tbody.AppendLine($"<td>{item.projectName}</td>");
tbody.AppendLine($"<td><a href='/jobreport/edit/{item.idx}'>{item.projectName}</a></td>");
tbody.AppendLine($"<td>{item.hrs}</td>");
tbody.AppendLine($"<td>{item.ot}</td>");

View File

@@ -0,0 +1,88 @@
using System;
using System.Linq;
using System.Net.Http;
using System.Web.Http;
namespace Project
{
public class ManualController : BaseController
{
[HttpPost]
public void Index([FromBody]string value)
{
}
// PUT api/values/5
public void Put(int id, [FromBody]string value)
{
}
// DELETE api/values/5
public void Delete(int id)
{
}
[HttpGet]
public HttpResponseMessage Page(string id)
{
//로그인이 되어있지않다면 로그인을 가져온다
MethodResult result;
result = View($"\\Manual\\{id}");
var model = GetGlobalModel();
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
//기본값을 찾아서 없애줘야한다
var contents = result.Content;
//공용값 적용
ApplyCommonValue(ref contents);
//최종문자 적용
result.Content = contents;
var resp = new HttpResponseMessage()
{
Content = new StringContent(
result.Content,
System.Text.Encoding.UTF8,
"text/html")
};
return resp;
}
[HttpGet]
public HttpResponseMessage Index()
{
//로그인이 되어있지않다면 로그인을 가져온다
MethodResult result;
result = View();
var model = GetGlobalModel();
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
//기본값을 찾아서 없애줘야한다
var contents = result.Content;
//공용값 적용
ApplyCommonValue(ref contents);
//최종문자 적용
result.Content = contents;
var resp = new HttpResponseMessage()
{
Content = new StringContent(
result.Content,
System.Text.Encoding.UTF8,
"text/html")
};
return resp;
}
}
}

View File

@@ -138,39 +138,39 @@ namespace Project
//테이블데이터생성
var itemcnt = 0;
//if (searchkey.isEmpty() == false)
//{
var db = new EEEntitiesPurchase();
var sd = DateTime.Now.ToString("yyyy-MM-01");
var rows = db.vPurchase.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.pdate.CompareTo(sd) >= 0).OrderByDescending(t => t.pdate);
itemcnt = rows.Count();
foreach (vPurchase item in rows)
{
var db = new EEEntitiesPurchase();
var sd = DateTime.Now.ToString("yyyy-MM-01");
var rows = db.vPurchase.AsNoTracking().Where(t => t.gcode == FCOMMON.info.Login.gcode && t.pdate.CompareTo(sd) >= 0).OrderByDescending(t => t.pdate);
itemcnt = rows.Count();
foreach (var item in rows)
{
tbody.AppendLine("<tr>");
tbody.AppendLine($"<th scope='row'>{item.pdate.Substring(5)}</th>");
tbody.AppendLine("<tr>");
tbody.AppendLine($"<th scope='row'>{item.pdate.Substring(5)}</th>");
if (item.state == "---") tbody.AppendLine($"<td class='table-info'>{item.state}</td>");
else if (item.state == "Received") tbody.AppendLine($"<td class='table-success'>{item.state}</td>");
else tbody.AppendLine($"<td>{item.state}</td>");
if (item.state == "---") tbody.AppendLine($"<td class='table-info'>{item.state}</td>");
else if (item.state == "Received") tbody.AppendLine($"<td class='table-success'>{item.state}</td>");
else tbody.AppendLine($"<td>{item.state}</td>");
tbody.AppendLine($"<td>{item.name}</td>");
tbody.AppendLine($"<td>{item.sid}</td>");
tbody.AppendLine($"<td>{item.pumname}</td>");
tbody.AppendLine($"<td>{item.name}</td>");
tbody.AppendLine($"<td>{item.sid}</td>");
tbody.AppendLine($"<td>{item.pumname}</td>");
if (item.pumscale.Length > 10) tbody.AppendLine($"<td>{item.pumscale.Substring(0, 10)}...</td>");
else tbody.AppendLine($"<td>{item.pumscale}</td>");
if (item.pumscale.Length > 10) tbody.AppendLine($"<td>{item.pumscale.Substring(0, 10)}...</td>");
else tbody.AppendLine($"<td>{item.pumscale}</td>");
tbody.AppendLine($"<td>{item.pumqty}</td>");
tbody.AppendLine($"<td>{item.pumprice}</td>");
tbody.AppendLine($"<td>{item.pumamt}</td>");
tbody.AppendLine($"<td>{item.supply}</td>");
if (item.project != null && item.project.Length > 10) tbody.AppendLine($"<td>{item.project.Substring(0, 10)}...</td>");
else tbody.AppendLine($"<td>{item.project}</td>");
tbody.AppendLine($"<td>{item.pumqty}</td>");
tbody.AppendLine($"<td>{item.pumprice}</td>");
tbody.AppendLine($"<td>{item.pumamt}</td>");
tbody.AppendLine($"<td>{item.supply}</td>");
if (item.project != null && item.project.Length > 10) tbody.AppendLine($"<td>{item.project.Substring(0, 10)}...</td>");
else tbody.AppendLine($"<td>{item.project}</td>");
if (item.bigo.Length > 10) tbody.AppendLine($"<td>{item.bigo.Substring(0, 10)}...</td>");
else tbody.AppendLine($"<td>{item.bigo}</td>");
tbody.AppendLine("</tr>");
}
if (item.bigo.Length > 10) tbody.AppendLine($"<td>{item.bigo.Substring(0, 10)}...</td>");
else tbody.AppendLine($"<td>{item.bigo}</td>");
tbody.AppendLine("</tr>");
}
//}
//아잍쳄이 없는경우
if (itemcnt == 0)