+ {
+ public string Content;
+ public byte[] Contentb;
+ public string Redirecturl;
+
+ public override bool Equals(object obj)
+ {
+ if (!(obj is MethodResult))
+ return false;
+
+ return Equals((MethodResult)obj);
+ }
+
+ public override int GetHashCode()
+ {
+ if (Contentb == null)
+ return Content.GetHashCode() ^ Redirecturl.GetHashCode();
+ else
+ return Content.GetHashCode() ^ Redirecturl.GetHashCode() ^ Contentb.GetHexString().GetHashCode();
+
+ }
+
+ public bool Equals(MethodResult other)
+ {
+ if (Content != other.Content)
+ return false;
+
+ if (Redirecturl != other.Redirecturl)
+ return false;
+
+ return Contentb == other.Contentb;
+ }
+
+
+ public static bool operator ==(MethodResult point1, MethodResult point2)
+ {
+ return point1.Equals(point2);
+ }
+
+ public static bool operator !=(MethodResult point1, MethodResult point2)
+ {
+ return !point1.Equals(point2);
+ }
+ }
+
+ sealed class PostRequest : Attribute
+ {
+
+ }
+
+ public class BaseController : ApiController
+ {
+ public string QueryString { get; set; }
+ public string PostData { get; set; }
+ public string ParamData { get; set; }
+
+ protected string Trig_Ctrl { get; set; }
+ protected string Trig_func { get; set; }
+
+ public PageModel GetGlobalModel()
+ {
+ var config = RequestContext.Configuration;
+ var routeData = config.Routes.GetRouteData(Request).Values.ToList();
+ var name_ctrl = routeData[0].Value.ToString();
+ var name_action = routeData[1].Value.ToString();
+
+
+ return new PageModel
+ {
+ RouteData = routeData,
+ urlcontrol = name_ctrl,
+ urlaction = name_action
+ };
+ }
+
+
+ public MethodResult View(bool nosubdir=false)
+ {
+ var config = RequestContext.Configuration;
+ if (config != null)
+ {
+ var routeData = config.Routes.GetRouteData(Request).Values.ToList();
+ var name_ctrl = routeData[0].Value.ToString();
+ if (nosubdir) name_ctrl = string.Empty;
+ var name_action = routeData[1].Value.ToString();
+ return View(name_ctrl, name_action);
+ }
+ else
+ {
+ return View(Trig_Ctrl + "/" + Trig_func);
+ }
+
+ }
+
+
+ public static void ApplyCommonValue(ref string contents)
+ {
+ //메뉴 푸터 - 개발자 정보
+ if (contents.Contains("{title}"))
+ contents = contents.Replace("{title}", FCOMMON.info.Login.gcode + " Groupware");
+
+ }
+
+ public MethodResult View(string Controller, string Action, Boolean applydefaultview = true)
+ {
+ var retval = new MethodResult();
+
+ if (Action.IndexOf(".") == -1)
+ Action += ".html"; //기본값 html 을 넣는다
+
+ var file = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "View", Controller, Action);
+
+ var contents = string.Empty;
+
+ if (System.IO.File.Exists(file) == false)
+ {
+ //error 폴더의 404.html 파일을 찾는다.
+ var file404 = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "View", "Error", "404.html");
+ if (System.IO.File.Exists(file404))
+ {
+ contents = System.IO.File.ReadAllText(file404, System.Text.Encoding.UTF8);
+ contents = contents.Replace("{errorfilename}", file);
+ }
+
+ else
+ contents = "ERROR CODE - 404 (NOT FOUND)
" + file;
+
+ Console.WriteLine("view File not found : " + file);
+ }
+ else
+ {
+ //디폴트뷰의 내용을 가져온다 (있다면 적용한다)
+ if (applydefaultview)
+ {
+ //뷰파일이 있다면 그것을 적용한다
+ var laytoutfile = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "View", "Layout", "default.html");
+ if (System.IO.File.Exists(laytoutfile))
+ contents = System.IO.File.ReadAllText(laytoutfile, System.Text.Encoding.UTF8);
+
+ var fileContents = System.IO.File.ReadAllText(file, System.Text.Encoding.UTF8);
+ if (String.IsNullOrEmpty(contents)) contents = fileContents;
+ else contents = contents.Replace("{contents}", fileContents);
+ }
+ else
+ {
+ //해당 뷰를 가져와서 반환한다
+ contents = System.IO.File.ReadAllText(file, System.Text.Encoding.UTF8);
+ }
+ }
+
+ agi.HtmlDocument doc = new agi.HtmlDocument();
+ doc.LoadHtml(contents);
+
+ //파일참조 태그를 모두 가져옴
+ var tags_include = doc.QuerySelectorAll("include");
+ foreach (var item in tags_include)
+ {
+ var filename = item.InnerText;
+
+ var load_file = String.Concat(AppDomain.CurrentDomain.BaseDirectory, "View", filename.Replace("/", "\\"));
+ load_file = load_file.Replace("\\\\", "\\");
+ String fileContents;// = String.Empty;
+
+ Console.WriteLine("## " + item.OuterHtml);
+ if (System.IO.File.Exists(load_file))
+ {
+ fileContents = System.IO.File.ReadAllText(load_file, System.Text.Encoding.UTF8);
+ }
+ else
+ {
+ fileContents = string.Format("#include Error:nofile:{0}
",
+ filename); //파일이없다면 해당 부분은 오류 처리한다.
+ }
+ contents = contents.Replace(item.OuterHtml, fileContents);
+ }
+
+ //콘텐츠내의 file 을 찾아서 처리한다. ; 정규식의 처리속도가 느릴듯하여, 그냥 처리해본다
+
+
+ //시스템변수 replace
+ contents = contents.Replace("{param_control}", Trig_Ctrl);
+ contents = contents.Replace("{param_function}", Trig_func);
+
+ retval.Content = contents;
+ return retval;
+ }
+ public MethodResult View(string viewfilename, Boolean applydefaultview = true)
+ {
+ var retval = new MethodResult();
+
+ if (viewfilename.IndexOf(".") == -1)
+ viewfilename += ".html"; //기본값 html 을 넣는다
+
+ var file = AppDomain.CurrentDomain.BaseDirectory + "View" + viewfilename.Replace("/", "\\");
+
+ var contents = string.Empty;
+
+ if (System.IO.File.Exists(file) == false)
+ {
+ //error 폴더의 404.html 파일을 찾는다.
+ var file404 = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "View", "Error", "404.html");
+ if (System.IO.File.Exists(file404))
+ {
+ contents = System.IO.File.ReadAllText(file404, System.Text.Encoding.UTF8);
+ contents = contents.Replace("{errorfilename}", file);
+ }
+
+ else
+ contents = "ERROR CODE - 404 (NOT FOUND)
" + file;
+
+ Console.WriteLine("view File not found : " + file);
+ }
+ else
+ {
+ //디폴트뷰의 내용을 가져온다 (있다면 적용한다)
+ if (applydefaultview)
+ {
+ //뷰파일이 있다면 그것을 적용한다
+ var laytoutfile = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "View", "Layout", "default.html");
+ if (System.IO.File.Exists(laytoutfile))
+ contents = System.IO.File.ReadAllText(laytoutfile, System.Text.Encoding.UTF8);
+
+ var fileContents = System.IO.File.ReadAllText(file, System.Text.Encoding.UTF8);
+ if (String.IsNullOrEmpty(contents)) contents = fileContents;
+ else contents = contents.Replace("{contents}", fileContents);
+ }
+ else
+ {
+ //해당 뷰를 가져와서 반환한다
+ contents = System.IO.File.ReadAllText(file, System.Text.Encoding.UTF8);
+ }
+ }
+
+ agi.HtmlDocument doc = new agi.HtmlDocument();
+ doc.LoadHtml(contents);
+
+ //파일참조 태그를 모두 가져옴
+ var tags_include = doc.QuerySelectorAll("include");
+ foreach (var item in tags_include)
+ {
+ var filename = item.InnerText;
+
+ var load_file = String.Concat(AppDomain.CurrentDomain.BaseDirectory, "View", filename.Replace("/", "\\"));
+ load_file = load_file.Replace("\\\\", "\\");
+ String fileContents;// = String.Empty;
+
+ Console.WriteLine("## " + item.OuterHtml);
+ if (System.IO.File.Exists(load_file))
+ {
+ fileContents = System.IO.File.ReadAllText(load_file, System.Text.Encoding.UTF8);
+ }
+ else
+ {
+ fileContents = string.Format("#include Error:nofile:{0}
",
+ filename); //파일이없다면 해당 부분은 오류 처리한다.
+ }
+ contents = contents.Replace(item.OuterHtml, fileContents);
+ }
+
+
+
+ //콘텐츠내의 file 을 찾아서 처리한다. ; 정규식의 처리속도가 느릴듯하여, 그냥 처리해본다
+ while (true)
+ {
+ var fileindexS = contents.IndexOf("{file:");
+ if (fileindexS == -1) break;
+ var fileindexE = contents.IndexOf("}", fileindexS);
+ if (fileindexE == -1) break;
+ if (fileindexE <= fileindexS + 5) break;
+ var inlinestr = contents.Substring(fileindexS, fileindexE - fileindexS + 1);
+ var filename = contents.Substring(fileindexS + 7, fileindexE - fileindexS - 8);
+ var load_file = String.Concat(AppDomain.CurrentDomain.BaseDirectory, "View", "\\", filename.Replace("/", "\\"));
+ load_file = load_file.Replace("\\\\", "\\");
+ String fileContents;// = String.Empty;
+
+ Console.WriteLine("file impot : " + load_file);
+ if (System.IO.File.Exists(load_file))
+ {
+ fileContents = System.IO.File.ReadAllText(load_file, System.Text.Encoding.UTF8);
+ }
+ else
+ {
+ fileContents = "{FileNotFound:" + filename + "}"; //파일이없다면 해당 부분은 오류 처리한다.
+ }
+ contents = contents.Replace(inlinestr, fileContents);
+ }
+
+ //시스템변수 replace
+ contents = contents.Replace("{param_control}", Trig_Ctrl);
+ contents = contents.Replace("{param_function}", Trig_func);
+
+ retval.Content = contents;
+ return retval;
+ }
+ protected class Parameter
+ {
+ public string Key { get; set; }
+ public string Value { get; set; }
+ public Parameter(string key_, string value_)
+ {
+ Key = key_;
+ Value = value_;
+ }
+ }
+
+ }
+}
diff --git a/Project/Controller/CustomerController.cs b/Project/Web/Controller/CustomerController.cs
similarity index 96%
rename from Project/Controller/CustomerController.cs
rename to Project/Web/Controller/CustomerController.cs
index 957ae68..bb1bc79 100644
--- a/Project/Controller/CustomerController.cs
+++ b/Project/Web/Controller/CustomerController.cs
@@ -1,198 +1,198 @@
-using System;
-using System.Linq;
-using System.Net.Http;
-using System.Web.Http;
-
-namespace Project
-{
- public class CustomerController : BaseController
- {
-
- // PUT api/values/5
- public void Put(int id, [FromBody] string value)
- {
- }
-
- // DELETE api/values/5
- public void Delete(int id)
- {
- }
-
- [HttpGet]
- public string Test()
- {
- return "test";
- }
-
- [HttpGet]
- public HttpResponseMessage Find()
- {
- //로그인이 되어있지않다면 로그인을 가져온다
- MethodResult result;
- result = View();
-
-
- 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 itemcnt = 0;
- if (searchkey.isEmpty() == false)
- {
- var db = new dsMSSQLTableAdapters.CustomsTableAdapter();//.custrom EEEntitiesCommon();
- var rows = db.GetData(FCOMMON.info.Login.gcode);// db.Customs.Where(t => t.gcode == FCOMMON.info.Login.gcode).OrderBy(t => t.name);
- itemcnt = rows.Count();
- foreach (var item in rows)
- {
- tbody.AppendLine("");
- tbody.AppendLine($"| {item.name} | ");
- tbody.AppendLine($"{item.name2} | ");
- tbody.AppendLine($"{item.name} | ");
- //tbody.AppendLine($"{item.model} | ");
-
- //if (item.price == null)
- // tbody.AppendLine($"-- | ");
- //else
- //{
- // var price = (double)item.price / 1000.0;
-
- // tbody.AppendLine($"{price.ToString("N0")} | ");
- //}
-
-
- //tbody.AppendLine($"{item.manu} | ");
- //tbody.AppendLine($"{item.supply} | ");
-
- //if (item.remark.Length > 10)
- // tbody.AppendLine($"{item.remark.Substring(0, 10)}... | ");
- //else
- // tbody.AppendLine($"{item.remark} | ");
- tbody.AppendLine("
");
- }
- }
-
- //아잍쳄이 없는경우
- if (itemcnt == 0)
- {
- tbody.AppendLine("");
- tbody.AppendLine("| 1 | ");
- tbody.AppendLine("자료가 없습니다 | ");
- tbody.AppendLine("
");
- }
-
-
- var contents = result.Content.Replace("{search}", searchkey);
- contents = contents.Replace("{tabledata}", tbody.ToString());
- contents = contents.Replace("{cnt}", itemcnt.ToString());
-
-
- //공용값 적용
- 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 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 itemcnt = 0;
- //if (searchkey.isEmpty() == false)
- {
- var db = new dsMSSQLTableAdapters.CustomsTableAdapter();// EEEntitiesCommon();
- var sd = DateTime.Now.ToString("yyyy-MM-01");
- var rows = db.GetData(FCOMMON.info.Login.gcode);// .Customs.AsNoTracking().Where(t => t.gcode == FCOMMON.info.Login.gcode).OrderBy(t=>t.name);
- itemcnt = rows.Count();
- foreach (var item in rows)
- {
- tbody.AppendLine("");
- tbody.AppendLine($"| {item.grp} | ");
- tbody.AppendLine($"{item.name} | ");
- tbody.AppendLine($"{item.name2} | ");
- tbody.AppendLine($"{item.tel} | ");
- tbody.AppendLine($"{item.fax} | ");
- tbody.AppendLine($"{item.email} | ");
- tbody.AppendLine($"{item.address} | ");
-
-
-
- if (string.IsNullOrEmpty( item.memo)==false && item.memo.Length > 10) tbody.AppendLine($"{item.memo.Substring(0, 10)}... | ");
- else tbody.AppendLine($"{item.memo} | ");
-
- tbody.AppendLine("
");
- }
- }
-
- //아잍쳄이 없는경우
- if (itemcnt == 0)
- {
- tbody.AppendLine("");
- tbody.AppendLine("| 1 | ");
- tbody.AppendLine("자료가 없습니다 | ");
- tbody.AppendLine("
");
- }
-
-
- var contents = result.Content.Replace("{search}", searchkey);
- contents = contents.Replace("{tabledata}", tbody.ToString());
- contents = contents.Replace("{cnt}", itemcnt.ToString());
-
-
- //공용값 적용
- ApplyCommonValue(ref contents);
-
- //최종문자 적용
- result.Content = contents;
-
- var resp = new HttpResponseMessage()
- {
- Content = new StringContent(
- result.Content,
- System.Text.Encoding.UTF8,
- "text/html")
- };
-
- return resp;
- }
-
- }
-}
+using System;
+using System.Linq;
+using System.Net.Http;
+using System.Web.Http;
+
+namespace Project.Web.Controllers
+{
+ public class CustomerController : BaseController
+ {
+
+ // PUT api/values/5
+ public void Put(int id, [FromBody] string value)
+ {
+ }
+
+ // DELETE api/values/5
+ public void Delete(int id)
+ {
+ }
+
+ [HttpGet]
+ public string Test()
+ {
+ return "test";
+ }
+
+ [HttpGet]
+ public HttpResponseMessage Find()
+ {
+ //로그인이 되어있지않다면 로그인을 가져온다
+ MethodResult result;
+ result = View();
+
+
+ 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 itemcnt = 0;
+ if (searchkey.isEmpty() == false)
+ {
+ var db = new dsMSSQLTableAdapters.CustomsTableAdapter();//.custrom EEEntitiesCommon();
+ var rows = db.GetData(FCOMMON.info.Login.gcode);// db.Customs.Where(t => t.gcode == FCOMMON.info.Login.gcode).OrderBy(t => t.name);
+ itemcnt = rows.Count();
+ foreach (var item in rows)
+ {
+ tbody.AppendLine("");
+ tbody.AppendLine($"| {item.name} | ");
+ tbody.AppendLine($"{item.name2} | ");
+ tbody.AppendLine($"{item.name} | ");
+ //tbody.AppendLine($"{item.model} | ");
+
+ //if (item.price == null)
+ // tbody.AppendLine($"-- | ");
+ //else
+ //{
+ // var price = (double)item.price / 1000.0;
+
+ // tbody.AppendLine($"{price.ToString("N0")} | ");
+ //}
+
+
+ //tbody.AppendLine($"{item.manu} | ");
+ //tbody.AppendLine($"{item.supply} | ");
+
+ //if (item.remark.Length > 10)
+ // tbody.AppendLine($"{item.remark.Substring(0, 10)}... | ");
+ //else
+ // tbody.AppendLine($"{item.remark} | ");
+ tbody.AppendLine("
");
+ }
+ }
+
+ //아잍쳄이 없는경우
+ if (itemcnt == 0)
+ {
+ tbody.AppendLine("");
+ tbody.AppendLine("| 1 | ");
+ tbody.AppendLine("자료가 없습니다 | ");
+ tbody.AppendLine("
");
+ }
+
+
+ var contents = result.Content.Replace("{search}", searchkey);
+ contents = contents.Replace("{tabledata}", tbody.ToString());
+ contents = contents.Replace("{cnt}", itemcnt.ToString());
+
+
+ //공용값 적용
+ 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 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 itemcnt = 0;
+ //if (searchkey.isEmpty() == false)
+ {
+ var db = new dsMSSQLTableAdapters.CustomsTableAdapter();// EEEntitiesCommon();
+ var sd = DateTime.Now.ToString("yyyy-MM-01");
+ var rows = db.GetData(FCOMMON.info.Login.gcode);// .Customs.AsNoTracking().Where(t => t.gcode == FCOMMON.info.Login.gcode).OrderBy(t=>t.name);
+ itemcnt = rows.Count();
+ foreach (var item in rows)
+ {
+ tbody.AppendLine("");
+ tbody.AppendLine($"| {item.grp} | ");
+ tbody.AppendLine($"{item.name} | ");
+ tbody.AppendLine($"{item.name2} | ");
+ tbody.AppendLine($"{item.tel} | ");
+ tbody.AppendLine($"{item.fax} | ");
+ tbody.AppendLine($"{item.email} | ");
+ tbody.AppendLine($"{item.address} | ");
+
+
+
+ if (string.IsNullOrEmpty( item.memo)==false && item.memo.Length > 10) tbody.AppendLine($"{item.memo.Substring(0, 10)}... | ");
+ else tbody.AppendLine($"{item.memo} | ");
+
+ tbody.AppendLine("
");
+ }
+ }
+
+ //아잍쳄이 없는경우
+ if (itemcnt == 0)
+ {
+ tbody.AppendLine("");
+ tbody.AppendLine("| 1 | ");
+ tbody.AppendLine("자료가 없습니다 | ");
+ tbody.AppendLine("
");
+ }
+
+
+ var contents = result.Content.Replace("{search}", searchkey);
+ contents = contents.Replace("{tabledata}", tbody.ToString());
+ contents = contents.Replace("{cnt}", itemcnt.ToString());
+
+
+ //공용값 적용
+ ApplyCommonValue(ref contents);
+
+ //최종문자 적용
+ result.Content = contents;
+
+ var resp = new HttpResponseMessage()
+ {
+ Content = new StringContent(
+ result.Content,
+ System.Text.Encoding.UTF8,
+ "text/html")
+ };
+
+ return resp;
+ }
+
+ }
+}
diff --git a/Project/Controller/DashBoardController.cs b/Project/Web/Controller/DashBoardController.cs
similarity index 79%
rename from Project/Controller/DashBoardController.cs
rename to Project/Web/Controller/DashBoardController.cs
index 8a36c3f..4345a30 100644
--- a/Project/Controller/DashBoardController.cs
+++ b/Project/Web/Controller/DashBoardController.cs
@@ -1,115 +1,116 @@
-using FCOMMON;
-using Newtonsoft.Json;
-using System;
-using System.Linq;
-using System.Net.Http;
-using System.Security.Cryptography;
-using System.Web.Http;
-
-namespace Project
-{
- public class DashBoardController : 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 string TodayCountH()
- {
-
- var sql = "select count(*) from EETGW_HolydayRequest " +
- "where gcode = 'EET1P' and conf = 1 and HolyDays > 0 and " +
- "sdate <= GETDATE() and edate >= GETDATE()";
- var cnt = DBM.ExecuteScalar(sql);
- return cnt.ToString();
-
- }
-
-
- [HttpGet]
- public HttpResponseMessage GetholyUser()
- {
- var sql = string.Empty;
- sql = $"select uid,cate,sdate,edate,HolyReason " +
- $"from EETGW_HolydayRequest " +
- $"where gcode = '{FCOMMON.info.Login.gcode}'" +
- $"and conf = 1 and HolyDays > 0 and sdate <= GETDATE() and edate >= GETDATE()";
-
- if (info.Login.gcode == null)
- info.Login.gcode = "EET1P";
-
- sql = sql.Replace("{gcode}", FCOMMON.info.Login.gcode);
-
- var cs = Properties.Settings.Default.gwcs;// "Data Source=K4FASQL.kr.ds.amkor.com,50150;Initial Catalog=EE;Persist Security Info=True;User ID=eeadm;Password=uJnU8a8q&DJ+ug-D!";
- var cn = new System.Data.SqlClient.SqlConnection(cs);
- var cmd = new System.Data.SqlClient.SqlCommand(sql, cn);
- var da = new System.Data.SqlClient.SqlDataAdapter(cmd);
- var dt = new System.Data.DataTable();
- da.Fill(dt);
- da.Dispose();
- cmd.Dispose();
- cn.Dispose();
-
- var txtjson = JsonConvert.SerializeObject(dt, new JsonSerializerSettings
- {
- NullValueHandling = NullValueHandling.Ignore
- });
-
- var resp = new HttpResponseMessage()
- {
- Content = new StringContent(
- txtjson,
- System.Text.Encoding.UTF8,
- "application/json")
- };
-
- 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;
- }
-
- }
-}
+using FCOMMON;
+using Newtonsoft.Json;
+using System;
+using System.Linq;
+using System.Net.Http;
+using System.Security.Cryptography;
+using System.Web.Http;
+
+namespace Project.Web.Controllers
+{
+ public class DashBoardController : 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 string TodayCountH()
+ {
+
+ var sql = "select count(*) from EETGW_HolydayRequest " +
+ "where gcode = 'EET1P' and conf = 1 and HolyDays > 0 and " +
+ "sdate <= GETDATE() and edate >= GETDATE()";
+ var cnt = DBM.ExecuteScalar(sql);
+ return cnt.ToString();
+
+ }
+
+
+ [HttpGet]
+ public HttpResponseMessage GetholyUser()
+ {
+ var sql = string.Empty;
+ sql = $"select uid,cate,sdate,edate,HolyReason " +
+ $"from EETGW_HolydayRequest " +
+ $"where gcode = '{FCOMMON.info.Login.gcode}'" +
+ $"and conf = 1 and HolyDays > 0 and sdate <= GETDATE() and edate >= GETDATE()";
+
+ if (info.Login.gcode == null)
+ info.Login.gcode = "EET1P";
+
+ sql = sql.Replace("{gcode}", FCOMMON.info.Login.gcode);
+
+ var cs = Properties.Settings.Default.gwcs;// "Data Source=K4FASQL.kr.ds.amkor.com,50150;Initial Catalog=EE;Persist Security Info=True;User ID=eeadm;Password=uJnU8a8q&DJ+ug-D!";
+ var cn = new System.Data.SqlClient.SqlConnection(cs);
+ var cmd = new System.Data.SqlClient.SqlCommand(sql, cn);
+ var da = new System.Data.SqlClient.SqlDataAdapter(cmd);
+ var dt = new System.Data.DataTable();
+ da.Fill(dt);
+ da.Dispose();
+ cmd.Dispose();
+ cn.Dispose();
+
+ var txtjson = JsonConvert.SerializeObject(dt, new JsonSerializerSettings
+ {
+ NullValueHandling = NullValueHandling.Ignore
+ });
+
+ var resp = new HttpResponseMessage()
+ {
+ Content = new StringContent(
+ txtjson,
+ System.Text.Encoding.UTF8,
+ "application/json")
+ };
+
+ return resp;
+
+
+ }
+
+ [HttpGet]
+ public HttpResponseMessage Index()
+ {
+ // 직접 파일을 읽어서 반환
+ var filePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Web", "wwwroot", "DashBoard", "index.html");
+ var contents = string.Empty;
+
+ if (System.IO.File.Exists(filePath))
+ {
+ contents = System.IO.File.ReadAllText(filePath, System.Text.Encoding.UTF8);
+ }
+ else
+ {
+ // 파일이 없으면 404 에러 페이지 또는 기본 메시지
+ contents = "404 - File Not Found
The requested file was not found: " + filePath + "
";
+ }
+
+ //공용값 적용
+ ApplyCommonValue(ref contents);
+
+ var resp = new HttpResponseMessage()
+ {
+ Content = new StringContent(
+ contents,
+ System.Text.Encoding.UTF8,
+ "text/html")
+ };
+
+ return resp;
+ }
+
+ }
+}
diff --git a/Project/Web/Controller/HomeController.cs b/Project/Web/Controller/HomeController.cs
new file mode 100644
index 0000000..1fde961
--- /dev/null
+++ b/Project/Web/Controller/HomeController.cs
@@ -0,0 +1,299 @@
+using System;
+using System.Linq;
+using System.Net.Http;
+using System.Web.Http;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+
+namespace Project.Web.Controllers
+{
+ // 로그인 요청 모델
+ public class LoginRequest
+ {
+ public string UserId { get; set; }
+ public string Password { get; set; }
+ public bool RememberMe { get; set; }
+ }
+
+ // 로그인 응답 모델
+ public class LoginResponse
+ {
+ public bool Success { get; set; }
+ public string Message { get; set; }
+ public string RedirectUrl { get; set; }
+ public object UserData { get; set; }
+ }
+
+ public class HomeController : 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 string Test()
+ {
+ return "test";
+ }
+
+ [HttpPost]
+ public HttpResponseMessage Login([FromBody] LoginRequest request)
+ {
+ var response = new LoginResponse();
+
+ try
+ {
+ // 입력값 검증
+ if (string.IsNullOrEmpty(request?.UserId) || string.IsNullOrEmpty(request?.Password))
+ {
+ response.Success = false;
+ response.Message = "사용자 ID와 비밀번호를 입력해주세요.";
+ return CreateJsonResponse(response);
+ }
+
+ // TODO: 여기에 실제 데이터베이스 로그인 로직을 구현하세요
+ // 예시: 데이터베이스에서 사용자 정보 확인
+ bool isValidUser = ValidateUser(request.UserId, request.Password);
+
+ if (isValidUser)
+ {
+ // 로그인 성공
+ response.Success = true;
+ response.Message = "로그인에 성공했습니다.";
+ response.RedirectUrl = "/DashBoard";
+
+ // 사용자 정보 설정 (세션 또는 쿠키)
+ SetUserSession(request.UserId, request.RememberMe);
+
+ // 사용자 데이터 반환
+ response.UserData = new
+ {
+ UserId = request.UserId,
+ LoginTime = DateTime.Now,
+ RememberMe = request.RememberMe
+ };
+ }
+ else
+ {
+ // 로그인 실패
+ response.Success = false;
+ response.Message = "사용자 ID 또는 비밀번호가 올바르지 않습니다.";
+ }
+ }
+ catch (Exception ex)
+ {
+ response.Success = false;
+ response.Message = "로그인 처리 중 오류가 발생했습니다: " + ex.Message;
+ }
+
+ return CreateJsonResponse(response);
+ }
+
+ [HttpPost]
+ public HttpResponseMessage Logout()
+ {
+ var response = new LoginResponse();
+
+ try
+ {
+ // TODO: 여기에 로그아웃 로직을 구현하세요
+ // 예시: 세션 정리, 쿠키 삭제 등
+ ClearUserSession();
+
+ response.Success = true;
+ response.Message = "로그아웃되었습니다.";
+ response.RedirectUrl = "/Login";
+ }
+ catch (Exception ex)
+ {
+ response.Success = false;
+ response.Message = "로그아웃 처리 중 오류가 발생했습니다: " + ex.Message;
+ }
+
+ return CreateJsonResponse(response);
+ }
+
+ [HttpGet]
+ public HttpResponseMessage CheckLoginStatus()
+ {
+ var response = new LoginResponse();
+
+ try
+ {
+ // TODO: 여기에 로그인 상태 확인 로직을 구현하세요
+ // 예시: 세션 또는 쿠키에서 사용자 정보 확인
+ var currentUser = GetCurrentUser();
+
+ if (currentUser != null)
+ {
+ response.Success = true;
+ response.Message = "로그인된 상태입니다.";
+ response.UserData = currentUser;
+ }
+ else
+ {
+ response.Success = false;
+ response.Message = "로그인되지 않은 상태입니다.";
+ response.RedirectUrl = "/Login";
+ }
+ }
+ catch (Exception ex)
+ {
+ response.Success = false;
+ response.Message = "로그인 상태 확인 중 오류가 발생했습니다: " + ex.Message;
+ }
+
+ return CreateJsonResponse(response);
+ }
+
+ // 헬퍼 메서드들
+ private bool ValidateUser(string userId, string password)
+ {
+ // TODO: 실제 데이터베이스 검증 로직을 여기에 구현하세요
+ // 예시: 데이터베이스에서 사용자 정보 조회 및 비밀번호 검증
+ var encpass = Pub.MakePasswordEnc(password.Trim());
+
+
+ // 임시 테스트용 (실제로는 데이터베이스에서 확인)
+ return userId == "admin" && password == "admin";
+ }
+
+ private void SetUserSession(string userId, bool rememberMe)
+ {
+ // TODO: 세션 또는 쿠키에 사용자 정보 저장
+ // 예시: HttpContext.Session["UserId"] = userId;
+ // 예시: 쿠키 설정 (rememberMe가 true인 경우)
+ //데이터베이스에서 해당 정보를 찾아와서 처리해야한다
+
+ FCOMMON.info.Login.no = userId;
+ FCOMMON.info.Login.nameK = drUser.name;
+ FCOMMON.info.Login.dept = cmbDept.Text;// userdr.dept;// cmbDept.Text;
+ FCOMMON.info.Login.level = drGrpUser.level;
+ FCOMMON.info.Login.email = drUser.email;
+ FCOMMON.info.Login.nameE = drUser.nameE;
+ FCOMMON.info.Login.hp = drUser.hp;
+ FCOMMON.info.Login.tel = drUser.tel;
+ FCOMMON.info.Login.title = drUser.dept + "(" + drUser.grade + ")";
+ FCOMMON.info.NotShowJobReportview = Pub.setting.NotShowJobreportPRewView;
+ //var gcode = FCOMMON.DBM.ExecuteScalar("select isnull(gcode,'NOGCODE') from UserGroup where dept ='" + cmbDept.Text + "'");
+ var gperm = FCOMMON.DBM.ExecuteScalar("select isnull(permission,0) from UserGroup where dept ='" + cmbDept.Text + "'");
+ FCOMMON.info.Login.gcode = gCode;// gcode;
+ FCOMMON.info.Login.process = drUser.id == "dev" ? "개발자" : drGrpUser.Process;
+ FCOMMON.info.Login.permission = 0;
+ FCOMMON.info.Login.gpermission = int.Parse(gperm);
+ //FCOMMON.info.datapath = Pub.setting.SharedDataPath;
+ FCOMMON.info.ShowBuyerror = Pub.setting.Showbuyerror; //210625
+
+
+ }
+
+ private void ClearUserSession()
+ {
+ // TODO: 세션 또는 쿠키에서 사용자 정보 삭제
+ FCOMMON.info.Login.no = string.Empty;
+ FCOMMON.info.Login.level = 0;
+ FCOMMON.info.Login.gcode = string.Empty;
+ FCOMMON.info.Login.permission = 0;
+ FCOMMON.info.Login.gpermission = 0;
+ Console.WriteLine("logout");
+ }
+
+ private object GetCurrentUser()
+ {
+ // TODO: 현재 로그인된 사용자 정보 반환
+ // 예시: HttpContext.Session["UserId"]에서 사용자 정보 조회
+ return null; // 임시로 null 반환
+ }
+
+ private HttpResponseMessage CreateJsonResponse(object data)
+ {
+ var json = JsonConvert.SerializeObject(data, new JsonSerializerSettings
+ {
+ NullValueHandling = NullValueHandling.Ignore
+ });
+
+ return new HttpResponseMessage()
+ {
+ Content = new StringContent(
+ json,
+ System.Text.Encoding.UTF8,
+ "application/json")
+ };
+ }
+
+ [HttpGet]
+ public HttpResponseMessage Login()
+ {
+ // 직접 파일을 읽어서 반환
+ var filePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Web", "wwwroot", "login.html");
+ var contents = string.Empty;
+
+ if (System.IO.File.Exists(filePath))
+ {
+ contents = System.IO.File.ReadAllText(filePath, System.Text.Encoding.UTF8);
+ }
+ else
+ {
+ // 파일이 없으면 404 에러 페이지 또는 기본 메시지
+ contents = "404 - File Not Found
The requested file was not found: " + filePath + "
";
+ }
+
+ //공용값 적용
+ ApplyCommonValue(ref contents);
+
+ var resp = new HttpResponseMessage()
+ {
+ Content = new StringContent(
+ contents,
+ System.Text.Encoding.UTF8,
+ "text/html")
+ };
+
+ return resp;
+ }
+
+ [HttpGet]
+ public HttpResponseMessage Index()
+ {
+ // 직접 파일을 읽어서 반환
+ var filePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Web", "wwwroot", "index.html");
+ var contents = string.Empty;
+
+ if (System.IO.File.Exists(filePath))
+ {
+ contents = System.IO.File.ReadAllText(filePath, System.Text.Encoding.UTF8);
+ }
+ else
+ {
+ // 파일이 없으면 404 에러 페이지 또는 기본 메시지
+ contents = "404 - File Not Found
The requested file was not found: " + filePath + "
";
+ }
+
+ //공용값 적용
+ ApplyCommonValue(ref contents);
+
+ var resp = new HttpResponseMessage()
+ {
+ Content = new StringContent(
+ contents,
+ System.Text.Encoding.UTF8,
+ "text/html")
+ };
+
+ return resp;
+ }
+
+ }
+}
diff --git a/Project/Controller/ItemController.cs b/Project/Web/Controller/ItemController.cs
similarity index 96%
rename from Project/Controller/ItemController.cs
rename to Project/Web/Controller/ItemController.cs
index a92d9e5..b93d019 100644
--- a/Project/Controller/ItemController.cs
+++ b/Project/Web/Controller/ItemController.cs
@@ -1,153 +1,153 @@
-using System;
-using System.Linq;
-using System.Net.Http;
-using System.Web.Http;
-using System.Windows.Forms;
-
-namespace Project
-{
- public class ItemController : BaseController
- {
-
-
- // PUT api/values/5
- public void Put(int id, [FromBody] string value)
- {
- }
-
- // DELETE api/values/5
- public void Delete(int id)
- {
- }
-
- [HttpGet]
- public string Test()
- {
- return "test";
- }
-
- [HttpGet]
- public HttpResponseMessage Find()
- {
- //로그인이 되어있지않다면 로그인을 가져온다
- MethodResult result;
- result = View();
-
-
- 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();
- if (searchkey.isEmpty() == false && searchkey != "%")
- {
- if (searchkey.StartsWith("%") == false) searchkey = "%" + searchkey;
- if (searchkey.EndsWith("%") == false) searchkey = searchkey + "%";
- }
-
- var tbody = new System.Text.StringBuilder();
-
- //테이블데이터생성
- var itemcnt = 0;
- if (searchkey.isEmpty() == false)
- {
- var db = new dsMSSQLTableAdapters.vFindSIDTableAdapter();// EEEntitiesMain();
- var rows = db.GetData(searchkey);// .vFindSID.Where(t => t.sid.Contains(searchkey) || t.name.Contains(searchkey) || t.model.Contains(searchkey));
- itemcnt = rows.Count();
- foreach (var item in rows)
- {
- tbody.AppendLine("");
- tbody.AppendLine($"| {item.Location} | ");
- tbody.AppendLine($"{item.sid} | ");
- tbody.AppendLine($"{item.name} | ");
- tbody.AppendLine($"{item.model} | ");
-
- if (item.IspriceNull())
- tbody.AppendLine($"-- | ");
- else
- {
- var price = (double)item.price / 1000.0;
-
- tbody.AppendLine($"{price.ToString("N0")} | ");
- }
-
-
- tbody.AppendLine($"{item.manu} | ");
- tbody.AppendLine($"{item.supply} | ");
-
- if (item.remark.Length > 10)
- tbody.AppendLine($"{item.remark.Substring(0, 10)}... | ");
- else
- tbody.AppendLine($"{item.remark} | ");
- tbody.AppendLine("
");
- }
- }
-
- //아잍쳄이 없는경우
- if (itemcnt == 0)
- {
- tbody.AppendLine("");
- tbody.AppendLine("| 자료가 없습니다 | ");
- tbody.AppendLine("
");
- }
-
-
- var contents = result.Content.Replace("{search}", searchkey);
- contents = contents.Replace("{tabledata}", tbody.ToString());
- contents = contents.Replace("{cnt}", itemcnt.ToString());
-
-
- //공용값 적용
- 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;
- }
-
- }
-}
+using System;
+using System.Linq;
+using System.Net.Http;
+using System.Web.Http;
+using System.Windows.Forms;
+
+namespace Project.Web.Controllers
+{
+ public class ItemController : BaseController
+ {
+
+
+ // PUT api/values/5
+ public void Put(int id, [FromBody] string value)
+ {
+ }
+
+ // DELETE api/values/5
+ public void Delete(int id)
+ {
+ }
+
+ [HttpGet]
+ public string Test()
+ {
+ return "test";
+ }
+
+ [HttpGet]
+ public HttpResponseMessage Find()
+ {
+ //로그인이 되어있지않다면 로그인을 가져온다
+ MethodResult result;
+ result = View();
+
+
+ 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();
+ if (searchkey.isEmpty() == false && searchkey != "%")
+ {
+ if (searchkey.StartsWith("%") == false) searchkey = "%" + searchkey;
+ if (searchkey.EndsWith("%") == false) searchkey = searchkey + "%";
+ }
+
+ var tbody = new System.Text.StringBuilder();
+
+ //테이블데이터생성
+ var itemcnt = 0;
+ if (searchkey.isEmpty() == false)
+ {
+ var db = new dsMSSQLTableAdapters.vFindSIDTableAdapter();// EEEntitiesMain();
+ var rows = db.GetData(searchkey);// .vFindSID.Where(t => t.sid.Contains(searchkey) || t.name.Contains(searchkey) || t.model.Contains(searchkey));
+ itemcnt = rows.Count();
+ foreach (var item in rows)
+ {
+ tbody.AppendLine("");
+ tbody.AppendLine($"| {item.Location} | ");
+ tbody.AppendLine($"{item.sid} | ");
+ tbody.AppendLine($"{item.name} | ");
+ tbody.AppendLine($"{item.model} | ");
+
+ if (item.IspriceNull())
+ tbody.AppendLine($"-- | ");
+ else
+ {
+ var price = (double)item.price / 1000.0;
+
+ tbody.AppendLine($"{price.ToString("N0")} | ");
+ }
+
+
+ tbody.AppendLine($"{item.manu} | ");
+ tbody.AppendLine($"{item.supply} | ");
+
+ if (item.remark.Length > 10)
+ tbody.AppendLine($"{item.remark.Substring(0, 10)}... | ");
+ else
+ tbody.AppendLine($"{item.remark} | ");
+ tbody.AppendLine("
");
+ }
+ }
+
+ //아잍쳄이 없는경우
+ if (itemcnt == 0)
+ {
+ tbody.AppendLine("");
+ tbody.AppendLine("| 자료가 없습니다 | ");
+ tbody.AppendLine("
");
+ }
+
+
+ var contents = result.Content.Replace("{search}", searchkey);
+ contents = contents.Replace("{tabledata}", tbody.ToString());
+ contents = contents.Replace("{cnt}", itemcnt.ToString());
+
+
+ //공용값 적용
+ 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;
+ }
+
+ }
+}
diff --git a/Project/Controller/JobreportController.cs b/Project/Web/Controller/JobreportController.cs
similarity index 97%
rename from Project/Controller/JobreportController.cs
rename to Project/Web/Controller/JobreportController.cs
index d5d8e5e..a3b47a9 100644
--- a/Project/Controller/JobreportController.cs
+++ b/Project/Web/Controller/JobreportController.cs
@@ -1,380 +1,380 @@
-using Microsoft.Owin;
-using System;
-using System.Linq;
-using System.Net.Http;
-using System.Web;
-using System.Web.Http;
-
-namespace Project
-{
- public class JobreportController : BaseController
- {
-
-
- // PUT api/values/5
- public void Put(int id, [FromBody] string value)
- {
- }
-
- // DELETE api/values/5
- public void Delete(int id)
- {
- }
-
- [HttpPost]
- public string Add(FormCollection tbpdate)
- {
- 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 dsMSSQLTableAdapters.vJobReportForUserTableAdapter();//. EEEntitiesJobreport();
- var sd = DateTime.Now.ToString("yyyy-MM-01");
- var ed = DateTime.Now.ToShortDateString();
- var rows = db.GetData(FCOMMON.info.Login.gcode, id).FirstOrDefault();//.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]
- public HttpResponseMessage Add()
- {
- //로그인이 되어있지않다면 로그인을 가져온다
- MethodResult result;
- result = View("/jobreport/add");
-
-
- 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 itemcnt = 0;
- //if (searchkey.isEmpty() == false)
- {
- var db = new dsMSSQLTableAdapters.vJobReportForUserTableAdapter();// EEEntitiesJobreport();
- var sd = DateTime.Now.ToString("yyyy-MM-01");
- var ed = DateTime.Now.ToShortDateString();
- var rows = db.GetByDate(FCOMMON.info.Login.gcode, FCOMMON.info.Login.no, sd, ed);
- //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();
- foreach (var item in rows)
- {
- tbody.AppendLine("");
-
- tbody.AppendLine($"| {item.pdate.Substring(5)} | ");
- tbody.AppendLine($"{item.ww} | ");
- tbody.AppendLine($"{item.name} | ");
-
- if (item.status == "진행 중" || item.status.EndsWith("%"))
- tbody.AppendLine($"{item.status} | ");
- else
- tbody.AppendLine($"{item.status} | ");
-
- tbody.AppendLine($"{item.type} | ");
- tbody.AppendLine($"{item.projectName} | ");
- tbody.AppendLine($"{item.hrs} | ");
- tbody.AppendLine($"{item.ot} | ");
-
- tbody.AppendLine("");
- tbody.AppendLine(item.description);
- tbody.AppendLine(" | ");
-
- tbody.AppendLine("
");
- }
- }
-
- //아잍쳄이 없는경우
- if (itemcnt == 0)
- {
- tbody.AppendLine("");
- tbody.AppendLine("| 1 | ");
- tbody.AppendLine("자료가 없습니다 | ");
- tbody.AppendLine("
");
- }
-
-
- var contents = result.Content.Replace("{search}", searchkey);
- contents = contents.Replace("{tabledata}", tbody.ToString());
- contents = contents.Replace("{cnt}", itemcnt.ToString());
-
-
- //공용값 적용
- 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 Find()
- {
- //로그인이 되어있지않다면 로그인을 가져온다
- MethodResult result;
- result = View();
-
-
- 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 itemcnt = 0;
- if (searchkey.isEmpty() == false)
- {
- var db = new dsMSSQLTableAdapters.vJobReportForUserTableAdapter();// EEEntitiesJobreport();
- var sd = DateTime.Now.ToShortDateString();
- var rows = db.GetByToday(FCOMMON.info.Login.gcode, sd);//.vJobReportForUser.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.pdate.CompareTo(sd) == 0).OrderBy(t => t.name);
- itemcnt = rows.Count();
- foreach (var item in rows)
- {
- tbody.AppendLine("");
- tbody.AppendLine($"| {item.pdate} | ");
- tbody.AppendLine($"{item.status} | ");
- tbody.AppendLine($"{item.name} | ");
- tbody.AppendLine($"{item.projectName} | ");
- tbody.AppendLine($"{item.hrs} | ");
- tbody.AppendLine($"{item.ot} | ");
- tbody.AppendLine($"{item.description} | ");
-
-
- if (item.description.Length > 10)
- tbody.AppendLine($"{item.description.Substring(0, 10)}... | ");
- else
- tbody.AppendLine($"{item.description} | ");
- tbody.AppendLine("
");
- }
- }
-
- //아잍쳄이 없는경우
- if (itemcnt == 0)
- {
- tbody.AppendLine("");
- tbody.AppendLine("| 1 | ");
- tbody.AppendLine("자료가 없습니다 | ");
- tbody.AppendLine("
");
- }
-
-
- var contents = result.Content.Replace("{search}", searchkey);
- contents = contents.Replace("{tabledata}", tbody.ToString());
- contents = contents.Replace("{cnt}", itemcnt.ToString());
-
-
- //공용값 적용
- 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 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 itemcnt = 0;
- //if (searchkey.isEmpty() == false)
- {
- var db = new dsMSSQLTableAdapters.vJobReportForUserTableAdapter();// EEEntitiesJobreport();
- var sd = DateTime.Now.ToShortDateString();
- var ed = DateTime.Now.ToShortDateString();
- var rows = db.GetByDate(FCOMMON.info.Login.gcode, FCOMMON.info.Login.no, sd, ed);
- //.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();
- foreach (var item in rows)
- {
- tbody.AppendLine("");
-
- tbody.AppendLine($"| {item.pdate.Substring(5)} | ");
- tbody.AppendLine($"{item.ww} | ");
- tbody.AppendLine($"{item.name} | ");
-
- if (item.status == "진행 중" || item.status.EndsWith("%"))
- tbody.AppendLine($"{item.status} | ");
- else
- tbody.AppendLine($"{item.status} | ");
-
- tbody.AppendLine($"{item.type} | ");
- tbody.AppendLine($"{item.projectName} | ");
- tbody.AppendLine($"{item.hrs} | ");
- tbody.AppendLine($"{item.ot} | ");
-
- tbody.AppendLine("");
- tbody.AppendLine(item.description);
- tbody.AppendLine(" | ");
-
- tbody.AppendLine("
");
- }
- }
-
-
-
- //아잍쳄이 없는경우
- if (itemcnt == 0)
- {
- tbody.AppendLine("");
- tbody.AppendLine("| 1 | ");
- tbody.AppendLine("자료가 없습니다 | ");
- tbody.AppendLine("
");
- }
-
-
- var contents = result.Content.Replace("{search}", searchkey);
- contents = contents.Replace("{tabledata}", tbody.ToString());
- contents = contents.Replace("{cnt}", itemcnt.ToString());
-
-
- //공용값 적용
- ApplyCommonValue(ref contents);
-
- //최종문자 적용
- result.Content = contents;
-
- var resp = new HttpResponseMessage()
- {
- Content = new StringContent(
- result.Content,
- System.Text.Encoding.UTF8,
- "text/html")
- };
-
- return resp;
- }
-
- }
-}
+using Microsoft.Owin;
+using System;
+using System.Linq;
+using System.Net.Http;
+using System.Web;
+using System.Web.Http;
+
+namespace Project.Web.Controllers
+{
+ public class JobreportController : BaseController
+ {
+
+
+ // PUT api/values/5
+ public void Put(int id, [FromBody] string value)
+ {
+ }
+
+ // DELETE api/values/5
+ public void Delete(int id)
+ {
+ }
+
+ [HttpPost]
+ public string Add(FormCollection tbpdate)
+ {
+ 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 dsMSSQLTableAdapters.vJobReportForUserTableAdapter();//. EEEntitiesJobreport();
+ var sd = DateTime.Now.ToString("yyyy-MM-01");
+ var ed = DateTime.Now.ToShortDateString();
+ var rows = db.GetData(FCOMMON.info.Login.gcode, id).FirstOrDefault();//.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]
+ public HttpResponseMessage Add()
+ {
+ //로그인이 되어있지않다면 로그인을 가져온다
+ MethodResult result;
+ result = View("/jobreport/add");
+
+
+ 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 itemcnt = 0;
+ //if (searchkey.isEmpty() == false)
+ {
+ var db = new dsMSSQLTableAdapters.vJobReportForUserTableAdapter();// EEEntitiesJobreport();
+ var sd = DateTime.Now.ToString("yyyy-MM-01");
+ var ed = DateTime.Now.ToShortDateString();
+ var rows = db.GetByDate(FCOMMON.info.Login.gcode, FCOMMON.info.Login.no, sd, ed);
+ //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();
+ foreach (var item in rows)
+ {
+ tbody.AppendLine("");
+
+ tbody.AppendLine($"| {item.pdate.Substring(5)} | ");
+ tbody.AppendLine($"{item.ww} | ");
+ tbody.AppendLine($"{item.name} | ");
+
+ if (item.status == "진행 중" || item.status.EndsWith("%"))
+ tbody.AppendLine($"{item.status} | ");
+ else
+ tbody.AppendLine($"{item.status} | ");
+
+ tbody.AppendLine($"{item.type} | ");
+ tbody.AppendLine($"{item.projectName} | ");
+ tbody.AppendLine($"{item.hrs} | ");
+ tbody.AppendLine($"{item.ot} | ");
+
+ tbody.AppendLine("");
+ tbody.AppendLine(item.description);
+ tbody.AppendLine(" | ");
+
+ tbody.AppendLine("
");
+ }
+ }
+
+ //아잍쳄이 없는경우
+ if (itemcnt == 0)
+ {
+ tbody.AppendLine("");
+ tbody.AppendLine("| 1 | ");
+ tbody.AppendLine("자료가 없습니다 | ");
+ tbody.AppendLine("
");
+ }
+
+
+ var contents = result.Content.Replace("{search}", searchkey);
+ contents = contents.Replace("{tabledata}", tbody.ToString());
+ contents = contents.Replace("{cnt}", itemcnt.ToString());
+
+
+ //공용값 적용
+ 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 Find()
+ {
+ //로그인이 되어있지않다면 로그인을 가져온다
+ MethodResult result;
+ result = View();
+
+
+ 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 itemcnt = 0;
+ if (searchkey.isEmpty() == false)
+ {
+ var db = new dsMSSQLTableAdapters.vJobReportForUserTableAdapter();// EEEntitiesJobreport();
+ var sd = DateTime.Now.ToShortDateString();
+ var rows = db.GetByToday(FCOMMON.info.Login.gcode, sd);//.vJobReportForUser.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.pdate.CompareTo(sd) == 0).OrderBy(t => t.name);
+ itemcnt = rows.Count();
+ foreach (var item in rows)
+ {
+ tbody.AppendLine("");
+ tbody.AppendLine($"| {item.pdate} | ");
+ tbody.AppendLine($"{item.status} | ");
+ tbody.AppendLine($"{item.name} | ");
+ tbody.AppendLine($"{item.projectName} | ");
+ tbody.AppendLine($"{item.hrs} | ");
+ tbody.AppendLine($"{item.ot} | ");
+ tbody.AppendLine($"{item.description} | ");
+
+
+ if (item.description.Length > 10)
+ tbody.AppendLine($"{item.description.Substring(0, 10)}... | ");
+ else
+ tbody.AppendLine($"{item.description} | ");
+ tbody.AppendLine("
");
+ }
+ }
+
+ //아잍쳄이 없는경우
+ if (itemcnt == 0)
+ {
+ tbody.AppendLine("");
+ tbody.AppendLine("| 1 | ");
+ tbody.AppendLine("자료가 없습니다 | ");
+ tbody.AppendLine("
");
+ }
+
+
+ var contents = result.Content.Replace("{search}", searchkey);
+ contents = contents.Replace("{tabledata}", tbody.ToString());
+ contents = contents.Replace("{cnt}", itemcnt.ToString());
+
+
+ //공용값 적용
+ 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 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 itemcnt = 0;
+ //if (searchkey.isEmpty() == false)
+ {
+ var db = new dsMSSQLTableAdapters.vJobReportForUserTableAdapter();// EEEntitiesJobreport();
+ var sd = DateTime.Now.ToShortDateString();
+ var ed = DateTime.Now.ToShortDateString();
+ var rows = db.GetByDate(FCOMMON.info.Login.gcode, FCOMMON.info.Login.no, sd, ed);
+ //.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();
+ foreach (var item in rows)
+ {
+ tbody.AppendLine("");
+
+ tbody.AppendLine($"| {item.pdate.Substring(5)} | ");
+ tbody.AppendLine($"{item.ww} | ");
+ tbody.AppendLine($"{item.name} | ");
+
+ if (item.status == "진행 중" || item.status.EndsWith("%"))
+ tbody.AppendLine($"{item.status} | ");
+ else
+ tbody.AppendLine($"{item.status} | ");
+
+ tbody.AppendLine($"{item.type} | ");
+ tbody.AppendLine($"{item.projectName} | ");
+ tbody.AppendLine($"{item.hrs} | ");
+ tbody.AppendLine($"{item.ot} | ");
+
+ tbody.AppendLine("");
+ tbody.AppendLine(item.description);
+ tbody.AppendLine(" | ");
+
+ tbody.AppendLine("
");
+ }
+ }
+
+
+
+ //아잍쳄이 없는경우
+ if (itemcnt == 0)
+ {
+ tbody.AppendLine("");
+ tbody.AppendLine("| 1 | ");
+ tbody.AppendLine("자료가 없습니다 | ");
+ tbody.AppendLine("
");
+ }
+
+
+ var contents = result.Content.Replace("{search}", searchkey);
+ contents = contents.Replace("{tabledata}", tbody.ToString());
+ contents = contents.Replace("{cnt}", itemcnt.ToString());
+
+
+ //공용값 적용
+ ApplyCommonValue(ref contents);
+
+ //최종문자 적용
+ result.Content = contents;
+
+ var resp = new HttpResponseMessage()
+ {
+ Content = new StringContent(
+ result.Content,
+ System.Text.Encoding.UTF8,
+ "text/html")
+ };
+
+ return resp;
+ }
+
+ }
+}
diff --git a/Project/Controller/ManualController.cs b/Project/Web/Controller/ManualController.cs
similarity index 95%
rename from Project/Controller/ManualController.cs
rename to Project/Web/Controller/ManualController.cs
index 0231134..db09e5f 100644
--- a/Project/Controller/ManualController.cs
+++ b/Project/Web/Controller/ManualController.cs
@@ -1,88 +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;
- }
-
- }
-}
+using System;
+using System.Linq;
+using System.Net.Http;
+using System.Web.Http;
+
+namespace Project.Web.Controllers
+{
+ 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;
+ }
+
+ }
+}
diff --git a/Project/Controller/ProjectController.cs b/Project/Web/Controller/ProjectController.cs
similarity index 97%
rename from Project/Controller/ProjectController.cs
rename to Project/Web/Controller/ProjectController.cs
index 72c2295..7ff6b62 100644
--- a/Project/Controller/ProjectController.cs
+++ b/Project/Web/Controller/ProjectController.cs
@@ -1,471 +1,471 @@
-using System;
-using System.Linq;
-using System.Net.Http;
-using System.Web.Http;
-
-namespace Project
-{
- public class ProjectController : BaseController
- {
-
-
- // PUT api/values/5
- public void Put(int id, [FromBody] string value)
- {
- }
-
- // DELETE api/values/5
- public void Delete(int id)
- {
- }
-
- [HttpGet]
- public string Test()
- {
- return "test";
- }
-
- [HttpGet]
- public HttpResponseMessage Find()
- {
- //로그인이 되어있지않다면 로그인을 가져온다
- MethodResult result;
- result = View();
-
-
- 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 itemcnt = 0;
- if (searchkey.isEmpty() == false)
- {
- //var db = new EEEntitiesProject();
-
-
- //var rows = db.Projects.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.status.Contains("완료") == false).OrderByDescending(t => t.pdate).Take(50);
-
- //itemcnt = rows.Count();
- //foreach (var item in rows)
- //{
- // tbody.AppendLine("");
- // tbody.AppendLine($"| {item.pdate} | ");
- // tbody.AppendLine($"{item.name} | ");
-
-
- // //if (item.description.Length > 10)
- // // tbody.AppendLine($"{item.description.Substring(0, 10)}... | ");
- // //else
- // // tbody.AppendLine($"{item.description} | ");
- // tbody.AppendLine("
");
- //}
- }
-
- //아잍쳄이 없는경우
- if (itemcnt == 0)
- {
- tbody.AppendLine("");
- tbody.AppendLine("| 1 | ");
- tbody.AppendLine("자료가 없습니다 | ");
- tbody.AppendLine("
");
- }
-
-
- var contents = result.Content.Replace("{search}", searchkey);
- contents = contents.Replace("{tabledata}", tbody.ToString());
- contents = contents.Replace("{cnt}", itemcnt.ToString());
-
-
- //공용값 적용
- 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 ScheduleConfirm(int? id)
- {
- //로그인이 되어있지않다면 로그인을 가져온다
- MethodResult result;
- result = View();
- var project = (int)id;
-
- //데이터를 조회해서 표시를 해준다.
- var db = new dsProjectsTableAdapters.ProjectsTableAdapter();// EEEntitiesProject();
- var prjinfo = db.GetData(FCOMMON.info.Login.gcode, project).FirstOrDefault();// db.Projects.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.idx == project).FirstOrDefault();
-
- var taSch = new dsProjectsTableAdapters.EETGW_ProjectsScheduleTableAdapter();
- var schrows = taSch.GetData(FCOMMON.info.Login.gcode, project);//. db.EETGW_ProjectsSchedule.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.project == project).OrderByDescending(t => t.project).OrderByDescending(t => t.no).OrderBy(t => t.seq);
-
- var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
-
-
- System.Text.StringBuilder tinfo = new System.Text.StringBuilder();
- //프로젝트정보를 표시합니다.
- tinfo.AppendLine("");
- tinfo.AppendLine(string.Format("| {0} | ", prjinfo.idx));
- tinfo.AppendLine(string.Format("{0} | ", prjinfo.status));
- tinfo.AppendLine(string.Format("{0} | ", prjinfo.progress));
- tinfo.AppendLine(string.Format("{0} | ", prjinfo.name));
- tinfo.AppendLine(string.Format("{0} | ", prjinfo.reqstaff));
- tinfo.AppendLine(string.Format("{0} | ", prjinfo.userManager));
- tinfo.AppendLine(string.Format("{0} | ", prjinfo.orderno));
- tinfo.AppendLine("
");
-
-
- var contents = result.Content.Replace("{search}", "");
- contents = contents.Replace("{tableinfo}", tinfo.ToString());
-
- tinfo.Clear();
- foreach (var item in schrows)
- {
- tinfo.AppendLine("");
- tinfo.AppendLine(string.Format("| {0} | ", item.no));
- tinfo.AppendLine(string.Format("{0} | ", item.seq));
- tinfo.AppendLine(string.Format("{0} | ", item.title));
- tinfo.AppendLine(string.Format("{0} | ", item.sw));
- tinfo.AppendLine(string.Format("{0} | ", item.ew));
- tinfo.AppendLine(string.Format("{0} | ", item.swa));
- tinfo.AppendLine(string.Format("{0} | ", item.ewa));
- tinfo.AppendLine(string.Format("{0} | ", item.progress));
- tinfo.AppendLine(string.Format("{0} | ", item.uid));
- tinfo.AppendLine(string.Format("{0} | ", item.memo));
- tinfo.AppendLine("
");
- }
- contents = contents.Replace("{scheinfo}", tinfo.ToString());
- //공용값 적용
- 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 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 itemcnt = 0;
- //if (searchkey.isEmpty() == false)
- {
-
- var db = new dsProjectsTableAdapters.ProjectsTableAdapter();// EEEntitiesProject();
-
-
- var rows = db.GetNotCompleteTop50(FCOMMON.info.Login.gcode);//.Projects.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.status.Contains("완료") == false).OrderByDescending(t => t.pdate).Take(50);
-
- itemcnt = rows.Count();
- foreach (var item in rows)
- {
- tbody.AppendLine("");
- tbody.AppendLine($"| {item.idx} | ");
- tbody.AppendLine($"{item.status} | ");
- tbody.AppendLine($"{item.progress} | ");
- tbody.AppendLine($"{item.name} | ");
- tbody.AppendLine($"{item.reqstaff} | ");
- tbody.AppendLine($"{item.userManager} | ");
- tbody.AppendLine($"{item.cnt} | ");
- tbody.AppendLine($"{item.costo} | ");
- tbody.AppendLine($"{item.costn} | ");
- tbody.AppendLine($"{item.costo - item.costn} | ");
- tbody.AppendLine($"{item.orderno} | ");
- if (item.memo != null)
- tbody.AppendLine($"{item.memo} | ");
- else
- tbody.AppendLine($" | ");
-
-
-
- //if (item.description.Length > 10)
- // tbody.AppendLine($"{item.description.Substring(0, 10)}... | ");
- //else
- // tbody.AppendLine($"{item.description} | ");
- tbody.AppendLine("
");
- }
- }
-
- //아잍쳄이 없는경우
- if (itemcnt == 0)
- {
- tbody.AppendLine("");
- tbody.AppendLine("| 1 | ");
- tbody.AppendLine("자료가 없습니다 | ");
- tbody.AppendLine("
");
- }
-
-
- var contents = result.Content.Replace("{search}", searchkey);
- contents = contents.Replace("{tabledata}", tbody.ToString());
- contents = contents.Replace("{cnt}", itemcnt.ToString());
-
-
- //공용값 적용
- 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 detail(int id)
- {
- //로그인이 되어있지않다면 로그인을 가져온다
- MethodResult result;
- result = View();
-
-
- 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 itemcnt = 0;
- //if (searchkey.isEmpty() == false)
- {
-
- var db = new dsProjectsTableAdapters.ProjectsTableAdapter();// EEEntitiesProject();
-
-
- var rows = db.GetNotCompleteTop50(FCOMMON.info.Login.gcode);// db.Projects.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.status.Contains("완료") == false).OrderByDescending(t => t.pdate).Take(50);
-
- itemcnt = rows.Count();
- foreach (var item in rows)
- {
- tbody.AppendLine("");
- tbody.AppendLine($"| {item.idx} | ");
- tbody.AppendLine($"{item.status} | ");
- tbody.AppendLine($"{item.progress} | ");
- tbody.AppendLine($"{item.name} | ");
- tbody.AppendLine($"{item.reqstaff} | ");
- tbody.AppendLine($"{item.userManager} | ");
- tbody.AppendLine($"{item.cnt} | ");
- tbody.AppendLine($"{item.costo} | ");
- tbody.AppendLine($"{item.costn} | ");
- tbody.AppendLine($"{item.costo - item.costn} | ");
- tbody.AppendLine($"{item.orderno} | ");
- if (item.memo != null)
- tbody.AppendLine($"{item.memo} | ");
- else
- tbody.AppendLine($" | ");
-
-
-
- //if (item.description.Length > 10)
- // tbody.AppendLine($"{item.description.Substring(0, 10)}... | ");
- //else
- // tbody.AppendLine($"{item.description} | ");
- tbody.AppendLine("
");
- }
- }
-
- //아잍쳄이 없는경우
- if (itemcnt == 0)
- {
- tbody.AppendLine("");
- tbody.AppendLine("| 1 | ");
- tbody.AppendLine("자료가 없습니다 | ");
- tbody.AppendLine("
");
- }
-
-
- var contents = result.Content.Replace("{search}", searchkey);
- contents = contents.Replace("{tabledata}", tbody.ToString());
- contents = contents.Replace("{cnt}", itemcnt.ToString());
- contents = contents.Replace("{pidx}", id.ToString());
-
-
- //공용값 적용
- 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 partlist(int id)
- {
- //로그인이 되어있지않다면 로그인을 가져온다
- MethodResult result;
- result = View();
-
-
- 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 contents = result.Content.Replace("{search}", searchkey);
-
-
- //테이블데이터생성
- var itemcnt = 0;
- //if (searchkey.isEmpty() == false)
- {
-
- var db = new dsProjectsTableAdapters.ProjectsTableAdapter();// EEEntitiesProject();
-
- var prjinfo = db.GetData(FCOMMON.info.Login.gcode, id).FirstOrDefault();// db.Projects.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.idx == id).FirstOrDefault();
- System.Text.StringBuilder tinfo = new System.Text.StringBuilder();
- //프로젝트정보를 표시합니다.
- tinfo.AppendLine("");
- tinfo.AppendLine(string.Format("| {0} | ", prjinfo.idx));
- tinfo.AppendLine(string.Format("{0} | ", prjinfo.status));
- tinfo.AppendLine(string.Format("{0} | ", prjinfo.progress));
- tinfo.AppendLine(string.Format("{0} | ", prjinfo.name));
- tinfo.AppendLine(string.Format("{0} | ", prjinfo.reqstaff));
- tinfo.AppendLine(string.Format("{0} | ", prjinfo.userManager));
- tinfo.AppendLine(string.Format("{0} | ", prjinfo.orderno));
- tinfo.AppendLine("
");
-
- contents = contents.Replace("{tableinfo}", tinfo.ToString());
-
- var taPart = new dsProjectsTableAdapters.ProjectsPartTableAdapter();
- var rows = taPart.GetData(id);// db.ProjectsPart.Where(t => t.Project == id).OrderBy(t=>t.no);
-
- itemcnt = rows.Count();
- foreach (var item in rows)
- {
- tbody.AppendLine("");
- tbody.AppendLine($"| {item.no} | ");
- tbody.AppendLine($"{item.ItemGroup} | ");
- tbody.AppendLine($"{item.ItemModel} | ");
- tbody.AppendLine($"{item.ItemUnit} | ");
- tbody.AppendLine($"{item.ItemName} | ");
- tbody.AppendLine($"{item.ItemSid} | ");
- tbody.AppendLine($"{item.ItemManu} | ");
- tbody.AppendLine($"{item.qty} | ");
- tbody.AppendLine($"{item.qtyn} | ");
- tbody.AppendLine($"{item.price} | ");
- tbody.AppendLine($"{item.amt} | ");
- tbody.AppendLine($"{item.amtn} | ");
- tbody.AppendLine($"{item.remark} | ");
- tbody.AppendLine($"{item.qtybuy} | ");
- tbody.AppendLine($"{item.qtyin} | ");
- tbody.AppendLine($"{item.bbuy} | ");
- tbody.AppendLine($"{item.bconfirm} | ");
- tbody.AppendLine("
");
- }
- }
-
- //아잍쳄이 없는경우
- if (itemcnt == 0)
- {
- tbody.AppendLine("");
- tbody.AppendLine("| 1 | ");
- tbody.AppendLine("자료가 없습니다 | ");
- tbody.AppendLine("
");
- }
-
-
- contents = contents.Replace("{tabledata}", tbody.ToString());
- contents = contents.Replace("{cnt}", itemcnt.ToString());
- contents = contents.Replace("{pidx}", id.ToString());
-
-
- //공용값 적용
- ApplyCommonValue(ref contents);
-
- //최종문자 적용
- result.Content = contents;
-
- var resp = new HttpResponseMessage()
- {
- Content = new StringContent(
- result.Content,
- System.Text.Encoding.UTF8,
- "text/html")
- };
-
- return resp;
- }
-
- }
-}
+using System;
+using System.Linq;
+using System.Net.Http;
+using System.Web.Http;
+
+namespace Project.Web.Controllers
+{
+ public class ProjectController : BaseController
+ {
+
+
+ // PUT api/values/5
+ public void Put(int id, [FromBody] string value)
+ {
+ }
+
+ // DELETE api/values/5
+ public void Delete(int id)
+ {
+ }
+
+ [HttpGet]
+ public string Test()
+ {
+ return "test";
+ }
+
+ [HttpGet]
+ public HttpResponseMessage Find()
+ {
+ //로그인이 되어있지않다면 로그인을 가져온다
+ MethodResult result;
+ result = View();
+
+
+ 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 itemcnt = 0;
+ if (searchkey.isEmpty() == false)
+ {
+ //var db = new EEEntitiesProject();
+
+
+ //var rows = db.Projects.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.status.Contains("완료") == false).OrderByDescending(t => t.pdate).Take(50);
+
+ //itemcnt = rows.Count();
+ //foreach (var item in rows)
+ //{
+ // tbody.AppendLine("");
+ // tbody.AppendLine($"| {item.pdate} | ");
+ // tbody.AppendLine($"{item.name} | ");
+
+
+ // //if (item.description.Length > 10)
+ // // tbody.AppendLine($"{item.description.Substring(0, 10)}... | ");
+ // //else
+ // // tbody.AppendLine($"{item.description} | ");
+ // tbody.AppendLine("
");
+ //}
+ }
+
+ //아잍쳄이 없는경우
+ if (itemcnt == 0)
+ {
+ tbody.AppendLine("");
+ tbody.AppendLine("| 1 | ");
+ tbody.AppendLine("자료가 없습니다 | ");
+ tbody.AppendLine("
");
+ }
+
+
+ var contents = result.Content.Replace("{search}", searchkey);
+ contents = contents.Replace("{tabledata}", tbody.ToString());
+ contents = contents.Replace("{cnt}", itemcnt.ToString());
+
+
+ //공용값 적용
+ 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 ScheduleConfirm(int? id)
+ {
+ //로그인이 되어있지않다면 로그인을 가져온다
+ MethodResult result;
+ result = View();
+ var project = (int)id;
+
+ //데이터를 조회해서 표시를 해준다.
+ var db = new dsProjectsTableAdapters.ProjectsTableAdapter();// EEEntitiesProject();
+ var prjinfo = db.GetData(FCOMMON.info.Login.gcode, project).FirstOrDefault();// db.Projects.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.idx == project).FirstOrDefault();
+
+ var taSch = new dsProjectsTableAdapters.EETGW_ProjectsScheduleTableAdapter();
+ var schrows = taSch.GetData(FCOMMON.info.Login.gcode, project);//. db.EETGW_ProjectsSchedule.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.project == project).OrderByDescending(t => t.project).OrderByDescending(t => t.no).OrderBy(t => t.seq);
+
+ var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
+
+
+ System.Text.StringBuilder tinfo = new System.Text.StringBuilder();
+ //프로젝트정보를 표시합니다.
+ tinfo.AppendLine("");
+ tinfo.AppendLine(string.Format("| {0} | ", prjinfo.idx));
+ tinfo.AppendLine(string.Format("{0} | ", prjinfo.status));
+ tinfo.AppendLine(string.Format("{0} | ", prjinfo.progress));
+ tinfo.AppendLine(string.Format("{0} | ", prjinfo.name));
+ tinfo.AppendLine(string.Format("{0} | ", prjinfo.reqstaff));
+ tinfo.AppendLine(string.Format("{0} | ", prjinfo.userManager));
+ tinfo.AppendLine(string.Format("{0} | ", prjinfo.orderno));
+ tinfo.AppendLine("
");
+
+
+ var contents = result.Content.Replace("{search}", "");
+ contents = contents.Replace("{tableinfo}", tinfo.ToString());
+
+ tinfo.Clear();
+ foreach (var item in schrows)
+ {
+ tinfo.AppendLine("");
+ tinfo.AppendLine(string.Format("| {0} | ", item.no));
+ tinfo.AppendLine(string.Format("{0} | ", item.seq));
+ tinfo.AppendLine(string.Format("{0} | ", item.title));
+ tinfo.AppendLine(string.Format("{0} | ", item.sw));
+ tinfo.AppendLine(string.Format("{0} | ", item.ew));
+ tinfo.AppendLine(string.Format("{0} | ", item.swa));
+ tinfo.AppendLine(string.Format("{0} | ", item.ewa));
+ tinfo.AppendLine(string.Format("{0} | ", item.progress));
+ tinfo.AppendLine(string.Format("{0} | ", item.uid));
+ tinfo.AppendLine(string.Format("{0} | ", item.memo));
+ tinfo.AppendLine("
");
+ }
+ contents = contents.Replace("{scheinfo}", tinfo.ToString());
+ //공용값 적용
+ 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 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 itemcnt = 0;
+ //if (searchkey.isEmpty() == false)
+ {
+
+ var db = new dsProjectsTableAdapters.ProjectsTableAdapter();// EEEntitiesProject();
+
+
+ var rows = db.GetNotCompleteTop50(FCOMMON.info.Login.gcode);//.Projects.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.status.Contains("완료") == false).OrderByDescending(t => t.pdate).Take(50);
+
+ itemcnt = rows.Count();
+ foreach (var item in rows)
+ {
+ tbody.AppendLine("");
+ tbody.AppendLine($"| {item.idx} | ");
+ tbody.AppendLine($"{item.status} | ");
+ tbody.AppendLine($"{item.progress} | ");
+ tbody.AppendLine($"{item.name} | ");
+ tbody.AppendLine($"{item.reqstaff} | ");
+ tbody.AppendLine($"{item.userManager} | ");
+ tbody.AppendLine($"{item.cnt} | ");
+ tbody.AppendLine($"{item.costo} | ");
+ tbody.AppendLine($"{item.costn} | ");
+ tbody.AppendLine($"{item.costo - item.costn} | ");
+ tbody.AppendLine($"{item.orderno} | ");
+ if (item.memo != null)
+ tbody.AppendLine($"{item.memo} | ");
+ else
+ tbody.AppendLine($" | ");
+
+
+
+ //if (item.description.Length > 10)
+ // tbody.AppendLine($"{item.description.Substring(0, 10)}... | ");
+ //else
+ // tbody.AppendLine($"{item.description} | ");
+ tbody.AppendLine("
");
+ }
+ }
+
+ //아잍쳄이 없는경우
+ if (itemcnt == 0)
+ {
+ tbody.AppendLine("");
+ tbody.AppendLine("| 1 | ");
+ tbody.AppendLine("자료가 없습니다 | ");
+ tbody.AppendLine("
");
+ }
+
+
+ var contents = result.Content.Replace("{search}", searchkey);
+ contents = contents.Replace("{tabledata}", tbody.ToString());
+ contents = contents.Replace("{cnt}", itemcnt.ToString());
+
+
+ //공용값 적용
+ 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 detail(int id)
+ {
+ //로그인이 되어있지않다면 로그인을 가져온다
+ MethodResult result;
+ result = View();
+
+
+ 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 itemcnt = 0;
+ //if (searchkey.isEmpty() == false)
+ {
+
+ var db = new dsProjectsTableAdapters.ProjectsTableAdapter();// EEEntitiesProject();
+
+
+ var rows = db.GetNotCompleteTop50(FCOMMON.info.Login.gcode);// db.Projects.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.status.Contains("완료") == false).OrderByDescending(t => t.pdate).Take(50);
+
+ itemcnt = rows.Count();
+ foreach (var item in rows)
+ {
+ tbody.AppendLine("");
+ tbody.AppendLine($"| {item.idx} | ");
+ tbody.AppendLine($"{item.status} | ");
+ tbody.AppendLine($"{item.progress} | ");
+ tbody.AppendLine($"{item.name} | ");
+ tbody.AppendLine($"{item.reqstaff} | ");
+ tbody.AppendLine($"{item.userManager} | ");
+ tbody.AppendLine($"{item.cnt} | ");
+ tbody.AppendLine($"{item.costo} | ");
+ tbody.AppendLine($"{item.costn} | ");
+ tbody.AppendLine($"{item.costo - item.costn} | ");
+ tbody.AppendLine($"{item.orderno} | ");
+ if (item.memo != null)
+ tbody.AppendLine($"{item.memo} | ");
+ else
+ tbody.AppendLine($" | ");
+
+
+
+ //if (item.description.Length > 10)
+ // tbody.AppendLine($"{item.description.Substring(0, 10)}... | ");
+ //else
+ // tbody.AppendLine($"{item.description} | ");
+ tbody.AppendLine("
");
+ }
+ }
+
+ //아잍쳄이 없는경우
+ if (itemcnt == 0)
+ {
+ tbody.AppendLine("");
+ tbody.AppendLine("| 1 | ");
+ tbody.AppendLine("자료가 없습니다 | ");
+ tbody.AppendLine("
");
+ }
+
+
+ var contents = result.Content.Replace("{search}", searchkey);
+ contents = contents.Replace("{tabledata}", tbody.ToString());
+ contents = contents.Replace("{cnt}", itemcnt.ToString());
+ contents = contents.Replace("{pidx}", id.ToString());
+
+
+ //공용값 적용
+ 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 partlist(int id)
+ {
+ //로그인이 되어있지않다면 로그인을 가져온다
+ MethodResult result;
+ result = View();
+
+
+ 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 contents = result.Content.Replace("{search}", searchkey);
+
+
+ //테이블데이터생성
+ var itemcnt = 0;
+ //if (searchkey.isEmpty() == false)
+ {
+
+ var db = new dsProjectsTableAdapters.ProjectsTableAdapter();// EEEntitiesProject();
+
+ var prjinfo = db.GetData(FCOMMON.info.Login.gcode, id).FirstOrDefault();// db.Projects.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.idx == id).FirstOrDefault();
+ System.Text.StringBuilder tinfo = new System.Text.StringBuilder();
+ //프로젝트정보를 표시합니다.
+ tinfo.AppendLine("");
+ tinfo.AppendLine(string.Format("| {0} | ", prjinfo.idx));
+ tinfo.AppendLine(string.Format("{0} | ", prjinfo.status));
+ tinfo.AppendLine(string.Format("{0} | ", prjinfo.progress));
+ tinfo.AppendLine(string.Format("{0} | ", prjinfo.name));
+ tinfo.AppendLine(string.Format("{0} | ", prjinfo.reqstaff));
+ tinfo.AppendLine(string.Format("{0} | ", prjinfo.userManager));
+ tinfo.AppendLine(string.Format("{0} | ", prjinfo.orderno));
+ tinfo.AppendLine("
");
+
+ contents = contents.Replace("{tableinfo}", tinfo.ToString());
+
+ var taPart = new dsProjectsTableAdapters.ProjectsPartTableAdapter();
+ var rows = taPart.GetData(id);// db.ProjectsPart.Where(t => t.Project == id).OrderBy(t=>t.no);
+
+ itemcnt = rows.Count();
+ foreach (var item in rows)
+ {
+ tbody.AppendLine("");
+ tbody.AppendLine($"| {item.no} | ");
+ tbody.AppendLine($"{item.ItemGroup} | ");
+ tbody.AppendLine($"{item.ItemModel} | ");
+ tbody.AppendLine($"{item.ItemUnit} | ");
+ tbody.AppendLine($"{item.ItemName} | ");
+ tbody.AppendLine($"{item.ItemSid} | ");
+ tbody.AppendLine($"{item.ItemManu} | ");
+ tbody.AppendLine($"{item.qty} | ");
+ tbody.AppendLine($"{item.qtyn} | ");
+ tbody.AppendLine($"{item.price} | ");
+ tbody.AppendLine($"{item.amt} | ");
+ tbody.AppendLine($"{item.amtn} | ");
+ tbody.AppendLine($"{item.remark} | ");
+ tbody.AppendLine($"{item.qtybuy} | ");
+ tbody.AppendLine($"{item.qtyin} | ");
+ tbody.AppendLine($"{item.bbuy} | ");
+ tbody.AppendLine($"{item.bconfirm} | ");
+ tbody.AppendLine("
");
+ }
+ }
+
+ //아잍쳄이 없는경우
+ if (itemcnt == 0)
+ {
+ tbody.AppendLine("");
+ tbody.AppendLine("| 1 | ");
+ tbody.AppendLine("자료가 없습니다 | ");
+ tbody.AppendLine("
");
+ }
+
+
+ contents = contents.Replace("{tabledata}", tbody.ToString());
+ contents = contents.Replace("{cnt}", itemcnt.ToString());
+ contents = contents.Replace("{pidx}", id.ToString());
+
+
+ //공용값 적용
+ ApplyCommonValue(ref contents);
+
+ //최종문자 적용
+ result.Content = contents;
+
+ var resp = new HttpResponseMessage()
+ {
+ Content = new StringContent(
+ result.Content,
+ System.Text.Encoding.UTF8,
+ "text/html")
+ };
+
+ return resp;
+ }
+
+ }
+}
diff --git a/Project/Controller/PurchaseController.cs b/Project/Web/Controller/PurchaseController.cs
similarity index 97%
rename from Project/Controller/PurchaseController.cs
rename to Project/Web/Controller/PurchaseController.cs
index f2d1512..7d19919 100644
--- a/Project/Controller/PurchaseController.cs
+++ b/Project/Web/Controller/PurchaseController.cs
@@ -1,215 +1,215 @@
-using System;
-using System.Linq;
-using System.Net.Http;
-using System.Web.Http;
-using System.Windows.Forms;
-
-namespace Project
-{
- public class PurchaseController : BaseController
- {
-
-
- // PUT api/values/5
- public void Put(int id, [FromBody] string value)
- {
- }
-
- // DELETE api/values/5
- public void Delete(int id)
- {
- }
-
- [HttpGet]
- public string Test()
- {
- return "test";
- }
-
- [HttpGet]
- public HttpResponseMessage Find()
- {
- //로그인이 되어있지않다면 로그인을 가져온다
- MethodResult result;
- result = View();
-
-
- 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();
-
- if(searchkey.isEmpty()==false && searchkey != "%")
- {
- if (searchkey.StartsWith("%") == false) searchkey = "%" + searchkey;
- if (searchkey.EndsWith("%") == false) searchkey += "%";
- }
-
- var tbody = new System.Text.StringBuilder();
-
- //테이블데이터생성
- var itemcnt = 0;
- if (searchkey.isEmpty() == false)
- {
- var db = new dsMSSQLTableAdapters.vFindSIDTableAdapter();// EEEntitiesMain();
- var rows = db.GetData(searchkey);//.vFindSID.Where(t => t.sid.Contains(searchkey) || t.name.Contains(searchkey) || t.manu.Contains(searchkey) || t.model.Contains(searchkey));
- itemcnt = rows.Count();
- foreach (var item in rows)
- {
- tbody.AppendLine("");
- tbody.AppendLine($"| {item.Location} | ");
- tbody.AppendLine($"{item.sid} | ");
- tbody.AppendLine($"{item.name} | ");
- tbody.AppendLine($"{item.model} | ");
-
- if (item.IspriceNull())
- tbody.AppendLine($"-- | ");
- else
- {
- var price = (double)item.price / 1000.0;
-
- tbody.AppendLine($"{price.ToString("N0")} | ");
- }
-
-
- tbody.AppendLine($"{item.manu} | ");
- tbody.AppendLine($"{item.supply} | ");
-
- if (item.remark.Length > 10)
- tbody.AppendLine($"{item.remark.Substring(0, 10)}... | ");
- else
- tbody.AppendLine($"{item.remark} | ");
- tbody.AppendLine("
");
- }
- }
-
- //아잍쳄이 없는경우
- if (itemcnt == 0)
- {
- tbody.AppendLine("");
- tbody.AppendLine("| 1 | ");
- tbody.AppendLine("자료가 없습니다 | ");
- tbody.AppendLine("
");
- }
-
-
- var contents = result.Content.Replace("{search}", searchkey);
- contents = contents.Replace("{tabledata}", tbody.ToString());
- contents = contents.Replace("{cnt}", itemcnt.ToString());
-
-
- //공용값 적용
- 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 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 itemcnt = 0;
- //if (searchkey.isEmpty() == false)
- //{
- var db = new dsMSSQLTableAdapters.vPurchaseTableAdapter();// EEEntitiesPurchase();
- var sd = DateTime.Now.ToString("yyyy-MM-01");
- var rows = db.GetAfter(FCOMMON.info.Login.gcode, sd);// .vPurchase.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("");
- tbody.AppendLine($"| {item.pdate.Substring(5)} | ");
-
- if (item.state == "---") tbody.AppendLine($"{item.state} | ");
- else if (item.state == "Received") tbody.AppendLine($"{item.state} | ");
- else tbody.AppendLine($"{item.state} | ");
-
- tbody.AppendLine($"{item.name} | ");
- tbody.AppendLine($"{item.sid} | ");
- tbody.AppendLine($"{item.pumname} | ");
-
- if (item.pumscale.Length > 10) tbody.AppendLine($"{item.pumscale.Substring(0, 10)}... | ");
- else tbody.AppendLine($"{item.pumscale} | ");
-
- tbody.AppendLine($"{item.pumqty} | ");
- tbody.AppendLine($"{item.pumprice} | ");
- tbody.AppendLine($"{item.pumamt} | ");
- tbody.AppendLine($"{item.supply} | ");
- if (item.project != null && item.project.Length > 10) tbody.AppendLine($"{item.project.Substring(0, 10)}... | ");
- else tbody.AppendLine($"{item.project} | ");
-
- if (item.bigo.Length > 10) tbody.AppendLine($"{item.bigo.Substring(0, 10)}... | ");
- else tbody.AppendLine($"{item.bigo} | ");
- tbody.AppendLine("
");
- }
- //}
-
- //아잍쳄이 없는경우
- if (itemcnt == 0)
- {
- tbody.AppendLine("");
- tbody.AppendLine("| 1 | ");
- tbody.AppendLine("자료가 없습니다 | ");
- tbody.AppendLine("
");
- }
-
-
- var contents = result.Content.Replace("{search}", searchkey);
- contents = contents.Replace("{tabledata}", tbody.ToString());
- contents = contents.Replace("{cnt}", itemcnt.ToString());
-
-
- //공용값 적용
- ApplyCommonValue(ref contents);
-
- //최종문자 적용
- result.Content = contents;
-
- var resp = new HttpResponseMessage()
- {
- Content = new StringContent(
- result.Content,
- System.Text.Encoding.UTF8,
- "text/html")
- };
-
- return resp;
- }
-
- }
-}
+using System;
+using System.Linq;
+using System.Net.Http;
+using System.Web.Http;
+using System.Windows.Forms;
+
+namespace Project.Web.Controllers
+{
+ public class PurchaseController : BaseController
+ {
+
+
+ // PUT api/values/5
+ public void Put(int id, [FromBody] string value)
+ {
+ }
+
+ // DELETE api/values/5
+ public void Delete(int id)
+ {
+ }
+
+ [HttpGet]
+ public string Test()
+ {
+ return "test";
+ }
+
+ [HttpGet]
+ public HttpResponseMessage Find()
+ {
+ //로그인이 되어있지않다면 로그인을 가져온다
+ MethodResult result;
+ result = View();
+
+
+ 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();
+
+ if(searchkey.isEmpty()==false && searchkey != "%")
+ {
+ if (searchkey.StartsWith("%") == false) searchkey = "%" + searchkey;
+ if (searchkey.EndsWith("%") == false) searchkey += "%";
+ }
+
+ var tbody = new System.Text.StringBuilder();
+
+ //테이블데이터생성
+ var itemcnt = 0;
+ if (searchkey.isEmpty() == false)
+ {
+ var db = new dsMSSQLTableAdapters.vFindSIDTableAdapter();// EEEntitiesMain();
+ var rows = db.GetData(searchkey);//.vFindSID.Where(t => t.sid.Contains(searchkey) || t.name.Contains(searchkey) || t.manu.Contains(searchkey) || t.model.Contains(searchkey));
+ itemcnt = rows.Count();
+ foreach (var item in rows)
+ {
+ tbody.AppendLine("");
+ tbody.AppendLine($"| {item.Location} | ");
+ tbody.AppendLine($"{item.sid} | ");
+ tbody.AppendLine($"{item.name} | ");
+ tbody.AppendLine($"{item.model} | ");
+
+ if (item.IspriceNull())
+ tbody.AppendLine($"-- | ");
+ else
+ {
+ var price = (double)item.price / 1000.0;
+
+ tbody.AppendLine($"{price.ToString("N0")} | ");
+ }
+
+
+ tbody.AppendLine($"{item.manu} | ");
+ tbody.AppendLine($"{item.supply} | ");
+
+ if (item.remark.Length > 10)
+ tbody.AppendLine($"{item.remark.Substring(0, 10)}... | ");
+ else
+ tbody.AppendLine($"{item.remark} | ");
+ tbody.AppendLine("
");
+ }
+ }
+
+ //아잍쳄이 없는경우
+ if (itemcnt == 0)
+ {
+ tbody.AppendLine("");
+ tbody.AppendLine("| 1 | ");
+ tbody.AppendLine("자료가 없습니다 | ");
+ tbody.AppendLine("
");
+ }
+
+
+ var contents = result.Content.Replace("{search}", searchkey);
+ contents = contents.Replace("{tabledata}", tbody.ToString());
+ contents = contents.Replace("{cnt}", itemcnt.ToString());
+
+
+ //공용값 적용
+ 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 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 itemcnt = 0;
+ //if (searchkey.isEmpty() == false)
+ //{
+ var db = new dsMSSQLTableAdapters.vPurchaseTableAdapter();// EEEntitiesPurchase();
+ var sd = DateTime.Now.ToString("yyyy-MM-01");
+ var rows = db.GetAfter(FCOMMON.info.Login.gcode, sd);// .vPurchase.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("");
+ tbody.AppendLine($"| {item.pdate.Substring(5)} | ");
+
+ if (item.state == "---") tbody.AppendLine($"{item.state} | ");
+ else if (item.state == "Received") tbody.AppendLine($"{item.state} | ");
+ else tbody.AppendLine($"{item.state} | ");
+
+ tbody.AppendLine($"{item.name} | ");
+ tbody.AppendLine($"{item.sid} | ");
+ tbody.AppendLine($"{item.pumname} | ");
+
+ if (item.pumscale.Length > 10) tbody.AppendLine($"{item.pumscale.Substring(0, 10)}... | ");
+ else tbody.AppendLine($"{item.pumscale} | ");
+
+ tbody.AppendLine($"{item.pumqty} | ");
+ tbody.AppendLine($"{item.pumprice} | ");
+ tbody.AppendLine($"{item.pumamt} | ");
+ tbody.AppendLine($"{item.supply} | ");
+ if (item.project != null && item.project.Length > 10) tbody.AppendLine($"{item.project.Substring(0, 10)}... | ");
+ else tbody.AppendLine($"{item.project} | ");
+
+ if (item.bigo.Length > 10) tbody.AppendLine($"{item.bigo.Substring(0, 10)}... | ");
+ else tbody.AppendLine($"{item.bigo} | ");
+ tbody.AppendLine("
");
+ }
+ //}
+
+ //아잍쳄이 없는경우
+ if (itemcnt == 0)
+ {
+ tbody.AppendLine("");
+ tbody.AppendLine("| 1 | ");
+ tbody.AppendLine("자료가 없습니다 | ");
+ tbody.AppendLine("
");
+ }
+
+
+ var contents = result.Content.Replace("{search}", searchkey);
+ contents = contents.Replace("{tabledata}", tbody.ToString());
+ contents = contents.Replace("{cnt}", itemcnt.ToString());
+
+
+ //공용값 적용
+ ApplyCommonValue(ref contents);
+
+ //최종문자 적용
+ result.Content = contents;
+
+ var resp = new HttpResponseMessage()
+ {
+ Content = new StringContent(
+ result.Content,
+ System.Text.Encoding.UTF8,
+ "text/html")
+ };
+
+ return resp;
+ }
+
+ }
+}
diff --git a/Project/Controller/ResourceController.cs b/Project/Web/Controller/ResourceController.cs
similarity index 96%
rename from Project/Controller/ResourceController.cs
rename to Project/Web/Controller/ResourceController.cs
index 2262309..8767776 100644
--- a/Project/Controller/ResourceController.cs
+++ b/Project/Web/Controller/ResourceController.cs
@@ -1,155 +1,156 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net;
-using System.Net.Http;
-using System.Text;
-using System.Threading.Tasks;
-using System.Web.Http;
-namespace Project
-{
- public class ResourceController : BaseController
- {
- //[HttpGet]
- //public HttpResponseMessage Index()
- //{
- // //로그인이 되어있지않다면 로그인을 가져온다
- // MethodResult result;
- // result = View(true);
-
- // 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 file()
- {
- var config = RequestContext.Configuration;
- var routeData = config.Routes.GetRouteData(Request).Values.ToList();
-
- var p_resource = routeData.Where(t => t.Key == "resource").FirstOrDefault();
- var p_path = routeData.Where(t => t.Key == "path").FirstOrDefault();
- var p_ext = routeData.Where(t => t.Key == "ext").FirstOrDefault();
- var p_subdir = routeData.Where(t => t.Key == "subdir").FirstOrDefault();
-
- var v_resource = string.Empty;
- var v_path = string.Empty;
- var v_ext = string.Empty;
- var v_subdir = string.Empty;
-
- if (p_resource.Key == "resource") v_resource = p_resource.Value.ToString();
- if (p_path.Key == "path") v_path = p_path.Value.ToString();
- if (p_ext.Key == "ext") v_ext = p_ext.Value.ToString();
- if (p_subdir.Key == "subdir") v_subdir = p_subdir.Value.ToString();
-
- //var file_ext = routeData[0].Value.ToString();
- //var name_resource = routeData[1].Value.ToString() + "." + file_ext;
- //var name_action = routeData[3].Value.ToString();
-
- Boolean isBinary = true;
-
-
- string content_type = "text/plain";
-
- if (v_ext == "json")
- {
- isBinary = false;
- content_type = "application/json";
- }
- else if(v_ext == "vue")
- {
- isBinary = false;
- content_type = "application/js";
- }
- else if (v_ext == "js")
- {
- isBinary = false;
- content_type = "application/js";
- }
- else if (v_ext == "css")
- {
- isBinary = false;
- content_type = "text/css";
- }
- else if (v_ext == "csv")
- {
- isBinary = false;
- content_type = "text/csv";
- }
- else if (v_ext == "ico")
- {
- isBinary = true;
- content_type = "image/x-icon";
- }
- else if(v_ext == "ttf" || v_ext == "otf")
- {
- isBinary = true;
- content_type = "application/octet-stream";
- }
-
- HttpContent resultContent = null;
-
- if (v_resource.isEmpty() && v_ext.isEmpty())
- {
- v_resource = "index";
- v_ext = "html";
- isBinary = false;
- content_type = "text/html";
- }
-
-
-
- var file = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "View", v_path, v_subdir, v_resource + "." + v_ext);
-
- if (isBinary)
- {
-
- if (System.IO.File.Exists(file))
- {
- var buffer = System.IO.File.ReadAllBytes(file);
- resultContent = new ByteArrayContent(buffer);
- Console.WriteLine(">>File(B) : " + file);
- }
- else Console.WriteLine("no resouoir file " + file);
-
- }
- else
- {
- if (System.IO.File.Exists(file))
- {
-
- var buffer = System.IO.File.ReadAllText(file, System.Text.Encoding.UTF8);
- resultContent = new StringContent(buffer, System.Text.Encoding.UTF8, content_type);
- Console.WriteLine(">>File(S) : " + file);
- }
- else Console.WriteLine("no resouoir file " + file);
- }
-
-
- return new HttpResponseMessage()
- {
- Content = resultContent
- };
-
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Text;
+using System.Threading.Tasks;
+using System.Web.Http;
+
+namespace Project.Web.Controllers
+{
+ public class ResourceController : BaseController
+ {
+ //[HttpGet]
+ //public HttpResponseMessage Index()
+ //{
+ // //로그인이 되어있지않다면 로그인을 가져온다
+ // MethodResult result;
+ // result = View(true);
+
+ // 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 file()
+ {
+ var config = RequestContext.Configuration;
+ var routeData = config.Routes.GetRouteData(Request).Values.ToList();
+
+ var p_resource = routeData.Where(t => t.Key == "resource").FirstOrDefault();
+ var p_path = routeData.Where(t => t.Key == "path").FirstOrDefault();
+ var p_ext = routeData.Where(t => t.Key == "ext").FirstOrDefault();
+ var p_subdir = routeData.Where(t => t.Key == "subdir").FirstOrDefault();
+
+ var v_resource = string.Empty;
+ var v_path = string.Empty;
+ var v_ext = string.Empty;
+ var v_subdir = string.Empty;
+
+ if (p_resource.Key == "resource") v_resource = p_resource.Value.ToString();
+ if (p_path.Key == "path") v_path = p_path.Value.ToString();
+ if (p_ext.Key == "ext") v_ext = p_ext.Value.ToString();
+ if (p_subdir.Key == "subdir") v_subdir = p_subdir.Value.ToString();
+
+ //var file_ext = routeData[0].Value.ToString();
+ //var name_resource = routeData[1].Value.ToString() + "." + file_ext;
+ //var name_action = routeData[3].Value.ToString();
+
+ Boolean isBinary = true;
+
+
+ string content_type = "text/plain";
+
+ if (v_ext == "json")
+ {
+ isBinary = false;
+ content_type = "application/json";
+ }
+ else if(v_ext == "vue")
+ {
+ isBinary = false;
+ content_type = "application/js";
+ }
+ else if (v_ext == "js")
+ {
+ isBinary = false;
+ content_type = "application/js";
+ }
+ else if (v_ext == "css")
+ {
+ isBinary = false;
+ content_type = "text/css";
+ }
+ else if (v_ext == "csv")
+ {
+ isBinary = false;
+ content_type = "text/csv";
+ }
+ else if (v_ext == "ico")
+ {
+ isBinary = true;
+ content_type = "image/x-icon";
+ }
+ else if(v_ext == "ttf" || v_ext == "otf")
+ {
+ isBinary = true;
+ content_type = "application/octet-stream";
+ }
+
+ HttpContent resultContent = null;
+
+ if (v_resource.isEmpty() && v_ext.isEmpty())
+ {
+ v_resource = "index";
+ v_ext = "html";
+ isBinary = false;
+ content_type = "text/html";
+ }
+
+
+
+ var file = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "View", v_path, v_subdir, v_resource + "." + v_ext);
+
+ if (isBinary)
+ {
+
+ if (System.IO.File.Exists(file))
+ {
+ var buffer = System.IO.File.ReadAllBytes(file);
+ resultContent = new ByteArrayContent(buffer);
+ Console.WriteLine(">>File(B) : " + file);
+ }
+ else Console.WriteLine("no resouoir file " + file);
+
+ }
+ else
+ {
+ if (System.IO.File.Exists(file))
+ {
+
+ var buffer = System.IO.File.ReadAllText(file, System.Text.Encoding.UTF8);
+ resultContent = new StringContent(buffer, System.Text.Encoding.UTF8, content_type);
+ Console.WriteLine(">>File(S) : " + file);
+ }
+ else Console.WriteLine("no resouoir file " + file);
+ }
+
+
+ return new HttpResponseMessage()
+ {
+ Content = resultContent
+ };
+
+ }
+ }
+}
diff --git a/Project/Controller/ResultController.cs b/Project/Web/Controller/ResultController.cs
similarity index 94%
rename from Project/Controller/ResultController.cs
rename to Project/Web/Controller/ResultController.cs
index 6bd6c7b..bbdc2a5 100644
--- a/Project/Controller/ResultController.cs
+++ b/Project/Web/Controller/ResultController.cs
@@ -1,64 +1,64 @@
-using System;
-using System.Linq;
-using System.Net.Http;
-using System.Web.Http;
-
-namespace Project
-{
- public class ResultController : 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 string Test()
- {
- return "test";
- }
-
-
- [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;
- }
-
- }
-}
+using System;
+using System.Linq;
+using System.Net.Http;
+using System.Web.Http;
+
+namespace Project.Web.Controllers
+{
+ public class ResultController : 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 string Test()
+ {
+ return "test";
+ }
+
+
+ [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;
+ }
+
+ }
+}
diff --git a/Project/Controller/SettingController.cs b/Project/Web/Controller/SettingController.cs
similarity index 94%
rename from Project/Controller/SettingController.cs
rename to Project/Web/Controller/SettingController.cs
index e567385..021616d 100644
--- a/Project/Controller/SettingController.cs
+++ b/Project/Web/Controller/SettingController.cs
@@ -1,63 +1,63 @@
-using System;
-using System.Linq;
-using System.Net.Http;
-using System.Web.Http;
-
-namespace Project
-{
- public class SettingController : 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 string Test()
- {
- return "test";
- }
-
- [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;
- }
-
- }
-}
+using System;
+using System.Linq;
+using System.Net.Http;
+using System.Web.Http;
+
+namespace Project.Web.Controllers
+{
+ public class SettingController : 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 string Test()
+ {
+ return "test";
+ }
+
+ [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;
+ }
+
+ }
+}
diff --git a/Project/Model/PageModel.cs b/Project/Web/Model/PageModel.cs
similarity index 54%
rename from Project/Model/PageModel.cs
rename to Project/Web/Model/PageModel.cs
index eac12b0..dc96b1a 100644
--- a/Project/Model/PageModel.cs
+++ b/Project/Web/Model/PageModel.cs
@@ -1,18 +1,28 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Project
-{
- public class PageModel
- {
- public List> RouteData { get; set; }
-
-
- public string urlcontrol { get; set; }
- public string urlaction { get; set; }
-
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Project.Web.Model
+{
+ public class GroupUserModel
+ {
+ public string Gcode { get; set; }
+ public string uid { get; set; }
+ }
+ public class UserModel
+ {
+ public string uid { get; set; }
+ public string password { get; set; }
+ }
+ public class PageModel
+ {
+ public List> RouteData { get; set; }
+
+
+ public string urlcontrol { get; set; }
+ public string urlaction { get; set; }
+
+ }
+}
diff --git a/Project/Web/Startup.cs b/Project/Web/Startup.cs
new file mode 100644
index 0000000..a1c316d
--- /dev/null
+++ b/Project/Web/Startup.cs
@@ -0,0 +1,88 @@
+using Microsoft.Owin;
+using Microsoft.Owin.StaticFiles;
+using Owin;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Web.Http;
+using System.Web.Http.Routing;
+using Project.Web.Controllers;
+
+namespace Project.OWIN
+{
+ public class Startup
+ {
+ public void Configuration(IAppBuilder app)
+ {
+ // Configure Web API for Self-Host
+ HttpConfiguration config = new HttpConfiguration();
+
+ //라우팅 설정
+ config.MapHttpAttributeRoutes();
+
+ config.Routes.MapHttpRoute(
+ name: "DefaultApi",
+ routeTemplate: "api/{controller}/{action}/{id}",
+ defaults: new { id = RouteParameter.Optional }
+ );
+
+ // JSON 포맷터 설정
+ config.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
+
+ // 파일 업로드 설정
+ config.Formatters.Remove(config.Formatters.XmlFormatter);
+
+ app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);
+ app.UseWebApi(config);
+
+ // 정적 파일 서빙 설정
+ var options = new FileServerOptions
+ {
+ EnableDefaultFiles = true,
+ DefaultFilesOptions = { DefaultFileNames = { "index.html" } },
+ FileSystem = new Microsoft.Owin.FileSystems.PhysicalFileSystem("Web/wwwroot")
+ };
+
+ app.UseFileServer(options);
+
+ // 캐시 방지 미들웨어 추가
+ app.Use(async (context, next) =>
+ {
+ if (context.Request.Path.Value.EndsWith(".js") || context.Request.Path.Value.EndsWith(".css"))
+ {
+ context.Response.Headers["Cache-Control"] = "no-cache, no-store, must-revalidate";
+ context.Response.Headers["Pragma"] = "no-cache";
+ context.Response.Headers["Expires"] = "0";
+ }
+ await next();
+ });
+
+ //appBuilder.UseFileServer(new FileServerOptions
+ //{
+ // RequestPath = new PathString(string.Empty),
+ // FileSystem = new PhysicalFileSystem("./MySubFolder"),
+ // EnableDirectoryBrowsing = true,
+ //});
+
+ //appBuilder.UseStageMarker(PipelineStage.MapHandler);
+
+
+ //config.Routes.MapHttpRoute(
+ // name: "ignore",
+ // routeTemplate: @".*\.(css|js|gif|jpg)(/.*)?",
+ // defaults: new
+ // {
+ // controller = "file",
+ // action = "readtext",
+ // id = RouteParameter.Optional
+ // }
+ // );
+
+
+
+ }
+
+ }
+}
diff --git a/Project/OWIN/StartupSSE.cs b/Project/Web/StartupSSE.cs
similarity index 96%
rename from Project/OWIN/StartupSSE.cs
rename to Project/Web/StartupSSE.cs
index 0e36865..0d0cece 100644
--- a/Project/OWIN/StartupSSE.cs
+++ b/Project/Web/StartupSSE.cs
@@ -1,101 +1,101 @@
-using Microsoft.Owin;
-using Owin;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Web.Http;
-
-namespace Project.OWIN
-{
- public class StartupSSE
- {
-
-
- public void Configuration(IAppBuilder app)
- {
- var api = new Api();
- app.Run(context => api.Invoke(context));
- }
-
- public class Subscriber
- {
- private StreamWriter _writer;
- private TaskCompletionSource _tcs;
- public Subscriber(Stream body, TaskCompletionSource tcs)
- {
- this._writer = new StreamWriter(body);
- this._tcs = tcs;
- }
-
- public async void WriteAsync(string message)
- {
- try
- {
- _writer.Write(message);
- _writer.Flush();
- }
- catch (Exception e)
- {
- if (e.HResult == -2146232800) // non-existent connection
- _tcs.SetResult(true);
- else
- _tcs.SetException(e);
- }
- }
- }
-
- public class Api
- {
- System.Timers.Timer _timer = new System.Timers.Timer(500);
- List _subscribers = new List();
- public Api()
- {
- _timer.Elapsed += _timer_Elapsed;
- }
-
- void _timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
- {
- UpdateSubscribers();
- }
-
- public void UpdateSubscribers()
- {
- Console.WriteLine("updating {0} subscribers", _subscribers.Count);
- var subscribersCopy = _subscribers.ToList();
- var msg = String.Format("Hello async at {0}\n", DateTime.Now);
- subscribersCopy.ForEach(w => w.WriteAsync(msg));
- _timer.Start();
- }
-
-
- public Task Invoke(IOwinContext context)
- {
- SetEventHeaders(context);
- System.IO.Stream responseStream = context.Environment["owin.ResponseBody"] as Stream;
- var tcs = new TaskCompletionSource();
- var s = CreateSubscriber(responseStream, tcs);
- tcs.Task.ContinueWith(_ => _subscribers.Remove(s));
- Console.WriteLine("Add subscriber. Now have {0}", _subscribers.Count);
- s.WriteAsync("Registered\n");
- _timer.Start();
- return tcs.Task;
- }
-
- private Subscriber CreateSubscriber(System.IO.Stream responseStream, TaskCompletionSource tcs)
- {
- var s = new Subscriber(responseStream, tcs);
- _subscribers.Add(s);
- return s;
- }
-
- private static void SetEventHeaders(IOwinContext context)
- {
- context.Response.ContentType = "text/eventstream";
- context.Response.Headers["Transfer-Encoding"] = "chunked";
- context.Response.Headers["cache-control"] = "no-cache";
- }
- }
- }
-}
+using Microsoft.Owin;
+using Owin;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Web.Http;
+
+namespace Project.OWIN
+{
+ public class StartupSSE
+ {
+
+
+ public void Configuration(IAppBuilder app)
+ {
+ var api = new Api();
+ app.Run(context => api.Invoke(context));
+ }
+
+ public class Subscriber
+ {
+ private StreamWriter _writer;
+ private TaskCompletionSource _tcs;
+ public Subscriber(Stream body, TaskCompletionSource tcs)
+ {
+ this._writer = new StreamWriter(body);
+ this._tcs = tcs;
+ }
+
+ public async void WriteAsync(string message)
+ {
+ try
+ {
+ _writer.Write(message);
+ _writer.Flush();
+ }
+ catch (Exception e)
+ {
+ if (e.HResult == -2146232800) // non-existent connection
+ _tcs.SetResult(true);
+ else
+ _tcs.SetException(e);
+ }
+ }
+ }
+
+ public class Api
+ {
+ System.Timers.Timer _timer = new System.Timers.Timer(500);
+ List _subscribers = new List();
+ public Api()
+ {
+ _timer.Elapsed += _timer_Elapsed;
+ }
+
+ void _timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
+ {
+ UpdateSubscribers();
+ }
+
+ public void UpdateSubscribers()
+ {
+ Console.WriteLine("updating {0} subscribers", _subscribers.Count);
+ var subscribersCopy = _subscribers.ToList();
+ var msg = String.Format("Hello async at {0}\n", DateTime.Now);
+ subscribersCopy.ForEach(w => w.WriteAsync(msg));
+ _timer.Start();
+ }
+
+
+ public Task Invoke(IOwinContext context)
+ {
+ SetEventHeaders(context);
+ System.IO.Stream responseStream = context.Environment["owin.ResponseBody"] as Stream;
+ var tcs = new TaskCompletionSource();
+ var s = CreateSubscriber(responseStream, tcs);
+ tcs.Task.ContinueWith(_ => _subscribers.Remove(s));
+ Console.WriteLine("Add subscriber. Now have {0}", _subscribers.Count);
+ s.WriteAsync("Registered\n");
+ _timer.Start();
+ return tcs.Task;
+ }
+
+ private Subscriber CreateSubscriber(System.IO.Stream responseStream, TaskCompletionSource tcs)
+ {
+ var s = new Subscriber(responseStream, tcs);
+ _subscribers.Add(s);
+ return s;
+ }
+
+ private static void SetEventHeaders(IOwinContext context)
+ {
+ context.Response.ContentType = "text/eventstream";
+ context.Response.Headers["Transfer-Encoding"] = "chunked";
+ context.Response.Headers["cache-control"] = "no-cache";
+ }
+ }
+ }
+}
diff --git a/Project/Web/wwwroot/DashBoard/index.html b/Project/Web/wwwroot/DashBoard/index.html
new file mode 100644
index 0000000..898f3a3
--- /dev/null
+++ b/Project/Web/wwwroot/DashBoard/index.html
@@ -0,0 +1,311 @@
+
+
+
+
+
+ 근태현황 대시보드
+
+
+
+
+
+
+
+
+
근태현황 대시보드
+
실시간 근태 현황을 확인하세요
+
+
+
+
+
+
+
+
+
+
+
+
+ | 이름 |
+ 휴가 종류 |
+ 시작일 |
+ 종료일 |
+ 사유 |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Project/View/dashboard.html b/Project/Web/wwwroot/dashboard.html
similarity index 97%
rename from Project/View/dashboard.html
rename to Project/Web/wwwroot/dashboard.html
index 0aa91dc..b4c50ff 100644
--- a/Project/View/dashboard.html
+++ b/Project/Web/wwwroot/dashboard.html
@@ -1,114 +1,114 @@
-
-
-
-
-
- 근태현황 대시보드
-
-
-
-
-
-
-
-
-
-
-
- | 이름 |
- 출근 시간 |
- 퇴근 시간 |
- 상태 |
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ 근태현황 대시보드
+
+
+
+
+
+
+
+
+
+
+
+ | 이름 |
+ 출근 시간 |
+ 퇴근 시간 |
+ 상태 |
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Project/Web/wwwroot/index.html b/Project/Web/wwwroot/index.html
new file mode 100644
index 0000000..929fc61
--- /dev/null
+++ b/Project/Web/wwwroot/index.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+ VNC 서버 목록 관리
+
+
+
+
+intro file
+
+
\ No newline at end of file
diff --git a/Project/Web/wwwroot/login.html b/Project/Web/wwwroot/login.html
new file mode 100644
index 0000000..3b4dee5
--- /dev/null
+++ b/Project/Web/wwwroot/login.html
@@ -0,0 +1,354 @@
+
+
+
+
+
+ 로그인 - GroupWare
+
+
+
+
+
+
+
+
+
+
+
+
GroupWare
+
로그인하여 시스템에 접속하세요
+
+
+
+
+
+
+
+
+
+
비밀번호 찾기
+
+
+
+
+
+
+
+
+
+ © 2024 GroupWare System. All rights reserved.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Project/fMain.cs b/Project/fMain.cs
index 6598e02..c3ecec2 100644
--- a/Project/fMain.cs
+++ b/Project/fMain.cs
@@ -18,7 +18,8 @@ namespace Project
{
string SearchKey = string.Empty;
ServiceHost host;
-
+ private IDisposable webApp;
+ bool webok = false;
public fMain()
@@ -79,6 +80,7 @@ namespace Project
private void __Closing(object sender, FormClosingEventArgs e)
{
+ webApp?.Dispose();
MessageWindow.CloseAll();
if (closeforce == false)
{
@@ -148,47 +150,37 @@ namespace Project
tmDisplay.Start(); //display timer
- Func_Login();
-
- Update_Site();
- UpdateControls();
-
- //사용기록추적
- Pub.CheckNRegister3(Application.ProductName, "chi", Application.ProductVersion);
-
// Start OWIN host
try
{
-
- WebApp.Start(url: "http://127.0.0.1:9000");
+ var options = new StartOptions("http://127.0.0.1:9000");
+ webApp = WebApp.Start(options);
Console.WriteLine("start webapp");
Pub.log.AddI("웹지원 서버 준비 완료");
+ webok = true;
}
catch (Exception ex)
{
//Util.MsgE("Web Interface Error\r\n" + ex.Message)/;
Console.WriteLine(ex.Message);
Pub.log.AddE("웹지원오류" + ex.Message);
+ webok = false;
}
+ Func_Login();
- //// Address
- //string address = "net.tcp://localhost:57900/eetgw";
+ ///즐겨찾기 목록 갱신
+ Update_FavoriteSite();
- //// Binding : TCP 사용
- //NetTcpBinding binding = new NetTcpBinding();
+ UpdateControls();
- //// Service Host 만들기
- //host = new ServiceHost(typeof(MyService));
+ //사용기록추적
+ Pub.CheckNRegister3(Application.ProductName, "chi", Application.ProductVersion);
- //// End Point 추가
- //host.AddServiceEndpoint(typeof(IMyContract), binding, address);
-
- //// Service Host 시작
- //host.Open();
}
- void Update_Site()
+
+ void Update_FavoriteSite()
{
//즐겨찾기 없데이트 g=17
//타입
@@ -212,9 +204,19 @@ namespace Project
void Func_Login()
{
- using (Dialog.fLogin flogIn = new Dialog.fLogin())
- if (flogIn.ShowDialog() != System.Windows.Forms.DialogResult.OK)
- Application.ExitThread();
+ if (this.webok)
+ {
+ using (var flogIn = new Dialog.fLogin_WB())
+ if (flogIn.ShowDialog() != System.Windows.Forms.DialogResult.OK)
+ Application.ExitThread();
+ }
+ else
+ {
+ using (var flogIn = new Dialog.fLogin())
+ if (flogIn.ShowDialog() != System.Windows.Forms.DialogResult.OK)
+ Application.ExitThread();
+ }
+
this.mn_purchase.Visible = FCOMMON.Util.getBit(FCOMMON.info.Login.gpermission, (int)FCOMMON.eGroupPermission.menu_purchase);
this.mn_project.Visible = FCOMMON.Util.getBit(FCOMMON.info.Login.gpermission, (int)FCOMMON.eGroupPermission.menu_project);