diff --git a/OwinProject/Class1.cs b/OwinProject/Class1.cs new file mode 100644 index 0000000..91e8f0e --- /dev/null +++ b/OwinProject/Class1.cs @@ -0,0 +1,19 @@ +using Microsoft.Owin.Hosting; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OwinProject +{ + public static class OwinServer + { + public static void Run() + { + // Start OWIN host + WebApp.Start(url: "http://127.0.0.1:9000"); + Console.WriteLine("start webapp"); + } + } +} diff --git a/OwinProject/OWIN/Startup.cs b/OwinProject/OWIN/Startup.cs new file mode 100644 index 0000000..0af2f53 --- /dev/null +++ b/OwinProject/OWIN/Startup.cs @@ -0,0 +1,76 @@ +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; +using System.Web.Http.Routing; + +namespace OwinProject.OWIN +{ + public class Startup + { + public void Configuration(IAppBuilder appBuilder) + { + // Configure Web API for Self-Host + HttpConfiguration config = new HttpConfiguration(); + config.MapHttpAttributeRoutes(); + + //메인파일 처리 방법 + IHttpRoute defaultRoute = + config.Routes.CreateRoute("{controller}/{action}/{id}", + new { controller = "home", action = "index", id = RouteParameter.Optional }, + null); + + //기타파일들 처리 방법 + IHttpRoute cssRoute = + config.Routes.CreateRoute("{path}/{subdir}/{resource}.{ext}", + new { controller = "resource", action = "file", id = RouteParameter.Optional }, + null); + + IHttpRoute mifRoute = + config.Routes.CreateRoute("{path}/{resource}.{ext}", + new { controller = "resource", action = "file", id = RouteParameter.Optional }, + null); + + IHttpRoute icoRoute = + config.Routes.CreateRoute("{resource}.{ext}", + new { controller = "resource", action = "file", id = RouteParameter.Optional }, + null); + + config.Routes.Add("mifRoute", mifRoute); + config.Routes.Add("icoRoute", icoRoute); + config.Routes.Add("cssRoute", cssRoute); + config.Routes.Add("defaultRoute", defaultRoute); + appBuilder.UseWebApi(config); + + + //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/OwinProject/OWIN/StartupSSE.cs b/OwinProject/OWIN/StartupSSE.cs new file mode 100644 index 0000000..df17b6f --- /dev/null +++ b/OwinProject/OWIN/StartupSSE.cs @@ -0,0 +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 OwinProject.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/OwinProject/OwinProject.csproj b/OwinProject/OwinProject.csproj new file mode 100644 index 0000000..97241b7 --- /dev/null +++ b/OwinProject/OwinProject.csproj @@ -0,0 +1,78 @@ + + + + + Debug + AnyCPU + {0C3DC465-73BB-4086-BED4-5EAA100F082A} + Library + Properties + OwinProject + OwinProject + v4.5.2 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Microsoft.Owin.4.1.1\lib\net45\Microsoft.Owin.dll + + + ..\packages\Microsoft.Owin.Host.HttpListener.4.1.1\lib\net45\Microsoft.Owin.Host.HttpListener.dll + + + ..\packages\Microsoft.Owin.Hosting.2.0.2\lib\net45\Microsoft.Owin.Hosting.dll + + + ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + + ..\packages\Owin.1.0\lib\net40\Owin.dll + + + + + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll + + + ..\packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll + + + ..\packages\Microsoft.AspNet.WebApi.Owin.5.2.7\lib\net45\System.Web.Http.Owin.dll + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OwinProject/OwinProject.csproj.user b/OwinProject/OwinProject.csproj.user new file mode 100644 index 0000000..1dec02f --- /dev/null +++ b/OwinProject/OwinProject.csproj.user @@ -0,0 +1,6 @@ + + + + ProjectFiles + + \ No newline at end of file diff --git a/OwinProject/Properties/AssemblyInfo.cs b/OwinProject/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..5966b36 --- /dev/null +++ b/OwinProject/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해 +// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면 +// 이러한 특성 값을 변경하세요. +[assembly: AssemblyTitle("OwinProject")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OwinProject")] +[assembly: AssemblyCopyright("Copyright © 2021")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에 +// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면 +// 해당 형식에 대해 ComVisible 특성을 true로 설정하세요. +[assembly: ComVisible(false)] + +// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다. +[assembly: Guid("0c3dc465-73bb-4086-bed4-5eaa100f082a")] + +// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다. +// +// 주 버전 +// 부 버전 +// 빌드 번호 +// 수정 버전 +// +// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를 +// 기본값으로 할 수 있습니다. +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/OwinProject/app.config b/OwinProject/app.config new file mode 100644 index 0000000..2b1d8e6 --- /dev/null +++ b/OwinProject/app.config @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OwinProject/packages.config b/OwinProject/packages.config new file mode 100644 index 0000000..19bdb0a --- /dev/null +++ b/OwinProject/packages.config @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Project/BaseController.cs b/Project/BaseController.cs new file mode 100644 index 0000000..f9a371b --- /dev/null +++ b/Project/BaseController.cs @@ -0,0 +1,286 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Web.Http; +using agi = HtmlAgilityPack; + + +namespace Project +{ + public struct MethodResult : IEquatable + { + 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() + { + var config = RequestContext.Configuration; + if (config != null) + { + var routeData = config.Routes.GetRouteData(Request).Values.ToList(); + var name_ctrl = routeData[0].Value.ToString(); + 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) + { + //메뉴 푸터 - 개발자 정보 + + } + + 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); + } + } + + //콘텐츠내의 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/HomeController.cs b/Project/Controller/HomeController.cs new file mode 100644 index 0000000..5539ebd --- /dev/null +++ b/Project/Controller/HomeController.cs @@ -0,0 +1,93 @@ +using System; +using System.Linq; +using System.Net.Http; +using System.Web.Http; + +namespace Project +{ + 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"; + } + + [HttpGet] + public HttpResponseMessage Login() + { + //로그인이 되어있지않다면 로그인을 가져온다 + 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; + } + + [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/IoController.cs b/Project/Controller/IoController.cs new file mode 100644 index 0000000..902df59 --- /dev/null +++ b/Project/Controller/IoController.cs @@ -0,0 +1,86 @@ +using System; +using System.Linq; +using System.Net.Http; +using System.Web.Http; + +namespace Project +{ + public class IoController : 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); + + var tabledata = string.Empty; + for(int r = 0;r < 8; r++) + { + tabledata += ""; + for (int i = 0; i < 8; i++) + { + tabledata += $""; + tabledata += $"
"; + tabledata += $"
"; + tabledata += $"
X{i.ToString("00")}
"; + tabledata += $"

Start button

"; + tabledata += $"
"; ; + tabledata += $"
"; + tabledata += $""; + } + tabledata += ""; + } + + contents = contents.Replace("{list}", tabledata); + + //최종문자 적용 + 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/MotionController.cs b/Project/Controller/MotionController.cs new file mode 100644 index 0000000..48ed317 --- /dev/null +++ b/Project/Controller/MotionController.cs @@ -0,0 +1,64 @@ +using System; +using System.Linq; +using System.Net.Http; +using System.Web.Http; + +namespace Project +{ + public class MotionController : 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/OperationController.cs b/Project/Controller/OperationController.cs new file mode 100644 index 0000000..341d417 --- /dev/null +++ b/Project/Controller/OperationController.cs @@ -0,0 +1,64 @@ +using System; +using System.Linq; +using System.Net.Http; +using System.Web.Http; + +namespace Project +{ + public class OperationController : 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/ResourceController.cs b/Project/Controller/ResourceController.cs new file mode 100644 index 0000000..175aaf8 --- /dev/null +++ b/Project/Controller/ResourceController.cs @@ -0,0 +1,109 @@ +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 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 == "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; + 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/Controller/ResultController.cs new file mode 100644 index 0000000..6bd6c7b --- /dev/null +++ b/Project/Controller/ResultController.cs @@ -0,0 +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; + } + + } +} diff --git a/Project/Controller/SettingController.cs b/Project/Controller/SettingController.cs new file mode 100644 index 0000000..e567385 --- /dev/null +++ b/Project/Controller/SettingController.cs @@ -0,0 +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; + } + + } +} diff --git a/Project/EETGW.csproj b/Project/EETGW.csproj index f66426f..2b72744 100644 --- a/Project/EETGW.csproj +++ b/Project/EETGW.csproj @@ -191,6 +191,9 @@ ..\packages\Microsoft.SqlServer.Types.11.0.1\lib\net20\Microsoft.SqlServer.Types.dll + + ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + ..\packages\Owin.1.0\lib\net40\Owin.dll @@ -202,10 +205,20 @@ + + + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll + + + ..\packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll + + + ..\packages\Microsoft.AspNet.WebApi.Owin.5.2.7\lib\net45\System.Web.Http.Owin.dll + @@ -236,6 +249,14 @@ True AdoNetEFMain.edmx + + + + + + + + True @@ -346,6 +367,9 @@ + + + diff --git a/Project/EETGW.csproj.user b/Project/EETGW.csproj.user index 90fc8be..9e6be46 100644 --- a/Project/EETGW.csproj.user +++ b/Project/EETGW.csproj.user @@ -9,6 +9,7 @@ ko-KR false + ProjectFiles false diff --git a/Project/Model/PageModel.cs b/Project/Model/PageModel.cs new file mode 100644 index 0000000..eac12b0 --- /dev/null +++ b/Project/Model/PageModel.cs @@ -0,0 +1,18 @@ +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; } + + } +} diff --git a/Project/OWIN/Startup.cs b/Project/OWIN/Startup.cs new file mode 100644 index 0000000..1ee63ab --- /dev/null +++ b/Project/OWIN/Startup.cs @@ -0,0 +1,76 @@ +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; +using System.Web.Http.Routing; + +namespace Project.OWIN +{ + public class Startup + { + public void Configuration(IAppBuilder appBuilder) + { + // Configure Web API for Self-Host + HttpConfiguration config = new HttpConfiguration(); + config.MapHttpAttributeRoutes(); + + //메인파일 처리 방법 + IHttpRoute defaultRoute = + config.Routes.CreateRoute("{controller}/{action}/{id}", + new { controller = "home", action = "index", id = RouteParameter.Optional }, + null); + + //기타파일들 처리 방법 + IHttpRoute cssRoute = + config.Routes.CreateRoute("{path}/{subdir}/{resource}.{ext}", + new { controller = "resource", action = "file", id = RouteParameter.Optional }, + null); + + IHttpRoute mifRoute = + config.Routes.CreateRoute("{path}/{resource}.{ext}", + new { controller = "resource", action = "file", id = RouteParameter.Optional }, + null); + + IHttpRoute icoRoute = + config.Routes.CreateRoute("{resource}.{ext}", + new { controller = "resource", action = "file", id = RouteParameter.Optional }, + null); + + config.Routes.Add("mifRoute", mifRoute); + config.Routes.Add("icoRoute", icoRoute); + config.Routes.Add("cssRoute", cssRoute); + config.Routes.Add("defaultRoute", defaultRoute); + appBuilder.UseWebApi(config); + + + //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/OWIN/StartupSSE.cs new file mode 100644 index 0000000..0e36865 --- /dev/null +++ b/Project/OWIN/StartupSSE.cs @@ -0,0 +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"; + } + } + } +} diff --git a/Project/Program.cs b/Project/Program.cs index e086bca..0e4b1d2 100644 --- a/Project/Program.cs +++ b/Project/Program.cs @@ -1,46 +1,46 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Windows.Forms; - -namespace Project -{ - static class Program - { - /// - /// 해당 응용 프로그램의 주 진입점입니다. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace Project +{ + static class Program + { + /// + /// 해당 응용 프로그램의 주 진입점입니다. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); SqlServerTypes.Utilities.LoadNativeAssemblies(AppDomain.CurrentDomain.BaseDirectory); // Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); // AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); - Application.Run(new fMain()); - } - - static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) - { - string emsg = "Fatal Error(UHE)\n\n" + e.ExceptionObject.ToString(); - Pub.log.AddE(emsg); - Pub.log.Flush(); - Util.SaveBugReport(emsg); - var f = new fErrorException(emsg); - f.ShowDialog(); - Application.ExitThread(); - } - - static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e) - { - string emsg = "Fatal Error(ATE)\n\n" + e.Exception.ToString(); - Pub.log.AddE(emsg); - Pub.log.Flush(); - Util.SaveBugReport(emsg); - var f = new fErrorException(emsg); - f.ShowDialog(); - Application.ExitThread(); - } - } -} + Application.Run(new fMain()); + } + + static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) + { + string emsg = "Fatal Error(UHE)\n\n" + e.ExceptionObject.ToString(); + Pub.log.AddE(emsg); + Pub.log.Flush(); + Util.SaveBugReport(emsg); + var f = new fErrorException(emsg); + f.ShowDialog(); + Application.ExitThread(); + } + + static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e) + { + string emsg = "Fatal Error(ATE)\n\n" + e.Exception.ToString(); + Pub.log.AddE(emsg); + Pub.log.Flush(); + Util.SaveBugReport(emsg); + var f = new fErrorException(emsg); + f.ShowDialog(); + Application.ExitThread(); + } + } +} diff --git a/Project/Properties/AssemblyInfo.cs b/Project/Properties/AssemblyInfo.cs index 808b7bc..875dcda 100644 --- a/Project/Properties/AssemblyInfo.cs +++ b/Project/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호가 자동으로 // 지정되도록 할 수 있습니다. // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("21.02.23.1350")] -[assembly: AssemblyFileVersion("21.02.23.1350")] +[assembly: AssemblyVersion("21.03.02.1257")] +[assembly: AssemblyFileVersion("21.03.02.1257")] diff --git a/Project/fMain.Designer.cs b/Project/fMain.Designer.cs index 308da54..ab4ed1d 100644 --- a/Project/fMain.Designer.cs +++ b/Project/fMain.Designer.cs @@ -91,6 +91,8 @@ this.todoListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.메일전송ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripMenuItem(); + this.기타ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.행복나래ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.즐겨찾기ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.btDev = new System.Windows.Forms.ToolStripMenuItem(); this.purchaseImportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -116,8 +118,7 @@ this.toolStripButton4 = new System.Windows.Forms.ToolStripButton(); this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); this.toolStripButton2 = new System.Windows.Forms.ToolStripButton(); - this.기타ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.행복나래ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.잉여장비ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.cmTab.SuspendLayout(); this.statusStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout(); @@ -238,14 +239,14 @@ // this.codesToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("codesToolStripMenuItem.Image"))); this.codesToolStripMenuItem.Name = "codesToolStripMenuItem"; - this.codesToolStripMenuItem.Size = new System.Drawing.Size(180, 24); + this.codesToolStripMenuItem.Size = new System.Drawing.Size(153, 24); this.codesToolStripMenuItem.Text = "공용코드"; this.codesToolStripMenuItem.Click += new System.EventHandler(this.codesToolStripMenuItem_Click); // // itemsToolStripMenuItem // this.itemsToolStripMenuItem.Name = "itemsToolStripMenuItem"; - this.itemsToolStripMenuItem.Size = new System.Drawing.Size(180, 24); + this.itemsToolStripMenuItem.Size = new System.Drawing.Size(153, 24); this.itemsToolStripMenuItem.Text = "품목정보"; this.itemsToolStripMenuItem.Click += new System.EventHandler(this.itemsToolStripMenuItem_Click); // @@ -256,7 +257,7 @@ this.myAccouserToolStripMenuItem, this.권한설정ToolStripMenuItem}); this.userInfoToolStripMenuItem.Name = "userInfoToolStripMenuItem"; - this.userInfoToolStripMenuItem.Size = new System.Drawing.Size(180, 24); + this.userInfoToolStripMenuItem.Size = new System.Drawing.Size(153, 24); this.userInfoToolStripMenuItem.Text = "사용자"; // // userAccountToolStripMenuItem @@ -283,14 +284,14 @@ // customerToolStripMenuItem // this.customerToolStripMenuItem.Name = "customerToolStripMenuItem"; - this.customerToolStripMenuItem.Size = new System.Drawing.Size(180, 24); + this.customerToolStripMenuItem.Size = new System.Drawing.Size(153, 24); this.customerToolStripMenuItem.Text = "업체정보"; this.customerToolStripMenuItem.Click += new System.EventHandler(this.customerToolStripMenuItem_Click); // // mn_kuntae // this.mn_kuntae.Name = "mn_kuntae"; - this.mn_kuntae.Size = new System.Drawing.Size(180, 24); + this.mn_kuntae.Size = new System.Drawing.Size(153, 24); this.mn_kuntae.Text = "월별 근무표"; this.mn_kuntae.Click += new System.EventHandler(this.월별근무표ToolStripMenuItem_Click); // @@ -298,7 +299,7 @@ // this.메일양식ToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("메일양식ToolStripMenuItem.Image"))); this.메일양식ToolStripMenuItem.Name = "메일양식ToolStripMenuItem"; - this.메일양식ToolStripMenuItem.Size = new System.Drawing.Size(180, 24); + this.메일양식ToolStripMenuItem.Size = new System.Drawing.Size(153, 24); this.메일양식ToolStripMenuItem.Text = "메일 양식"; this.메일양식ToolStripMenuItem.Click += new System.EventHandler(this.메일양식ToolStripMenuItem_Click); // @@ -433,6 +434,7 @@ this.dataFOLToolStripMenuItem, this.dataMoldEOLToolStripMenuItem, this.dataToolStripMenuItem, + this.잉여장비ToolStripMenuItem, this.toolStripMenuItem2, this.라인코드관리ToolStripMenuItem}); this.mn_eq.Image = ((System.Drawing.Image)(resources.GetObject("mn_eq.Image"))); @@ -443,33 +445,33 @@ // dataFOLToolStripMenuItem // this.dataFOLToolStripMenuItem.Name = "dataFOLToolStripMenuItem"; - this.dataFOLToolStripMenuItem.Size = new System.Drawing.Size(162, 24); + this.dataFOLToolStripMenuItem.Size = new System.Drawing.Size(180, 24); this.dataFOLToolStripMenuItem.Text = "FOL"; this.dataFOLToolStripMenuItem.Click += new System.EventHandler(this.dataFOLToolStripMenuItem_Click); // // dataMoldEOLToolStripMenuItem // this.dataMoldEOLToolStripMenuItem.Name = "dataMoldEOLToolStripMenuItem"; - this.dataMoldEOLToolStripMenuItem.Size = new System.Drawing.Size(162, 24); + this.dataMoldEOLToolStripMenuItem.Size = new System.Drawing.Size(180, 24); this.dataMoldEOLToolStripMenuItem.Text = "MOLD & EOL"; this.dataMoldEOLToolStripMenuItem.Click += new System.EventHandler(this.dataMoldEOLToolStripMenuItem_Click); // // dataToolStripMenuItem // this.dataToolStripMenuItem.Name = "dataToolStripMenuItem"; - this.dataToolStripMenuItem.Size = new System.Drawing.Size(162, 24); + this.dataToolStripMenuItem.Size = new System.Drawing.Size(180, 24); this.dataToolStripMenuItem.Text = "BUMP"; this.dataToolStripMenuItem.Click += new System.EventHandler(this.dataToolStripMenuItem_Click); // // toolStripMenuItem2 // this.toolStripMenuItem2.Name = "toolStripMenuItem2"; - this.toolStripMenuItem2.Size = new System.Drawing.Size(159, 6); + this.toolStripMenuItem2.Size = new System.Drawing.Size(177, 6); // // 라인코드관리ToolStripMenuItem // this.라인코드관리ToolStripMenuItem.Name = "라인코드관리ToolStripMenuItem"; - this.라인코드관리ToolStripMenuItem.Size = new System.Drawing.Size(162, 24); + this.라인코드관리ToolStripMenuItem.Size = new System.Drawing.Size(180, 24); this.라인코드관리ToolStripMenuItem.Text = "라인코드관리"; this.라인코드관리ToolStripMenuItem.Click += new System.EventHandler(this.라인코드관리ToolStripMenuItem_Click); // @@ -629,6 +631,20 @@ this.toolStripMenuItem5.Text = "(test)휴가등록"; this.toolStripMenuItem5.Click += new System.EventHandler(this.toolStripMenuItem5_Click); // + // 기타ToolStripMenuItem + // + this.기타ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.행복나래ToolStripMenuItem}); + this.기타ToolStripMenuItem.Name = "기타ToolStripMenuItem"; + this.기타ToolStripMenuItem.Size = new System.Drawing.Size(49, 23); + this.기타ToolStripMenuItem.Text = "기타"; + // + // 행복나래ToolStripMenuItem + // + this.행복나래ToolStripMenuItem.Name = "행복나래ToolStripMenuItem"; + this.행복나래ToolStripMenuItem.Size = new System.Drawing.Size(134, 24); + this.행복나래ToolStripMenuItem.Text = "행복나래"; + // // 즐겨찾기ToolStripMenuItem // this.즐겨찾기ToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("즐겨찾기ToolStripMenuItem.Image"))); @@ -860,19 +876,12 @@ this.toolStripButton2.Text = "품목정보"; this.toolStripButton2.Click += new System.EventHandler(this.toolStripButton2_Click_1); // - // 기타ToolStripMenuItem + // 잉여장비ToolStripMenuItem // - this.기타ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.행복나래ToolStripMenuItem}); - this.기타ToolStripMenuItem.Name = "기타ToolStripMenuItem"; - this.기타ToolStripMenuItem.Size = new System.Drawing.Size(49, 23); - this.기타ToolStripMenuItem.Text = "기타"; - // - // 행복나래ToolStripMenuItem - // - this.행복나래ToolStripMenuItem.Name = "행복나래ToolStripMenuItem"; - this.행복나래ToolStripMenuItem.Size = new System.Drawing.Size(180, 24); - this.행복나래ToolStripMenuItem.Text = "행복나래"; + this.잉여장비ToolStripMenuItem.Name = "잉여장비ToolStripMenuItem"; + this.잉여장비ToolStripMenuItem.Size = new System.Drawing.Size(180, 24); + this.잉여장비ToolStripMenuItem.Text = "잉여장비"; + this.잉여장비ToolStripMenuItem.Click += new System.EventHandler(this.잉여장비ToolStripMenuItem_Click); // // fMain // @@ -994,6 +1003,7 @@ private System.Windows.Forms.ToolStripMenuItem 업무현황전자실ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 기타ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 행복나래ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem 잉여장비ToolStripMenuItem; } } diff --git a/Project/fMain.cs b/Project/fMain.cs index f240aec..a9a2429 100644 --- a/Project/fMain.cs +++ b/Project/fMain.cs @@ -1,4 +1,5 @@ using arTCPService.Server; +using Microsoft.Owin.Hosting; using System; using System.Collections.Generic; using System.ComponentModel; @@ -130,9 +131,11 @@ namespace Project //사용기록추적 Pub.CheckNRegister3(Application.ProductName, "chi", Application.ProductVersion); + // Start OWIN host + WebApp.Start(url: "http://127.0.0.1:9000"); + Console.WriteLine("start webapp"); + - - //서버ON try { @@ -1120,5 +1123,12 @@ namespace Project //업무현황 전자실 menu_work_eboard(); } + + private void 잉여장비ToolStripMenuItem_Click(object sender, EventArgs e) + { + string formkey = "INGYEQ"; + if (!ShowForm(formkey)) + AddForm(formkey, new FEQ0000.fEquipment(FEQ0000.fEquipment.eTabletype.ING), "잉여장비"); + } } } diff --git a/Project/fMain.resx b/Project/fMain.resx index 3538c7a..6cf0e20 100644 --- a/Project/fMain.resx +++ b/Project/fMain.resx @@ -153,26 +153,6 @@ Mi4wAwEBAAAh+QQBAAAXACwAAAAAEAAQAAAIggAvCBwo0IJBCwQTFqwAAQEDhAoXTpgoYQDEhBYqTKDA kYKEBRclciRAoMEDCREuZtw40oKCCihVauxIIYEBmCkJruxYoWfMggYPsOyJU+WAABMqCJDgM+eFg0iV Aigg4WfBo0kFADAYwWnBABSkQjSIcYDYiAMtBHCwFW3ag24HBgQAOw== - - - - - R0lGODlhEAAQAIQAAHan1azQ4ldvj9vp9HSQruTr80lVa+vx9pu811SRuXifuj13uYyz2VFhe4Gt2UNL - XPL1+Orv+ufu9YOqxYyzzNHW3SkxQz5FVWag2T6CuZe3y5G0t+Do7+r0/77a9f///yH/C05FVFNDQVBF - Mi4wAwEBAAAh+QQAAAAAACwAAAAAEAAQAAAIrwA/CBxIsKDAAQESIkBAYYICBQQICCAgMMAACQMyaswo - oUKDih0SZMiwoKTJBQcEVDyAoEMHDy5hdnAg4eMHBBIQeNjJcyeDAjYRRNAQs+hMoAIpRNjQs6eDAgYE - TshpVCYAqAIV5GzKU0GBB1klMKjqEgMHsB8IiOW60+wFgQQgIGDgoC4AABgwADjw9oOAChAkSChAmIPh - AxUswBXAuEEDAwYePLhwwYJNg5gFBgQAOw== - - - - - R0lGODlhEAAQAIQfAHWSrbTY+6nU/I+74/r8/drj7FlxkUlVa9Xp/eLs9cvT2oWpx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R/olvHcMVa+g+o6dqvErVWjZJPLfu57DyYCKcs + HM55JkUAeiXF5jFTNne/biPU+LpoHixfS0+Zio5iFbZCpai1aNbxQ997HNdn05D3bIkIP1K3VjF6wbWX + 73wGZgbqmPIY+LJLT8it53R7NZ85dEy6aviiMQ9TfurFZOyheg2ZT/dLypCtTPGgoyD979VXtbLtpp3y + lTNzND/1H8vuNHcyKpP5KtJTBiT1/WDTFma9uic8069juk/H+Z4qznVXcqazkgmnRG/tG7QUyI8JwMAB + VXSieSuXhmoIHtnEeP16xuqy8NdmcdKQxbAuE++hl/FIGbi0GQwZtzFqk+iszk5MJA/JusrS/poLmgga + X2W0+kWxrP9z004FbsPbnGqvEUcSgNszdmJnG7k58S6/jtcSDei4MXKIn4e1zHlLuOYp5EfXLq7a87nS + msv3lsSDGjat7CMJ+KYtESolcmIXJ3pseDwe4WnHPi5bcvjoQzNGoxG9Xs9CtFT4us8kJhKAW+etzE87 + iIXbCPg6icViRCIR/H4/DoeDcDjM0tISlRXlXBtsEOEnAI//ca76XKampojH4ywvLwsvLi4SCATQad4U + Yz++E3ETq2W1Wt8xm83RR2NLkvRHUVHRoEajeSrZkpRM9i/ebTVtphOuywAAAABJRU5ErkJggg== diff --git a/Project/packages.config b/Project/packages.config index baad00f..358006f 100644 --- a/Project/packages.config +++ b/Project/packages.config @@ -8,10 +8,15 @@ + + + + + \ No newline at end of file diff --git a/SubProject/FEQ0000/Equipment/EQFilterApply.cs b/SubProject/FEQ0000/Equipment/EQFilterApply.cs index 7655ead..0757c82 100644 --- a/SubProject/FEQ0000/Equipment/EQFilterApply.cs +++ b/SubProject/FEQ0000/Equipment/EQFilterApply.cs @@ -1,109 +1,113 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Windows.Forms; - -namespace FEQ0000 -{ - public partial class EQFilterApply : Form - { - - fEquipment.eTabletype divtype; - public EQFilterApply(fEquipment.eTabletype type_) - { - InitializeComponent(); - divtype = type_; - this.FormClosed += __Closed; - } - - void __Closed(object sender, FormClosedEventArgs e) - { - - } - - private void __Load(object sender, EventArgs e) - { - - try - { - ta.Fill(this.dsEQ.EquipmentFilter); - - //필터목록을 미리 가져온다. - arUtil.XMLHelper xml = new arUtil.XMLHelper(FCOMMON.info.Path.MakeFilePath("Setting", "eqfilter.xml")); - if (!xml.Exist()) xml.CreateFile(); - List filterList = new List(); - int filterCnt = int.Parse(xml.get_Data("filter", "count", "0")); - for (int i = 0; i < filterCnt; i++) - { - var data= xml.get_Data("filter", "item" + (i + 1).ToString()); - if (data=="") continue; - filterList.Add(data); - } - - foreach (dsEQ.EquipmentFilterRow item in this.dsEQ.EquipmentFilter.Select("", "Title")) - { - string title = item.Title; - if (title=="") continue; - - var chk = filterList.IndexOf(title) != -1; - var lvitem = this.listView1.Items.Add(item.Title); - lvitem.Checked = chk; - lvitem.SubItems.Add(item.memo); - lvitem.SubItems.Add(item.Filter); - lvitem.SubItems.Add(item.Apply); - } - } - catch (Exception ex) - { - FCOMMON.Util.MsgE(ex.Message); - } - } - - private void toolStripButton1_Click(object sender, EventArgs e) - { - this.Invalidate(); - this.bs.EndEdit(); - try - { - var cnt = ta.Update(this.dsEQ.EquipmentFilter); - FCOMMON.Util.MsgI("update : " + cnt.ToString()); - - } - catch (Exception ex) - { - FCOMMON.Util.MsgE(ex.Message); - } - } - - public string filter = string.Empty; - public string apply = string.Empty; - - - private void button1_Click_1(object sender, EventArgs e) - { - //다음에 체크한것을 복원하기 위해 값을 기록한다. - List filterList = new List(); - foreach (ListViewItem item in this.listView1.CheckedItems) - { - string title = item.SubItems[0].Text.Trim(); - if (title=="") continue; - filterList.Add(title); - } - - arUtil.XMLHelper xml = new arUtil.XMLHelper(FCOMMON.info.Path.MakeFilePath( "Setting", "eqfilter.xml")); - if (!xml.Exist()) xml.CreateFile(); - xml.set_Data("filter", "count", filterList.Count.ToString()); - for (int i = 0; i < filterList.Count; i++) - { - xml.set_Data("filter", "item" + (i + 1).ToString(), filterList[i]); - } - xml.Save(); - - DialogResult = System.Windows.Forms.DialogResult.OK; - } - } -} +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace FEQ0000 +{ + public partial class EQFilterApply : Form + { + + //fEquipment.eTabletype divtype; + string eqfiletertype = "E"; + public EQFilterApply(string type_) + { + InitializeComponent(); + this.eqfiletertype = type_; + this.FormClosed += __Closed; + } + + void __Closed(object sender, FormClosedEventArgs e) + { + + } + + private void __Load(object sender, EventArgs e) + { + + try + { + ta.Fill(this.dsEQ.EquipmentFilter, eqfiletertype); + + //필터목록을 미리 가져온다. + var fn = "eqfilter.xml"; + if (eqfiletertype != "E") fn = "eqfilterIng.xml"; + arUtil.XMLHelper xml = new arUtil.XMLHelper(FCOMMON.info.Path.MakeFilePath("Setting", "eqfilter.xml")); + if (!xml.Exist()) xml.CreateFile(); + List filterList = new List(); + int filterCnt = int.Parse(xml.get_Data("filter", "count", "0")); + for (int i = 0; i < filterCnt; i++) + { + var data= xml.get_Data("filter", "item" + (i + 1).ToString()); + if (data=="") continue; + filterList.Add(data); + } + + foreach (dsEQ.EquipmentFilterRow item in this.dsEQ.EquipmentFilter.Select("", "Title")) + { + string title = item.Title; + if (title=="") continue; + + var chk = filterList.IndexOf(title) != -1; + var lvitem = this.listView1.Items.Add(item.Title); + lvitem.Checked = chk; + lvitem.SubItems.Add(item.memo); + lvitem.SubItems.Add(item.Filter); + lvitem.SubItems.Add(item.Apply); + } + } + catch (Exception ex) + { + FCOMMON.Util.MsgE(ex.Message); + } + } + + private void toolStripButton1_Click(object sender, EventArgs e) + { + this.Invalidate(); + this.bs.EndEdit(); + try + { + var cnt = ta.Update(this.dsEQ.EquipmentFilter); + FCOMMON.Util.MsgI("update : " + cnt.ToString()); + + } + catch (Exception ex) + { + FCOMMON.Util.MsgE(ex.Message); + } + } + + public string filter = string.Empty; + public string apply = string.Empty; + + + private void button1_Click_1(object sender, EventArgs e) + { + //다음에 체크한것을 복원하기 위해 값을 기록한다. + List filterList = new List(); + foreach (ListViewItem item in this.listView1.CheckedItems) + { + string title = item.SubItems[0].Text.Trim(); + if (title=="") continue; + filterList.Add(title); + } + var fn = this.eqfiletertype == "E" ? "eqfilter.xml" : "eqfilterIng.xml"; + + arUtil.XMLHelper xml = new arUtil.XMLHelper(FCOMMON.info.Path.MakeFilePath( "Setting", fn)); + if (!xml.Exist()) xml.CreateFile(); + xml.set_Data("filter", "count", filterList.Count.ToString()); + for (int i = 0; i < filterList.Count; i++) + { + xml.set_Data("filter", "item" + (i + 1).ToString(), filterList[i]); + } + xml.Save(); + + DialogResult = System.Windows.Forms.DialogResult.OK; + } + } +} diff --git a/SubProject/FEQ0000/Equipment/EQfilterManager.cs b/SubProject/FEQ0000/Equipment/EQfilterManager.cs index c3f84e1..78532ae 100644 --- a/SubProject/FEQ0000/Equipment/EQfilterManager.cs +++ b/SubProject/FEQ0000/Equipment/EQfilterManager.cs @@ -1,79 +1,71 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Windows.Forms; - -namespace FEQ0000 -{ - public partial class EQfilterManager : Form - { - string divtype = string.Empty; - public EQfilterManager(string type_) - { - InitializeComponent(); - switch(type_.ToUpper()) - { - case "EUQIPMENTB": - divtype = "B"; - break; - case "EUQIPMENTF": - divtype = "F"; - break; - default: - divtype = "E"; - break; - } - this.dsEQ.EquipmentFilter.TableNewRow += EquipmentFilter_TableNewRow; - } - - void EquipmentFilter_TableNewRow(object sender, DataTableNewRowEventArgs e) - { - e.Row["type"] = this.divtype; - e.Row["wuid"] = FCOMMON.info.Login.no; - e.Row["wdate"] = DateTime.Now; - } - - private void EQfilter_Load(object sender, EventArgs e) - { - try { - ta.Fill(this.dsEQ.EquipmentFilter); - }catch (Exception ex) - { - FCOMMON.Util.MsgE(ex.Message); - } - } - - private void toolStripButton1_Click(object sender, EventArgs e) - { - this.Invalidate(); - this.bs.EndEdit(); - try - { - var cnt = ta.Update(this.dsEQ.EquipmentFilter); - FCOMMON.Util.MsgI("update : " + cnt.ToString()); - - }catch(Exception ex) - { - FCOMMON.Util.MsgE(ex.Message); - } - } - - public string filter = string.Empty; - public string apply = string.Empty; - private void button1_Click(object sender, EventArgs e) - { - - } - - private void toolStripButton2_Click(object sender, EventArgs e) - { - filter = textBox1.Text.Trim(); - apply = textBox2.Text.Trim(); - DialogResult = System.Windows.Forms.DialogResult.OK; - } - } -} +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace FEQ0000 +{ + public partial class EQfilterManager : Form + { + string divtype = string.Empty; + public EQfilterManager(string type_) + { + InitializeComponent(); + divtype = type_; + this.dsEQ.EquipmentFilter.TableNewRow += EquipmentFilter_TableNewRow; + } + + void EquipmentFilter_TableNewRow(object sender, DataTableNewRowEventArgs e) + { + e.Row["type"] = this.divtype; + e.Row["wuid"] = FCOMMON.info.Login.no; + e.Row["wdate"] = DateTime.Now; + } + + private void EQfilter_Load(object sender, EventArgs e) + { + try + { + ta.Fill(this.dsEQ.EquipmentFilter, divtype); + } + catch (Exception ex) + { + FCOMMON.Util.MsgE(ex.Message); + } + } + + private void toolStripButton1_Click(object sender, EventArgs e) + { + this.Invalidate(); + this.bs.EndEdit(); + try + { + var cnt = ta.Update(this.dsEQ.EquipmentFilter); + FCOMMON.Util.MsgI("update : " + cnt.ToString()); + + } + catch (Exception ex) + { + FCOMMON.Util.MsgE(ex.Message); + } + } + + public string filter = string.Empty; + public string apply = string.Empty; + private void button1_Click(object sender, EventArgs e) + { + + } + + private void toolStripButton2_Click(object sender, EventArgs e) + { + filter = textBox1.Text.Trim(); + apply = textBox2.Text.Trim(); + DialogResult = System.Windows.Forms.DialogResult.OK; + } + } +} diff --git a/SubProject/FEQ0000/Equipment/ReportI.rdlc b/SubProject/FEQ0000/Equipment/ReportI.rdlc new file mode 100644 index 0000000..c3deae6 --- /dev/null +++ b/SubProject/FEQ0000/Equipment/ReportI.rdlc @@ -0,0 +1,1221 @@ + + + + + + + + + + + + true + true + + + + + Process + + + + + + + Textbox7 + + + Silver + Middle + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + true + true + + + + + G-TTL + + + + + + + Textbox19 + + + Silver + Middle + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + true + true + + + + + Manufacturer + + + + + + + Textbox4 + + + Silver + Middle + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + true + true + + + + + Model + + + + + + + Textbox30 + + + Silver + Middle + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + + + + + + + + + 0.99127cm + + + 0.91249cm + + + 3.21437cm + + + + + 0.6cm + + + + + true + true + + + + + =Sum(Fields!cnt.Value) + + + + + + + cnt + + + White + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!cnt.Value) + + + + + + + cnt1 + + + WhiteSmoke + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Remark.Value + + + + + + + Remark + + + White + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + =Sum(Fields!cnt.Value) + + + + + + + cnt4 + + + #7292cc + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!cnt.Value) + + + + + + + cnt5 + + + #7292cc + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox9 + + + #7292cc + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + =Fields!lineT.Value + + + + + =Fields!lineT.Value + + + + 0.6cm + + + true + true + + + + + =Fields!lineT.Value + + + + + + + team + + + Silver + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + + =Fields!lineP.Value + + + + + =Fields!lineP.Value + + + + 0.6cm + + + true + true + + + + + =Fields!lineP.Value + + + + + + + part + + + Silver + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 1.2cm + + + true + true + + + + + Sub +Total + + + + + + + Textbox16 + + + Silver + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + 1.2cm + + + true + true + + + + + Remark + + + + + + + Textbox1 + + + Silver + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + =Fields!grp.Value + + + + + =Fields!grp.Value + + + + 4.96062cm + + + true + true + + + + + =Fields!grp.Value + + + + + + + grp + + + White + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + 1.46812cm + + + true + true + + + + + =Sum(Fields!cnt.Value) + + + + + + + cnt6 + + + Khaki + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + + =Fields!manu.Value + + + + + =Fields!manu.Value + + + + + + 3.02917cm + + + true + true + + + + + =Fields!manu.Value + + + + + + + manu + + + White + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + + =Fields!model.Value + + + + + =Fields!model.Value + + + + 3.26729cm + + + true + true + + + + + =Fields!model.Value + + + + + + + model + + + White + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + 4.96062cm + + + true + true + + + + + 합계 + + + + + + + Textbox10 + + + #7292cc + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + 1.46812cm + + + true + true + + + + + =Sum(Fields!cnt.Value) + + + + + + + Textbox23 + + + #7292cc + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + 3.02917cm + + + true + true + + + + + + + + + + + + Textbox11 + + + #7292cc + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + 3.26729cm + + + true + true + + + + + + + + + + + + Textbox34 + + + #7292cc + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + Before + + + + DataSet1 + 2.4cm + 17.84334cm + + + 맑은 고딕 + 8pt + + + + 0.94488in + + + + + + + Textbox2 + 0.14111cm + 0.127cm + 0.64029cm + 4.79087cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!OverallPageNumber & "/" & Globals!OverallTotalPages + + + + + + + Textbox2 + 0.14111cm + 5.10526cm + 0.64029cm + 17.3813cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + + Textbox2 + 0.14111cm + 22.66295cm + 0.64029cm + 4.79087cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 21cm + 29.7cm + 1cm + 1cm + 1cm + 1cm + 0.13cm +