From ba0204973725ae4e0bef8ceb87a4183834a58e7c Mon Sep 17 00:00:00 2001 From: chi Date: Fri, 28 May 2021 11:34:30 +0900 Subject: [PATCH] =?UTF-8?q?=EC=97=85=EB=AC=B4=EC=9D=BC=EC=A7=80=20?= =?UTF-8?q?=EB=A9=94=EC=9D=BC=20=EB=B0=9C=EC=86=A1=20=EB=A1=9C=EC=A7=81?= =?UTF-8?q?=EC=97=90=EC=84=9C.=20=ED=9C=B4=EC=9D=BC=20=EC=B2=B4=ED=81=AC?= =?UTF-8?q?=20=EB=A3=A8=ED=8B=B4=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EETGW.sln | 11 + JobReportMailService/MDIParent1.Designer.cs | 21 +- JobReportMailService/MDIParent1.cs | 5 + .../Properties/AssemblyInfo.cs | 4 +- JobReportMailService/fJobReportDay.cs | 2 +- JobReportMailService/fNoScheduleDayWeek.cs | 2 +- Project/Controller/ProjectController.cs | 269 +++ Project/Controller/ResourceController.cs | 5 + Project/DataSet1.xsd | 10 +- Project/Dialog/fLogin.cs | 3 + Project/Dialog/fSelectDept.Designer.cs | 234 +-- Project/Dialog/fSelectDept.cs | 80 +- Project/DsPMPDatabase.xsd | 4 +- Project/EETGW.csproj | 16 +- Project/EETGW_ProjectsSchedule.cs | 2 + Project/ModelProject.Context.cs | 2 +- Project/ModelProject.edmx | 91 +- Project/ModelProject.edmx.diagram | 2 +- Project/OWIN/Startup.cs | 3 + Project/Properties/AssemblyInfo.cs | 4 +- Project/Setting.cs | 4 + Project/_Common/fNewID.cs | 88 +- Project/_Common/fNewPassword.cs | 110 +- Project/app.config | 2 +- Project/dsAccess.xsd | 6 +- Project/dsMSSQL.xsd | 1788 +--------------- Project/fMain.cs | 8 +- Project/packages.config | 7 +- SubProject/FCOMMON/Info.cs | 10 +- SubProject/FPJ0000/Model1.edmx.diagram | 2 +- SubProject/FPJ0000/Note/fNote.cs | 32 +- SubProject/FPJ0000/Note/fNote_Add.cs | 2 +- SubProject/FPJ0000/Project/fPartBuyStatus.cs | 4 +- SubProject/FPJ0000/Project/fProjectData.cs | 18 +- SubProject/FPJ0000/Project/fProjectLayout.cs | 20 +- SubProject/FPJ0000/Project/fProjectList.cs | 8 +- SubProject/FPJ0000/Project/fProjectList.resx | 44 +- .../FPJ0000/Properties/Settings.Designer.cs | 24 - .../FPJ0000/Properties/Settings.settings | 6 - SubProject/FPJ0000/app.config | 13 - SubProject/WebServer/App.config | 35 + SubProject/WebServer/Auth.cs | 27 + SubProject/WebServer/BaseController.cs | 314 +++ SubProject/WebServer/Common.cs | 28 + .../Controller/CustomerController.cs | 199 ++ .../WebServer/Controller/HomeController.cs | 93 + .../WebServer/Controller/ItemController.cs | 148 ++ .../Controller/JobreportController.cs | 290 +++ .../WebServer/Controller/ProjectController.cs | 467 +++++ .../Controller/PurchaseController.cs | 208 ++ .../Controller/ResourceController.cs | 114 ++ .../WebServer/Controller/ResultController.cs | 64 + .../WebServer/Controller/SettingController.cs | 63 + SubProject/WebServer/Customs.cs | 35 + SubProject/WebServer/EETGW_GroupUser.cs | 28 + SubProject/WebServer/EETGW_Project_Layout.cs | 30 + .../WebServer/EETGW_ProjectsSchedule.cs | 34 + SubProject/WebServer/HolidayLIst.cs | 24 + SubProject/WebServer/Holyday.cs | 38 + SubProject/WebServer/Items.cs | 40 + SubProject/WebServer/JobReport.cs | 39 + SubProject/WebServer/LineCode.cs | 28 + SubProject/WebServer/MailData.cs | 35 + SubProject/WebServer/MailForm.cs | 35 + SubProject/WebServer/MethodExtentions.cs | 140 ++ SubProject/WebServer/Model/PageModel.cs | 18 + SubProject/WebServer/Model1.Context.cs | 51 + SubProject/WebServer/Model1.Context.tt | 636 ++++++ SubProject/WebServer/Model1.Designer.cs | 10 + SubProject/WebServer/Model1.cs | 9 + SubProject/WebServer/Model1.edmx | 1810 +++++++++++++++++ SubProject/WebServer/Model1.edmx.diagram | 33 + SubProject/WebServer/Model1.tt | 733 +++++++ SubProject/WebServer/OWIN/Startup.cs | 79 + SubProject/WebServer/OWIN/StartupSSE.cs | 101 + SubProject/WebServer/Program.cs | 27 + SubProject/WebServer/Projects.cs | 70 + SubProject/WebServer/ProjectsPart.cs | 50 + .../WebServer/Properties/AssemblyInfo.cs | 36 + SubProject/WebServer/Purchase.cs | 52 + SubProject/WebServer/UserGroup.cs | 23 + SubProject/WebServer/Users.cs | 39 + SubProject/WebServer/WebServer.csproj | 258 +++ SubProject/WebServer/packages.config | 32 + SubProject/WebServer/vFindSID.cs | 30 + SubProject/WebServer/vGroupUser.cs | 39 + SubProject/WebServer/vJobReportForUser.cs | 35 + SubProject/WebServer/vPurchase.cs | 53 + 88 files changed, 7522 insertions(+), 2224 deletions(-) create mode 100644 SubProject/WebServer/App.config create mode 100644 SubProject/WebServer/Auth.cs create mode 100644 SubProject/WebServer/BaseController.cs create mode 100644 SubProject/WebServer/Common.cs create mode 100644 SubProject/WebServer/Controller/CustomerController.cs create mode 100644 SubProject/WebServer/Controller/HomeController.cs create mode 100644 SubProject/WebServer/Controller/ItemController.cs create mode 100644 SubProject/WebServer/Controller/JobreportController.cs create mode 100644 SubProject/WebServer/Controller/ProjectController.cs create mode 100644 SubProject/WebServer/Controller/PurchaseController.cs create mode 100644 SubProject/WebServer/Controller/ResourceController.cs create mode 100644 SubProject/WebServer/Controller/ResultController.cs create mode 100644 SubProject/WebServer/Controller/SettingController.cs create mode 100644 SubProject/WebServer/Customs.cs create mode 100644 SubProject/WebServer/EETGW_GroupUser.cs create mode 100644 SubProject/WebServer/EETGW_Project_Layout.cs create mode 100644 SubProject/WebServer/EETGW_ProjectsSchedule.cs create mode 100644 SubProject/WebServer/HolidayLIst.cs create mode 100644 SubProject/WebServer/Holyday.cs create mode 100644 SubProject/WebServer/Items.cs create mode 100644 SubProject/WebServer/JobReport.cs create mode 100644 SubProject/WebServer/LineCode.cs create mode 100644 SubProject/WebServer/MailData.cs create mode 100644 SubProject/WebServer/MailForm.cs create mode 100644 SubProject/WebServer/MethodExtentions.cs create mode 100644 SubProject/WebServer/Model/PageModel.cs create mode 100644 SubProject/WebServer/Model1.Context.cs create mode 100644 SubProject/WebServer/Model1.Context.tt create mode 100644 SubProject/WebServer/Model1.Designer.cs create mode 100644 SubProject/WebServer/Model1.cs create mode 100644 SubProject/WebServer/Model1.edmx create mode 100644 SubProject/WebServer/Model1.edmx.diagram create mode 100644 SubProject/WebServer/Model1.tt create mode 100644 SubProject/WebServer/OWIN/Startup.cs create mode 100644 SubProject/WebServer/OWIN/StartupSSE.cs create mode 100644 SubProject/WebServer/Program.cs create mode 100644 SubProject/WebServer/Projects.cs create mode 100644 SubProject/WebServer/ProjectsPart.cs create mode 100644 SubProject/WebServer/Properties/AssemblyInfo.cs create mode 100644 SubProject/WebServer/Purchase.cs create mode 100644 SubProject/WebServer/UserGroup.cs create mode 100644 SubProject/WebServer/Users.cs create mode 100644 SubProject/WebServer/WebServer.csproj create mode 100644 SubProject/WebServer/packages.config create mode 100644 SubProject/WebServer/vFindSID.cs create mode 100644 SubProject/WebServer/vGroupUser.cs create mode 100644 SubProject/WebServer/vJobReportForUser.cs create mode 100644 SubProject/WebServer/vPurchase.cs diff --git a/EETGW.sln b/EETGW.sln index f3bb624..8cfc830 100644 --- a/EETGW.sln +++ b/EETGW.sln @@ -41,6 +41,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FOW0000", "SubProject\FOW00 EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UMSControl", "SubProject\CMSControl\UMSControl.csproj", "{55EF08A8-6E94-4569-8371-7AAC9DE916AB}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebServer", "SubProject\WebServer\WebServer.csproj", "{CAFE5CD0-C055-4C77-9253-8D5EE9558D43}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -169,6 +171,14 @@ Global {55EF08A8-6E94-4569-8371-7AAC9DE916AB}.Release|Any CPU.Build.0 = Release|Any CPU {55EF08A8-6E94-4569-8371-7AAC9DE916AB}.Release|x86.ActiveCfg = Release|Any CPU {55EF08A8-6E94-4569-8371-7AAC9DE916AB}.Release|x86.Build.0 = Release|Any CPU + {CAFE5CD0-C055-4C77-9253-8D5EE9558D43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CAFE5CD0-C055-4C77-9253-8D5EE9558D43}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CAFE5CD0-C055-4C77-9253-8D5EE9558D43}.Debug|x86.ActiveCfg = Debug|Any CPU + {CAFE5CD0-C055-4C77-9253-8D5EE9558D43}.Debug|x86.Build.0 = Debug|Any CPU + {CAFE5CD0-C055-4C77-9253-8D5EE9558D43}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CAFE5CD0-C055-4C77-9253-8D5EE9558D43}.Release|Any CPU.Build.0 = Release|Any CPU + {CAFE5CD0-C055-4C77-9253-8D5EE9558D43}.Release|x86.ActiveCfg = Release|Any CPU + {CAFE5CD0-C055-4C77-9253-8D5EE9558D43}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -188,6 +198,7 @@ Global {3CD79316-211A-4B57-A6B4-00FA6091C29D} = {28105E67-9D33-4627-8E26-FCE67700622F} {8D593B42-1EAE-4D5A-A2C1-0361E2C43A80} = {6C7EC99E-7367-4255-A039-EF5E8D75A2F6} {55EF08A8-6E94-4569-8371-7AAC9DE916AB} = {28105E67-9D33-4627-8E26-FCE67700622F} + {CAFE5CD0-C055-4C77-9253-8D5EE9558D43} = {6C7EC99E-7367-4255-A039-EF5E8D75A2F6} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {B5B1FD72-356F-4840-83E8-B070AC21C8D9} diff --git a/JobReportMailService/MDIParent1.Designer.cs b/JobReportMailService/MDIParent1.Designer.cs index 0aecafb..e8068b0 100644 --- a/JobReportMailService/MDIParent1.Designer.cs +++ b/JobReportMailService/MDIParent1.Designer.cs @@ -77,12 +77,12 @@ namespace JobReportMailService this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.saveToolStripButton = new System.Windows.Forms.ToolStripButton(); this.printToolStripButton = new System.Windows.Forms.ToolStripButton(); + this.toolStripButton2 = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); this.statusStrip = new System.Windows.Forms.StatusStrip(); this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.toolTip = new System.Windows.Forms.ToolTip(this.components); - this.toolStripButton2 = new System.Windows.Forms.ToolStripButton(); this.menuStrip.SuspendLayout(); this.toolStrip.SuspendLayout(); this.statusStrip.SuspendLayout(); @@ -487,6 +487,15 @@ namespace JobReportMailService this.printToolStripButton.Text = "스케쥴(주)"; this.printToolStripButton.Click += new System.EventHandler(this.printToolStripButton_Click); // + // toolStripButton2 + // + this.toolStripButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton2.Image"))); + this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Black; + this.toolStripButton2.Name = "toolStripButton2"; + this.toolStripButton2.Size = new System.Drawing.Size(107, 22); + this.toolStripButton2.Text = "스케쥴없음(주)"; + this.toolStripButton2.Click += new System.EventHandler(this.toolStripButton2_Click); + // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; @@ -518,15 +527,6 @@ namespace JobReportMailService this.toolStripStatusLabel.Size = new System.Drawing.Size(31, 17); this.toolStripStatusLabel.Text = "상태"; // - // toolStripButton2 - // - this.toolStripButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton2.Image"))); - this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Black; - this.toolStripButton2.Name = "toolStripButton2"; - this.toolStripButton2.Size = new System.Drawing.Size(107, 22); - this.toolStripButton2.Text = "스케쥴없음(주)"; - this.toolStripButton2.Click += new System.EventHandler(this.toolStripButton2_Click); - // // MDIParent1 // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); @@ -539,6 +539,7 @@ namespace JobReportMailService this.MainMenuStrip = this.menuStrip; this.Name = "MDIParent1"; this.Text = "MDIParent1"; + this.Load += new System.EventHandler(this.MDIParent1_Load); this.menuStrip.ResumeLayout(false); this.menuStrip.PerformLayout(); this.toolStrip.ResumeLayout(false); diff --git a/JobReportMailService/MDIParent1.cs b/JobReportMailService/MDIParent1.cs index e639e74..6f300af 100644 --- a/JobReportMailService/MDIParent1.cs +++ b/JobReportMailService/MDIParent1.cs @@ -133,5 +133,10 @@ namespace JobReportMailService //childForm.Text = "창 " + childFormNumber++; childForm.Show(); } + + private void MDIParent1_Load(object sender, EventArgs e) + { + this.Text = "mail service " + Application.ProductVersion.ToString(); + } } } diff --git a/JobReportMailService/Properties/AssemblyInfo.cs b/JobReportMailService/Properties/AssemblyInfo.cs index 6d592ec..9b34613 100644 --- a/JobReportMailService/Properties/AssemblyInfo.cs +++ b/JobReportMailService/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를 // 기본값으로 할 수 있습니다. // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("21.05.16.1600")] -[assembly: AssemblyFileVersion("21.05.16.1600")] +[assembly: AssemblyVersion("21.05.28.1120")] +[assembly: AssemblyFileVersion("21.05.28.1120")] diff --git a/JobReportMailService/fJobReportDay.cs b/JobReportMailService/fJobReportDay.cs index d0b168e..d968b10 100644 --- a/JobReportMailService/fJobReportDay.cs +++ b/JobReportMailService/fJobReportDay.cs @@ -142,7 +142,7 @@ namespace JobReportMailService //이 날짜가 휴일인지 체크한다. db = new EEEntities(); - var Holyinfo = db.HolidayLIst.Where(t => t.pdate == jobdata.package).FirstOrDefault(); + var Holyinfo = db.HolidayLIst.Where(t => t.pdate == jobdata.pdate).FirstOrDefault(); if (Holyinfo != null && Holyinfo.free != null && (bool)(Holyinfo.free)) continue; //이날짜에는 8시간을 근무 해야 한다 diff --git a/JobReportMailService/fNoScheduleDayWeek.cs b/JobReportMailService/fNoScheduleDayWeek.cs index ddbc41f..5f07fd1 100644 --- a/JobReportMailService/fNoScheduleDayWeek.cs +++ b/JobReportMailService/fNoScheduleDayWeek.cs @@ -144,7 +144,7 @@ namespace JobReportMailService { //스케쥴에서 데이터를 찾는다. - var cnt = db.EETGW_ProjectsSchedule.AsNoTracking().Where(t => t.gcode == Pub.vGcode && t.project == row.idx && t.appoval > 1).Any(); + var cnt = db.EETGW_ProjectsSchedule.AsNoTracking().Where(t => t.gcode == Pub.vGcode && t.project == row.idx).Any(); if (cnt == true) continue; //등록되었다 body.AppendLine($""); diff --git a/Project/Controller/ProjectController.cs b/Project/Controller/ProjectController.cs index be6cff0..acef50c 100644 --- a/Project/Controller/ProjectController.cs +++ b/Project/Controller/ProjectController.cs @@ -103,6 +103,74 @@ namespace Project return resp; } + + + [HttpGet] + public HttpResponseMessage ScheduleConfirm(int? id) + { + //로그인이 되어있지않다면 로그인을 가져온다 + MethodResult result; + result = View(); + var project = (int)id; + + //데이터를 조회해서 표시를 해준다. + var db = new EEEntitiesProject(); + var prjinfo = db.Projects.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.idx == project).FirstOrDefault(); + var schrows = 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() { @@ -179,6 +247,207 @@ namespace Project 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 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.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 EEEntitiesProject(); + + var prjinfo = 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 rows = 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); diff --git a/Project/Controller/ResourceController.cs b/Project/Controller/ResourceController.cs index 175aaf8..26043be 100644 --- a/Project/Controller/ResourceController.cs +++ b/Project/Controller/ResourceController.cs @@ -45,6 +45,11 @@ namespace Project isBinary = false; content_type = "application/json"; } + else if(v_ext == "vue") + { + isBinary = false; + content_type = "application/js"; + } else if (v_ext == "js") { isBinary = false; diff --git a/Project/DataSet1.xsd b/Project/DataSet1.xsd index 0519ad9..846c21c 100644 --- a/Project/DataSet1.xsd +++ b/Project/DataSet1.xsd @@ -4,7 +4,7 @@ - + @@ -54,7 +54,7 @@ WHERE (gcode = @gcode) AND (ISNULL(dept, '') LIKE @dept) AND (ISNULL(processs, - + @@ -68,7 +68,7 @@ WHERE (gcode = @gcode) AND (ISNULL(dept, '') LIKE @dept) AND (ISNULL(processs, - + @@ -78,7 +78,7 @@ WHERE (gcode = @gcode) AND (ISNULL(dept, '') LIKE @dept) AND (ISNULL(processs, - + @@ -87,7 +87,7 @@ WHERE (gcode = @gcode) AND (ISNULL(dept, '') LIKE @dept) AND (ISNULL(processs, - + diff --git a/Project/Dialog/fLogin.cs b/Project/Dialog/fLogin.cs index 5f02e6e..30fd78f 100644 --- a/Project/Dialog/fLogin.cs +++ b/Project/Dialog/fLogin.cs @@ -152,6 +152,9 @@ namespace Project.Dialog FCOMMON.info.Login.process = userdr.processs; FCOMMON.info.Login.permission = 0; FCOMMON.info.Login.gpermission = int.Parse(gperm); + FCOMMON.info.datapath = Pub.setting.SharedDataPath; + if(FCOMMON.info.datapath.isEmpty() && gCode == "EET1P") //210524 + FCOMMON.info.datapath = @"\\k4fs3201n\k4bpartcenter$"; using (var dbEnity = new EEEntitiesMain()) { diff --git a/Project/Dialog/fSelectDept.Designer.cs b/Project/Dialog/fSelectDept.Designer.cs index 973bac3..3490129 100644 --- a/Project/Dialog/fSelectDept.Designer.cs +++ b/Project/Dialog/fSelectDept.Designer.cs @@ -1,118 +1,118 @@ -namespace Project.Dialog -{ - partial class fSelectDept - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - FarPoint.Win.Spread.CellType.TextCellType textCellType1 = new FarPoint.Win.Spread.CellType.TextCellType(); - this.fpSpread1 = new FarPoint.Win.Spread.FpSpread(); - this.dsMSSQL = new Project.dsMSSQL(); - this.bs = new System.Windows.Forms.BindingSource(this.components); - this.ta = new Project.dsMSSQLTableAdapters.UserGroupTableAdapter(); - this.fpSpread1_Sheet1 = new FarPoint.Win.Spread.SheetView(); - ((System.ComponentModel.ISupportInitialize)(this.fpSpread1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.dsMSSQL)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.bs)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.fpSpread1_Sheet1)).BeginInit(); - this.SuspendLayout(); - // - // fpSpread1 - // - this.fpSpread1.Dock = System.Windows.Forms.DockStyle.Fill; - this.fpSpread1.Location = new System.Drawing.Point(0, 0); - this.fpSpread1.Name = "fpSpread1"; - this.fpSpread1.Sheets.AddRange(new FarPoint.Win.Spread.SheetView[] { - this.fpSpread1_Sheet1}); - this.fpSpread1.Size = new System.Drawing.Size(495, 562); - this.fpSpread1.TabIndex = 5; - // - // dsMSSQL - // - this.dsMSSQL.DataSetName = "dsMSSQL"; - this.dsMSSQL.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; - // - // bs - // - this.bs.DataMember = "UserGroup"; - this.bs.DataSource = this.dsMSSQL; - // - // ta - // - this.ta.ClearBeforeFill = true; - // - // fpSpread1_Sheet1 - // - this.fpSpread1_Sheet1.Reset(); - this.fpSpread1_Sheet1.SheetName = "Sheet1"; - // Formulas and custom names must be loaded with R1C1 reference style - this.fpSpread1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.R1C1; - this.fpSpread1_Sheet1.ColumnCount = 1; - this.fpSpread1_Sheet1.ActiveColumnIndex = -1; - this.fpSpread1_Sheet1.ActiveRowIndex = -1; - this.fpSpread1_Sheet1.AutoGenerateColumns = false; - this.fpSpread1_Sheet1.ColumnHeader.Cells.Get(0, 0).Value = "부서명"; - this.fpSpread1_Sheet1.ColumnHeader.Rows.Get(0).Height = 32F; - this.fpSpread1_Sheet1.Columns.Get(0).CellType = textCellType1; - this.fpSpread1_Sheet1.Columns.Get(0).DataField = "dept"; - this.fpSpread1_Sheet1.Columns.Get(0).Label = "부서명"; - this.fpSpread1_Sheet1.Columns.Get(0).Width = 413F; - this.fpSpread1_Sheet1.DataAutoSizeColumns = false; - this.fpSpread1_Sheet1.DataSource = this.bs; - this.fpSpread1_Sheet1.RowHeader.Columns.Default.Resizable = false; - this.fpSpread1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.A1; - // - // fSelectDept - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(495, 562); - this.Controls.Add(this.fpSpread1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "fSelectDept"; - this.Text = "부서목록"; - this.Load += new System.EventHandler(this.fSelectDept_Load); - ((System.ComponentModel.ISupportInitialize)(this.fpSpread1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.dsMSSQL)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.bs)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.fpSpread1_Sheet1)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private FarPoint.Win.Spread.FpSpread fpSpread1; - private dsMSSQL dsMSSQL; - private System.Windows.Forms.BindingSource bs; - private dsMSSQLTableAdapters.UserGroupTableAdapter ta; - private FarPoint.Win.Spread.SheetView fpSpread1_Sheet1; - - } +namespace Project.Dialog +{ + partial class fSelectDept + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + FarPoint.Win.Spread.CellType.TextCellType textCellType1 = new FarPoint.Win.Spread.CellType.TextCellType(); + this.fpSpread1 = new FarPoint.Win.Spread.FpSpread(); + this.dsMSSQL = new Project.dsMSSQL(); + this.bs = new System.Windows.Forms.BindingSource(this.components); + this.ta = new Project.dsMSSQLTableAdapters.UserGroupTableAdapter(); + this.fpSpread1_Sheet1 = new FarPoint.Win.Spread.SheetView(); + ((System.ComponentModel.ISupportInitialize)(this.fpSpread1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.dsMSSQL)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.bs)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.fpSpread1_Sheet1)).BeginInit(); + this.SuspendLayout(); + // + // fpSpread1 + // + this.fpSpread1.Dock = System.Windows.Forms.DockStyle.Fill; + this.fpSpread1.Location = new System.Drawing.Point(0, 0); + this.fpSpread1.Name = "fpSpread1"; + this.fpSpread1.Sheets.AddRange(new FarPoint.Win.Spread.SheetView[] { + this.fpSpread1_Sheet1}); + this.fpSpread1.Size = new System.Drawing.Size(495, 562); + this.fpSpread1.TabIndex = 5; + // + // dsMSSQL + // + this.dsMSSQL.DataSetName = "dsMSSQL"; + this.dsMSSQL.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; + // + // bs + // + this.bs.DataMember = "UserGroup"; + this.bs.DataSource = this.dsMSSQL; + // + // ta + // + this.ta.ClearBeforeFill = true; + // + // fpSpread1_Sheet1 + // + this.fpSpread1_Sheet1.Reset(); + this.fpSpread1_Sheet1.SheetName = "Sheet1"; + // Formulas and custom names must be loaded with R1C1 reference style + this.fpSpread1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.R1C1; + this.fpSpread1_Sheet1.ColumnCount = 1; + this.fpSpread1_Sheet1.ActiveColumnIndex = -1; + this.fpSpread1_Sheet1.ActiveRowIndex = -1; + this.fpSpread1_Sheet1.AutoGenerateColumns = false; + this.fpSpread1_Sheet1.ColumnHeader.Cells.Get(0, 0).Value = "부서명"; + this.fpSpread1_Sheet1.ColumnHeader.Rows.Get(0).Height = 32F; + this.fpSpread1_Sheet1.Columns.Get(0).CellType = textCellType1; + this.fpSpread1_Sheet1.Columns.Get(0).DataField = "dept"; + this.fpSpread1_Sheet1.Columns.Get(0).Label = "부서명"; + this.fpSpread1_Sheet1.Columns.Get(0).Width = 413F; + this.fpSpread1_Sheet1.DataAutoSizeColumns = false; + this.fpSpread1_Sheet1.DataSource = this.bs; + this.fpSpread1_Sheet1.RowHeader.Columns.Default.Resizable = false; + this.fpSpread1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.A1; + // + // fSelectDept + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(495, 562); + this.Controls.Add(this.fpSpread1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "fSelectDept"; + this.Text = "부서목록"; + this.Load += new System.EventHandler(this.fSelectDept_Load); + ((System.ComponentModel.ISupportInitialize)(this.fpSpread1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.dsMSSQL)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.bs)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.fpSpread1_Sheet1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private FarPoint.Win.Spread.FpSpread fpSpread1; + private dsMSSQL dsMSSQL; + private System.Windows.Forms.BindingSource bs; + private dsMSSQLTableAdapters.UserGroupTableAdapter ta; + private FarPoint.Win.Spread.SheetView fpSpread1_Sheet1; + + } } \ No newline at end of file diff --git a/Project/Dialog/fSelectDept.cs b/Project/Dialog/fSelectDept.cs index 5e1ccf7..e1b8f07 100644 --- a/Project/Dialog/fSelectDept.cs +++ b/Project/Dialog/fSelectDept.cs @@ -1,40 +1,40 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace Project.Dialog -{ - public partial class fSelectDept : FCOMMON.fBase - { - public string deptName { get; set; } - public fSelectDept() - { - InitializeComponent(); - deptName = string.Empty; - this.fpSpread1.KeyDown += (s1, e1) => { SelectData(); }; - this.fpSpread1.CellDoubleClick += (s1, e1) => { SelectData(); }; - } - - private void fSelectDept_Load(object sender, EventArgs e) - { - // TODO: 이 코드는 데이터를 'dsMSSQL.UserGroup' 테이블에 로드합니다. 필요한 경우 이 코드를 이동하거나 제거할 수 있습니다. - this.ta.Fill(this.dsMSSQL.UserGroup); - var ta = new dsMSSQLTableAdapters.UserGroupTableAdapter(); - - } - void SelectData() - { - var drv = this.bs.Current as DataRowView; - if (drv == null) return; - var dr = drv.Row as dsMSSQL.UserGroupRow; - this.deptName = dr.dept; - this.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.Threading.Tasks; +using System.Windows.Forms; + +namespace Project.Dialog +{ + public partial class fSelectDept : FCOMMON.fBase + { + public string deptName { get; set; } + public fSelectDept() + { + InitializeComponent(); + deptName = string.Empty; + this.fpSpread1.KeyDown += (s1, e1) => { SelectData(); }; + this.fpSpread1.CellDoubleClick += (s1, e1) => { SelectData(); }; + } + + private void fSelectDept_Load(object sender, EventArgs e) + { + // TODO: 이 코드는 데이터를 'dsMSSQL.UserGroup' 테이블에 로드합니다. 필요한 경우 이 코드를 이동하거나 제거할 수 있습니다. + this.ta.Fill(this.dsMSSQL.UserGroup); + var ta = new dsMSSQLTableAdapters.UserGroupTableAdapter(); + + } + void SelectData() + { + var drv = this.bs.Current as DataRowView; + if (drv == null) return; + var dr = drv.Row as dsMSSQL.UserGroupRow; + this.deptName = dr.dept; + this.DialogResult = System.Windows.Forms.DialogResult.OK; + } + } +} diff --git a/Project/DsPMPDatabase.xsd b/Project/DsPMPDatabase.xsd index 255a338..c87730f 100644 --- a/Project/DsPMPDatabase.xsd +++ b/Project/DsPMPDatabase.xsd @@ -4,7 +4,7 @@ - + @@ -195,7 +195,7 @@ FROM SPMaster - + diff --git a/Project/EETGW.csproj b/Project/EETGW.csproj index 12aebfb..f535649 100644 --- a/Project/EETGW.csproj +++ b/Project/EETGW.csproj @@ -161,8 +161,14 @@ ..\DLL\libxl.net.dll - - ..\packages\Microsoft.Owin.4.1.1\lib\net45\Microsoft.Owin.dll + + ..\packages\Microsoft.Owin.4.2.0\lib\net45\Microsoft.Owin.dll + + + ..\packages\Microsoft.Owin.Cors.4.2.0\lib\net45\Microsoft.Owin.Cors.dll + + + ..\packages\Microsoft.Owin.FileSystems.4.2.0\lib\net45\Microsoft.Owin.FileSystems.dll ..\packages\Microsoft.Owin.Host.HttpListener.4.1.1\lib\net45\Microsoft.Owin.Host.HttpListener.dll @@ -170,6 +176,9 @@ ..\packages\Microsoft.Owin.Hosting.4.1.1\lib\net45\Microsoft.Owin.Hosting.dll + + ..\packages\Microsoft.Owin.StaticFiles.4.2.0\lib\net45\Microsoft.Owin.StaticFiles.dll + ..\packages\Microsoft.SqlServer.Types.14.0.314.76\lib\net40\Microsoft.SqlServer.Types.dll @@ -207,6 +216,9 @@ ..\packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll + + ..\packages\Microsoft.AspNet.Cors.5.0.0\lib\net45\System.Web.Cors.dll + ..\packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll diff --git a/Project/EETGW_ProjectsSchedule.cs b/Project/EETGW_ProjectsSchedule.cs index 3fbeaeb..25b150a 100644 --- a/Project/EETGW_ProjectsSchedule.cs +++ b/Project/EETGW_ProjectsSchedule.cs @@ -17,6 +17,7 @@ namespace Project public int idx { get; set; } public string gcode { get; set; } public Nullable project { get; set; } + public Nullable no { get; set; } public Nullable seq { get; set; } public string title { get; set; } public Nullable sw { get; set; } @@ -25,6 +26,7 @@ namespace Project public Nullable ewa { get; set; } public string uid { get; set; } public string memo { get; set; } + public Nullable appoval { get; set; } public Nullable progress { get; set; } public string wuid { get; set; } public System.DateTime wdate { get; set; } diff --git a/Project/ModelProject.Context.cs b/Project/ModelProject.Context.cs index 597f0cb..811ae11 100644 --- a/Project/ModelProject.Context.cs +++ b/Project/ModelProject.Context.cs @@ -26,12 +26,12 @@ namespace Project } public virtual DbSet EETGW_ProjecthistoryD { get; set; } - public virtual DbSet EETGW_ProjectsSchedule { get; set; } public virtual DbSet EETGW_ProjectToDo { get; set; } public virtual DbSet Projects { get; set; } public virtual DbSet ProjectsHistory { get; set; } public virtual DbSet ProjectsIOMap { get; set; } public virtual DbSet ProjectsMailList { get; set; } public virtual DbSet ProjectsPart { get; set; } + public virtual DbSet EETGW_ProjectsSchedule { get; set; } } } diff --git a/Project/ModelProject.edmx b/Project/ModelProject.edmx index 476dab6..845c64b 100644 --- a/Project/ModelProject.edmx +++ b/Project/ModelProject.edmx @@ -4,7 +4,7 @@ - + @@ -26,6 +26,7 @@ + @@ -34,6 +35,7 @@ + @@ -202,8 +204,7 @@ - - + @@ -221,25 +222,6 @@ - - - - - - - - - - - - - - - - - - - @@ -396,14 +378,35 @@ - + + + + + + + + + + + + + + + + + + + + + + @@ -425,26 +428,6 @@ - - - - - - - - - - - - - - - - - - - - @@ -605,6 +588,28 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/Project/ModelProject.edmx.diagram b/Project/ModelProject.edmx.diagram index ff05026..c07ab3c 100644 --- a/Project/ModelProject.edmx.diagram +++ b/Project/ModelProject.edmx.diagram @@ -6,13 +6,13 @@ - + diff --git a/Project/OWIN/Startup.cs b/Project/OWIN/Startup.cs index 1ee63ab..ad5f2a0 100644 --- a/Project/OWIN/Startup.cs +++ b/Project/OWIN/Startup.cs @@ -44,6 +44,9 @@ namespace Project.OWIN config.Routes.Add("icoRoute", icoRoute); config.Routes.Add("cssRoute", cssRoute); config.Routes.Add("defaultRoute", defaultRoute); + + appBuilder.UseStaticFiles(); + appBuilder.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll); appBuilder.UseWebApi(config); diff --git a/Project/Properties/AssemblyInfo.cs b/Project/Properties/AssemblyInfo.cs index d7c2d04..498a69d 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.05.22.1350")] -[assembly: AssemblyFileVersion("21.05.22.1350")] +[assembly: AssemblyVersion("21.05.25.1500")] +[assembly: AssemblyFileVersion("21.05.25.1500")] diff --git a/Project/Setting.cs b/Project/Setting.cs index c9fbd8b..7d162be 100644 --- a/Project/Setting.cs +++ b/Project/Setting.cs @@ -53,6 +53,8 @@ namespace Project [Description("Full Screen Window")] public Boolean FullScreen { get; set; } + public string SharedDataPath { get; set; } + [Category("Barcode"), DisplayName("Port Name")] public string Barcode { get; set; } @@ -68,6 +70,8 @@ namespace Project public Setting() : this(Util.CurrentPath + "setting.xml") {} + + public Setting(string file) { this.filename = file; diff --git a/Project/_Common/fNewID.cs b/Project/_Common/fNewID.cs index fcda963..31d56fb 100644 --- a/Project/_Common/fNewID.cs +++ b/Project/_Common/fNewID.cs @@ -1,44 +1,44 @@ -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 Project._Common -{ - public partial class fNewID : Form - { - public fNewID(string userid) - { - InitializeComponent(); - this.tbIDO.Text = userid; - } - - private void fNewPassword_Load(object sender, EventArgs e) - { - - } - - private void button1_Click(object sender, EventArgs e) - { - if (tbIDN.Text.isEmpty()) - { - Util.MsgE("Enter New ID"); - tbIDN.Focus(); - return; - } - - if (tbIDN.Text == tbIDO.Text) - { - Util.MsgE("Same ID"); - tbIDN.Focus(); - tbIDN.SelectAll(); - return; - } - 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 Project._Common +{ + public partial class fNewID : Form + { + public fNewID(string userid) + { + InitializeComponent(); + this.tbIDO.Text = userid; + } + + private void fNewPassword_Load(object sender, EventArgs e) + { + + } + + private void button1_Click(object sender, EventArgs e) + { + if (tbIDN.Text.isEmpty()) + { + Util.MsgE("Enter New ID"); + tbIDN.Focus(); + return; + } + + if (tbIDN.Text == tbIDO.Text) + { + Util.MsgE("Same ID"); + tbIDN.Focus(); + tbIDN.SelectAll(); + return; + } + DialogResult = System.Windows.Forms.DialogResult.OK; + } + } +} diff --git a/Project/_Common/fNewPassword.cs b/Project/_Common/fNewPassword.cs index 5fa300c..22830a9 100644 --- a/Project/_Common/fNewPassword.cs +++ b/Project/_Common/fNewPassword.cs @@ -1,55 +1,55 @@ -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 Project._Common -{ - public partial class fNewPassword : Form - { - public fNewPassword(string userid) - { - InitializeComponent(); - this.tbUserID.Text = userid; - } - - private void fNewPassword_Load(object sender, EventArgs e) - { - - } - - private void button1_Click(object sender, EventArgs e) - { - if(tbPassO.Text.isEmpty()) - { - Util.MsgE("OLd Password Error"); - tbPassO.Focus(); - return; - } - if(tbPass1.Text.isEmpty()) - { - Util.MsgE("NEW Password Error"); - tbPass1.Focus(); - return; - } - if(tbPass2.Text.isEmpty()) - { - Util.MsgE("New Password Verify Error"); - tbPass2.Focus(); - return; - } - if(tbPass2.Text != tbPass1.Text) - { - Util.MsgE("Password is not Same"); - tbPass2.Focus(); - tbPass2.SelectAll(); - return; - } - 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 Project._Common +{ + public partial class fNewPassword : Form + { + public fNewPassword(string userid) + { + InitializeComponent(); + this.tbUserID.Text = userid; + } + + private void fNewPassword_Load(object sender, EventArgs e) + { + + } + + private void button1_Click(object sender, EventArgs e) + { + if(tbPassO.Text.isEmpty()) + { + Util.MsgE("OLd Password Error"); + tbPassO.Focus(); + return; + } + if(tbPass1.Text.isEmpty()) + { + Util.MsgE("NEW Password Error"); + tbPass1.Focus(); + return; + } + if(tbPass2.Text.isEmpty()) + { + Util.MsgE("New Password Verify Error"); + tbPass2.Focus(); + return; + } + if(tbPass2.Text != tbPass1.Text) + { + Util.MsgE("Password is not Same"); + tbPass2.Focus(); + tbPass2.SelectAll(); + return; + } + DialogResult = System.Windows.Forms.DialogResult.OK; + } + } +} diff --git a/Project/app.config b/Project/app.config index ce344b0..60bf705 100644 --- a/Project/app.config +++ b/Project/app.config @@ -30,7 +30,7 @@ - + diff --git a/Project/dsAccess.xsd b/Project/dsAccess.xsd index faa18a9..e70437b 100644 --- a/Project/dsAccess.xsd +++ b/Project/dsAccess.xsd @@ -4,7 +4,7 @@ - + @@ -79,7 +79,7 @@ and isnull(PersonUser2,'') = @dept - + @@ -92,7 +92,7 @@ and isnull(PersonUser2,'') = @dept - + diff --git a/Project/dsMSSQL.xsd b/Project/dsMSSQL.xsd index e99d099..c03a108 100644 --- a/Project/dsMSSQL.xsd +++ b/Project/dsMSSQL.xsd @@ -4,7 +4,7 @@ - + @@ -122,1788 +122,4 @@ SELECT id, password, nameE, name, dept, grade, email, level, indate, outdate, te - - - - SELECT COUNT(*) FROM Users where id = @userid - - - - - - - - - - SELECT id, password, nameE, name, dept, grade, email, level, indate, outdate, tel, hp, place, ads_employNo, ads_title, ads_created, memo, wuid, wdate, processs, gcode -FROM Users -WHERE (name = @username) AND (password = @encpw) - - - - - - - - - - - SELECT id, password, nameE, name, dept, grade, email, level, indate, outdate, tel, hp, place, ads_employNo, ads_title, ads_created, memo, wuid, wdate, processs, gcode -FROM Users -WHERE (id = @id) -ORDER BY name - - - - - - - - - - SELECT ads_created, ads_employNo, ads_title, dept, email, grade, hp, id, indate, level, memo, name, nameE, outdate, password, place, tel, wdate, wuid, processs, gcode -FROM Users -WHERE (password = @encpw) AND (level > 0) AND (email = @idkey) OR - (password = @encpw) AND (level > 0) AND (id = @idkey) OR - (password = @encpw) AND (level > 0) AND (email = { fn CONCAT(@idkey, '@amkor.co.kr') }) - - - - - - - - - - - INSERT INTO Users - (id, password, nameE, name, dept, email, level, tel, ads_employNo, ads_title, ads_created, memo, wuid, wdate) -VALUES (@id, 'B6589FC6AB0DC82CF12099D1C2D40AB994E8410C',@nameE,@name,@dept,@email, 0,@tel,@ads_employNo,@ads_title,@ads_created,@memo,@wuid,@wdate); -SELECT id, password, nameE, name, dept, grade, email, level, indate, outdate, tel, hp, place, ads_employNo, ads_title, ads_created, memo, wuid, wdate FROM Users WHERE (id = @id) ORDER BY name - - - - - - - - - - - - - - - - - - - - - UPDATE Users -SET dept = @dept,name=@name,ads_title=@title -WHERE (id = @Original_id); - - - - - - - - - - - - - - - - - DELETE FROM [Projects] WHERE (([idx] = @Original_idx) AND ((@IsNull_name = 1 AND [name] IS NULL) OR ([name] = @Original_name)) AND ((@IsNull_pdate = 1 AND [pdate] IS NULL) OR ([pdate] = @Original_pdate)) AND ((@IsNull_request = 1 AND [request] IS NULL) OR ([request] = @Original_request)) AND ((@IsNull_reqstaff = 1 AND [reqstaff] IS NULL) OR ([reqstaff] = @Original_reqstaff)) AND ((@IsNull_sdate = 1 AND [sdate] IS NULL) OR ([sdate] = @Original_sdate)) AND ((@IsNull_edate = 1 AND [edate] IS NULL) OR ([edate] = @Original_edate)) AND ((@IsNull_odate = 1 AND [odate] IS NULL) OR ([odate] = @Original_odate)) AND ((@IsNull_memo = 1 AND [memo] IS NULL) OR ([memo] = @Original_memo)) AND ([wuid] = @Original_wuid) AND ([wdate] = @Original_wdate)) - - - - - - - - - - - - - - - - - - - - - - - - - - INSERT INTO [Projects] ([name], [pdate], [request], [reqstaff], [sdate], [edate], [odate], [memo], [wuid], [wdate]) VALUES (@name, @pdate, @request, @reqstaff, @sdate, @edate, @odate, @memo, @wuid, @wdate); -SELECT idx, name, pdate, request, reqstaff, sdate, edate, odate, memo, wuid, wdate FROM Projects WHERE (idx = SCOPE_IDENTITY()) - - - - - - - - - - - - - - - - - SELECT Projects.* -FROM Projects - - - - - - UPDATE [Projects] SET [name] = @name, [pdate] = @pdate, [request] = @request, [reqstaff] = @reqstaff, [sdate] = @sdate, [edate] = @edate, [odate] = @odate, [memo] = @memo, [wuid] = @wuid, [wdate] = @wdate WHERE (([idx] = @Original_idx) AND ((@IsNull_name = 1 AND [name] IS NULL) OR ([name] = @Original_name)) AND ((@IsNull_pdate = 1 AND [pdate] IS NULL) OR ([pdate] = @Original_pdate)) AND ((@IsNull_request = 1 AND [request] IS NULL) OR ([request] = @Original_request)) AND ((@IsNull_reqstaff = 1 AND [reqstaff] IS NULL) OR ([reqstaff] = @Original_reqstaff)) AND ((@IsNull_sdate = 1 AND [sdate] IS NULL) OR ([sdate] = @Original_sdate)) AND ((@IsNull_edate = 1 AND [edate] IS NULL) OR ([edate] = @Original_edate)) AND ((@IsNull_odate = 1 AND [odate] IS NULL) OR ([odate] = @Original_odate)) AND ((@IsNull_memo = 1 AND [memo] IS NULL) OR ([memo] = @Original_memo)) AND ([wuid] = @Original_wuid) AND ([wdate] = @Original_wdate)); -SELECT idx, name, pdate, request, reqstaff, sdate, edate, odate, memo, wuid, wdate FROM Projects WHERE (idx = @idx) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DELETE FROM [Items] WHERE (([idx] = @Original_idx) AND ((@IsNull_name = 1 AND [name] IS NULL) OR ([name] = @Original_name)) AND ((@IsNull_sid = 1 AND [sid] IS NULL) OR ([sid] = @Original_sid)) AND ((@IsNull_model = 1 AND [model] IS NULL) OR ([model] = @Original_model)) AND ((@IsNull_manu = 1 AND [manu] IS NULL) OR ([manu] = @Original_manu)) AND ((@IsNull_supply = 1 AND [supply] IS NULL) OR ([supply] = @Original_supply)) AND ((@IsNull_price = 1 AND [price] IS NULL) OR ([price] = @Original_price)) AND ((@IsNull_memo = 1 AND [memo] IS NULL) OR ([memo] = @Original_memo)) AND ([wuid] = @Original_wuid) AND ([wdate] = @Original_wdate)) - - - - - - - - - - - - - - - - - - - - - - - - INSERT INTO [Items] ([name], [sid], [model], [manu], [supply], [price], [memo], [wuid], [wdate]) VALUES (@name, @sid, @model, @manu, @supply, @price, @memo, @wuid, @wdate); -SELECT idx, name, sid, model, manu, supply, price, memo, wuid, wdate FROM Items WHERE (idx = SCOPE_IDENTITY()) - - - - - - - - - - - - - - - - SELECT idx, name, sid, model, manu, supply, price, memo, wuid, wdate -FROM Items - - - - - - UPDATE [Items] SET [name] = @name, [sid] = @sid, [model] = @model, [manu] = @manu, [supply] = @supply, [price] = @price, [memo] = @memo, [wuid] = @wuid, [wdate] = @wdate WHERE (([idx] = @Original_idx) AND ((@IsNull_name = 1 AND [name] IS NULL) OR ([name] = @Original_name)) AND ((@IsNull_sid = 1 AND [sid] IS NULL) OR ([sid] = @Original_sid)) AND ((@IsNull_model = 1 AND [model] IS NULL) OR ([model] = @Original_model)) AND ((@IsNull_manu = 1 AND [manu] IS NULL) OR ([manu] = @Original_manu)) AND ((@IsNull_supply = 1 AND [supply] IS NULL) OR ([supply] = @Original_supply)) AND ((@IsNull_price = 1 AND [price] IS NULL) OR ([price] = @Original_price)) AND ((@IsNull_memo = 1 AND [memo] IS NULL) OR ([memo] = @Original_memo)) AND ([wuid] = @Original_wuid) AND ([wdate] = @Original_wdate)); -SELECT idx, name, sid, model, manu, supply, price, memo, wuid, wdate FROM Items WHERE (idx = @idx) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DELETE FROM [Inventory] WHERE (([idx] = @Original_idx) AND ((@IsNull_pdate = 1 AND [pdate] IS NULL) OR ([pdate] = @Original_pdate)) AND ((@IsNull_uid = 1 AND [uid] IS NULL) OR ([uid] = @Original_uid)) AND ((@IsNull_item = 1 AND [item] IS NULL) OR ([item] = @Original_item)) AND ((@IsNull_serial = 1 AND [serial] IS NULL) OR ([serial] = @Original_serial)) AND ((@IsNull_dr_qty = 1 AND [dr_qty] IS NULL) OR ([dr_qty] = @Original_dr_qty)) AND ((@IsNull_dr_amt = 1 AND [dr_amt] IS NULL) OR ([dr_amt] = @Original_dr_amt)) AND ((@IsNull_cr_qty = 1 AND [cr_qty] IS NULL) OR ([cr_qty] = @Original_cr_qty)) AND ((@IsNull_cr_amt = 1 AND [cr_amt] IS NULL) OR ([cr_amt] = @Original_cr_amt)) AND ((@IsNull_memo = 1 AND [memo] IS NULL) OR ([memo] = @Original_memo)) AND ((@IsNull_project = 1 AND [project] IS NULL) OR ([project] = @Original_project)) AND ([wuid] = @Original_wuid) AND ([wdate] = @Original_wdate) AND ((@IsNull_invtype = 1 AND [invtype] IS NULL) OR ([invtype] = @Original_invtype)) AND ((@IsNull_ItemName = 1 AND [ItemName] IS NULL) OR ([ItemName] = @Original_ItemName)) AND ((@IsNull_projectName = 1 AND [projectName] IS NULL) OR ([projectName] = @Original_projectName))) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - INSERT INTO [Inventory] ([pdate], [uid], [item], [serial], [dr_qty], [dr_amt], [cr_qty], [cr_amt], [memo], [project], [wuid], [wdate], [invtype], [ItemName], [projectName]) VALUES (@pdate, @uid, @item, @serial, @dr_qty, @dr_amt, @cr_qty, @cr_amt, @memo, @project, @wuid, @wdate, @invtype, @ItemName, @projectName); -SELECT idx, pdate, uid, item, serial, dr_qty, dr_amt, cr_qty, cr_amt, memo, project, wuid, wdate, invtype, ItemName, projectName FROM Inventory WHERE (idx = SCOPE_IDENTITY()) ORDER BY pdate - - - - - - - - - - - - - - - - - - - - - - SELECT idx, pdate, uid, item, serial, dr_qty, dr_amt, cr_qty, cr_amt, memo, project, wuid, wdate, invtype, ItemName, projectName -FROM Inventory -ORDER BY pdate - - - - - - UPDATE [Inventory] SET [pdate] = @pdate, [uid] = @uid, [item] = @item, [serial] = @serial, [dr_qty] = @dr_qty, [dr_amt] = @dr_amt, [cr_qty] = @cr_qty, [cr_amt] = @cr_amt, [memo] = @memo, [project] = @project, [wuid] = @wuid, [wdate] = @wdate, [invtype] = @invtype, [ItemName] = @ItemName, [projectName] = @projectName WHERE (([idx] = @Original_idx) AND ((@IsNull_pdate = 1 AND [pdate] IS NULL) OR ([pdate] = @Original_pdate)) AND ((@IsNull_uid = 1 AND [uid] IS NULL) OR ([uid] = @Original_uid)) AND ((@IsNull_item = 1 AND [item] IS NULL) OR ([item] = @Original_item)) AND ((@IsNull_serial = 1 AND [serial] IS NULL) OR ([serial] = @Original_serial)) AND ((@IsNull_dr_qty = 1 AND [dr_qty] IS NULL) OR ([dr_qty] = @Original_dr_qty)) AND ((@IsNull_dr_amt = 1 AND [dr_amt] IS NULL) OR ([dr_amt] = @Original_dr_amt)) AND ((@IsNull_cr_qty = 1 AND [cr_qty] IS NULL) OR ([cr_qty] = @Original_cr_qty)) AND ((@IsNull_cr_amt = 1 AND [cr_amt] IS NULL) OR ([cr_amt] = @Original_cr_amt)) AND ((@IsNull_memo = 1 AND [memo] IS NULL) OR ([memo] = @Original_memo)) AND ((@IsNull_project = 1 AND [project] IS NULL) OR ([project] = @Original_project)) AND ([wuid] = @Original_wuid) AND ([wdate] = @Original_wdate) AND ((@IsNull_invtype = 1 AND [invtype] IS NULL) OR ([invtype] = @Original_invtype)) AND ((@IsNull_ItemName = 1 AND [ItemName] IS NULL) OR ([ItemName] = @Original_ItemName)) AND ((@IsNull_projectName = 1 AND [projectName] IS NULL) OR ([projectName] = @Original_projectName))); -SELECT idx, pdate, uid, item, serial, dr_qty, dr_amt, cr_qty, cr_amt, memo, project, wuid, wdate, invtype, ItemName, projectName FROM Inventory WHERE (idx = @idx) ORDER BY pdate - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SELECT ItemName, cr_amt, cr_qty, dr_amt, dr_qty, idx, invtype, item, memo, pdate, project, projectName, serial, uid, wdate, wuid -FROM Inventory -WHERE (pdate BETWEEN @sd AND @ed) AND (uid = @uid) -ORDER BY pdate - - - - - - - - - - - - - - - - DELETE FROM [LineCode] WHERE (([idx] = @Original_idx) AND ((@IsNull_code = 1 AND [code] IS NULL) OR ([code] = @Original_code)) AND ((@IsNull_team = 1 AND [team] IS NULL) OR ([team] = @Original_team)) AND ((@IsNull_part = 1 AND [part] IS NULL) OR ([part] = @Original_part)) AND ((@IsNull_except = 1 AND [except] IS NULL) OR ([except] = @Original_except)) AND ((@IsNull_memo = 1 AND [memo] IS NULL) OR ([memo] = @Original_memo)) AND ([wuid] = @Original_wuid) AND ([wdate] = @Original_wdate) AND ((@IsNull_plant = 1 AND [plant] IS NULL) OR ([plant] = @Original_plant)) AND ((@IsNull_grp2 = 1 AND [grp2] IS NULL) OR ([grp2] = @Original_grp2))) - - - - - - - - - - - - - - - - - - - - - - - - INSERT INTO [LineCode] ([code], [team], [part], [except], [memo], [wuid], [wdate], [plant], [grp2]) VALUES (@code, @team, @part, @except, @memo, @wuid, @wdate, @plant, @grp2); -SELECT idx, code, team, part, [except], memo, wuid, wdate, plant, grp2 FROM LineCode WHERE (idx = SCOPE_IDENTITY()) - - - - - - - - - - - - - - - - SELECT idx, code, team, part, [except], memo, wuid, wdate, plant, grp2 -FROM LineCode - - - - - - UPDATE [LineCode] SET [code] = @code, [team] = @team, [part] = @part, [except] = @except, [memo] = @memo, [wuid] = @wuid, [wdate] = @wdate, [plant] = @plant, [grp2] = @grp2 WHERE (([idx] = @Original_idx) AND ((@IsNull_code = 1 AND [code] IS NULL) OR ([code] = @Original_code)) AND ((@IsNull_team = 1 AND [team] IS NULL) OR ([team] = @Original_team)) AND ((@IsNull_part = 1 AND [part] IS NULL) OR ([part] = @Original_part)) AND ((@IsNull_except = 1 AND [except] IS NULL) OR ([except] = @Original_except)) AND ((@IsNull_memo = 1 AND [memo] IS NULL) OR ([memo] = @Original_memo)) AND ([wuid] = @Original_wuid) AND ([wdate] = @Original_wdate) AND ((@IsNull_plant = 1 AND [plant] IS NULL) OR ([plant] = @Original_plant)) AND ((@IsNull_grp2 = 1 AND [grp2] IS NULL) OR ([grp2] = @Original_grp2))); -SELECT idx, code, team, part, [except], memo, wuid, wdate, plant, grp2 FROM LineCode WHERE (idx = @idx) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DELETE FROM [UserGroup] WHERE (([dept] = @Original_dept) AND ((@IsNull_gcode = 1 AND [gcode] IS NULL) OR ([gcode] = @Original_gcode)) AND ((@IsNull_path_kj = 1 AND [path_kj] IS NULL) OR ([path_kj] = @Original_path_kj)) AND ((@IsNull_advpurchase = 1 AND [advpurchase] IS NULL) OR ([advpurchase] = @Original_advpurchase)) AND ((@IsNull_permission = 1 AND [permission] IS NULL) OR ([permission] = @Original_permission))) - - - - - - - - - - - - - - - - INSERT INTO [UserGroup] ([dept], [gcode], [path_kj], [advpurchase], [permission]) VALUES (@dept, @gcode, @path_kj, @advpurchase, @permission); -SELECT dept, gcode, path_kj, advpurchase, permission FROM UserGroup WHERE (dept = @dept) - - - - - - - - - - - - SELECT dept, gcode, path_kj, advpurchase, permission -FROM UserGroup -WHERE (ISNULL(gcode, '') <> '') AND (ISNULL(permission, 0) > 0) - - - - - - UPDATE [UserGroup] SET [dept] = @dept, [gcode] = @gcode, [path_kj] = @path_kj, [advpurchase] = @advpurchase, [permission] = @permission WHERE (([dept] = @Original_dept) AND ((@IsNull_gcode = 1 AND [gcode] IS NULL) OR ([gcode] = @Original_gcode)) AND ((@IsNull_path_kj = 1 AND [path_kj] IS NULL) OR ([path_kj] = @Original_path_kj)) AND ((@IsNull_advpurchase = 1 AND [advpurchase] IS NULL) OR ([advpurchase] = @Original_advpurchase)) AND ((@IsNull_permission = 1 AND [permission] IS NULL) OR ([permission] = @Original_permission))); -SELECT dept, gcode, path_kj, advpurchase, permission FROM UserGroup WHERE (dept = @dept) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DELETE FROM [SPMaster] WHERE (([ID] = @Original_ID) AND ((@IsNull_CtrlNo = 1 AND [CtrlNo] IS NULL) OR ([CtrlNo] = @Original_CtrlNo)) AND ((@IsNull_SIDNo = 1 AND [SIDNo] IS NULL) OR ([SIDNo] = @Original_SIDNo)) AND ((@IsNull_Storage = 1 AND [Storage] IS NULL) OR ([Storage] = @Original_Storage)) AND ((@IsNull_Location = 1 AND [Location] IS NULL) OR ([Location] = @Original_Location)) AND ((@IsNull_UseEqmt = 1 AND [UseEqmt] IS NULL) OR ([UseEqmt] = @Original_UseEqmt)) AND ((@IsNull_PartName = 1 AND [PartName] IS NULL) OR ([PartName] = @Original_PartName)) AND ((@IsNull_PartNo = 1 AND [PartNo] IS NULL) OR ([PartNo] = @Original_PartNo)) AND ((@IsNull_Process = 1 AND [Process] IS NULL) OR ([Process] = @Original_Process)) AND ((@IsNull_SupplierNo = 1 AND [SupplierNo] IS NULL) OR ([SupplierNo] = @Original_SupplierNo)) AND ((@IsNull_CurrentQty = 1 AND [CurrentQty] IS NULL) OR ([CurrentQty] = @Original_CurrentQty)) AND ((@IsNull_MHA = 1 AND [MHA] IS NULL) OR ([MHA] = @Original_MHA)) AND ((@IsNull_Division = 1 AND [Division] IS NULL) OR ([Division] = @Original_Division)) AND ((@IsNull_BadQty = 1 AND [BadQty] IS NULL) OR ([BadQty] = @Original_BadQty)) AND ((@IsNull_Price = 1 AND [Price] IS NULL) OR ([Price] = @Original_Price)) AND ((@IsNull_PriceUnit = 1 AND [PriceUnit] IS NULL) OR ([PriceUnit] = @Original_PriceUnit)) AND ((@IsNull_CostCenter = 1 AND [CostCenter] IS NULL) OR ([CostCenter] = @Original_CostCenter)) AND ((@IsNull_Memo = 1 AND [Memo] IS NULL) OR ([Memo] = @Original_Memo)) AND ((@IsNull_EnrDate = 1 AND [EnrDate] IS NULL) OR ([EnrDate] = @Original_EnrDate)) AND ((@IsNull_Enrollee = 1 AND [Enrollee] IS NULL) OR ([Enrollee] = @Original_Enrollee))) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - INSERT INTO [SPMaster] ([ID], [CtrlNo], [SIDNo], [Storage], [Location], [UseEqmt], [PartName], [PartNo], [Process], [SupplierNo], [CurrentQty], [MHA], [Division], [BadQty], [Price], [PriceUnit], [CostCenter], [Memo], [EnrDate], [Enrollee]) VALUES (@ID, @CtrlNo, @SIDNo, @Storage, @Location, @UseEqmt, @PartName, @PartNo, @Process, @SupplierNo, @CurrentQty, @MHA, @Division, @BadQty, @Price, @PriceUnit, @CostCenter, @Memo, @EnrDate, @Enrollee); -SELECT ID, CtrlNo, SIDNo, Storage, Location, UseEqmt, PartName, PartNo, Process, SupplierNo, CurrentQty, MHA, Division, BadQty, Price, PriceUnit, CostCenter, Memo, EnrDate, Enrollee FROM SPMaster WHERE (ID = @ID) - - - - - - - - - - - - - - - - - - - - - - - - - - - SELECT SPMaster.* -FROM SPMaster - - - - - - UPDATE [SPMaster] SET [ID] = @ID, [CtrlNo] = @CtrlNo, [SIDNo] = @SIDNo, [Storage] = @Storage, [Location] = @Location, [UseEqmt] = @UseEqmt, [PartName] = @PartName, [PartNo] = @PartNo, [Process] = @Process, [SupplierNo] = @SupplierNo, [CurrentQty] = @CurrentQty, [MHA] = @MHA, [Division] = @Division, [BadQty] = @BadQty, [Price] = @Price, [PriceUnit] = @PriceUnit, [CostCenter] = @CostCenter, [Memo] = @Memo, [EnrDate] = @EnrDate, [Enrollee] = @Enrollee WHERE (([ID] = @Original_ID) AND ((@IsNull_CtrlNo = 1 AND [CtrlNo] IS NULL) OR ([CtrlNo] = @Original_CtrlNo)) AND ((@IsNull_SIDNo = 1 AND [SIDNo] IS NULL) OR ([SIDNo] = @Original_SIDNo)) AND ((@IsNull_Storage = 1 AND [Storage] IS NULL) OR ([Storage] = @Original_Storage)) AND ((@IsNull_Location = 1 AND [Location] IS NULL) OR ([Location] = @Original_Location)) AND ((@IsNull_UseEqmt = 1 AND [UseEqmt] IS NULL) OR ([UseEqmt] = @Original_UseEqmt)) AND ((@IsNull_PartName = 1 AND [PartName] IS NULL) OR ([PartName] = @Original_PartName)) AND ((@IsNull_PartNo = 1 AND [PartNo] IS NULL) OR ([PartNo] = @Original_PartNo)) AND ((@IsNull_Process = 1 AND [Process] IS NULL) OR ([Process] = @Original_Process)) AND ((@IsNull_SupplierNo = 1 AND [SupplierNo] IS NULL) OR ([SupplierNo] = @Original_SupplierNo)) AND ((@IsNull_CurrentQty = 1 AND [CurrentQty] IS NULL) OR ([CurrentQty] = @Original_CurrentQty)) AND ((@IsNull_MHA = 1 AND [MHA] IS NULL) OR ([MHA] = @Original_MHA)) AND ((@IsNull_Division = 1 AND [Division] IS NULL) OR ([Division] = @Original_Division)) AND ((@IsNull_BadQty = 1 AND [BadQty] IS NULL) OR ([BadQty] = @Original_BadQty)) AND ((@IsNull_Price = 1 AND [Price] IS NULL) OR ([Price] = @Original_Price)) AND ((@IsNull_PriceUnit = 1 AND [PriceUnit] IS NULL) OR ([PriceUnit] = @Original_PriceUnit)) AND ((@IsNull_CostCenter = 1 AND [CostCenter] IS NULL) OR ([CostCenter] = @Original_CostCenter)) AND ((@IsNull_Memo = 1 AND [Memo] IS NULL) OR ([Memo] = @Original_Memo)) AND ((@IsNull_EnrDate = 1 AND [EnrDate] IS NULL) OR ([EnrDate] = @Original_EnrDate)) AND ((@IsNull_Enrollee = 1 AND [Enrollee] IS NULL) OR ([Enrollee] = @Original_Enrollee))); -SELECT ID, CtrlNo, SIDNo, Storage, Location, UseEqmt, PartName, PartNo, Process, SupplierNo, CurrentQty, MHA, Division, BadQty, Price, PriceUnit, CostCenter, Memo, EnrDate, Enrollee FROM SPMaster WHERE (ID = @ID) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DELETE FROM [SPMaster] - - - - - - - - - - - - DELETE FROM [EETGW_GroupUser] WHERE (([idx] = @Original_idx) AND ([gcode] = @Original_gcode) AND ([uid] = @Original_uid) AND ((@IsNull_level = 1 AND [level] IS NULL) OR ([level] = @Original_level)) AND ([wuid] = @Original_wuid) AND ([wdate] = @Original_wdate) AND ((@IsNull_useJobReport = 1 AND [useJobReport] IS NULL) OR ([useJobReport] = @Original_useJobReport)) AND ((@IsNull_useUserState = 1 AND [useUserState] IS NULL) OR ([useUserState] = @Original_useUserState)) AND ((@IsNull_state = 1 AND [state] IS NULL) OR ([state] = @Original_state))) - - - - - - - - - - - - - - - - - - - - INSERT INTO [EETGW_GroupUser] ([gcode], [uid], [level], [wuid], [wdate], [useJobReport], [useUserState], [state]) VALUES (@gcode, @uid, @level, @wuid, @wdate, @useJobReport, @useUserState, @state); -SELECT idx, gcode, uid, level, wuid, wdate, useJobReport, useUserState, state FROM EETGW_GroupUser WHERE (idx = SCOPE_IDENTITY()) - - - - - - - - - - - - - - - SELECT idx, gcode, uid, level, wuid, wdate, useJobReport, useUserState, state -FROM EETGW_GroupUser -WHERE (gcode = @gcode) - - - - - - - - UPDATE [EETGW_GroupUser] SET [gcode] = @gcode, [uid] = @uid, [level] = @level, [wuid] = @wuid, [wdate] = @wdate, [useJobReport] = @useJobReport, [useUserState] = @useUserState, [state] = @state WHERE (([idx] = @Original_idx) AND ([gcode] = @Original_gcode) AND ([uid] = @Original_uid) AND ((@IsNull_level = 1 AND [level] IS NULL) OR ([level] = @Original_level)) AND ([wuid] = @Original_wuid) AND ([wdate] = @Original_wdate) AND ((@IsNull_useJobReport = 1 AND [useJobReport] IS NULL) OR ([useJobReport] = @Original_useJobReport)) AND ((@IsNull_useUserState = 1 AND [useUserState] IS NULL) OR ([useUserState] = @Original_useUserState)) AND ((@IsNull_state = 1 AND [state] IS NULL) OR ([state] = @Original_state))); -SELECT idx, gcode, uid, level, wuid, wdate, useJobReport, useUserState, state FROM EETGW_GroupUser WHERE (idx = @idx) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SELECT COUNT(*) FROM EETGW_GroupUser -where gcode =@gcode -and uid = @uid - - - - - - - - - - - - - - - - - - - - - SELECT gcode, dept, level, name, nameE, grade, email, tel, indate, outdate, hp, place, ads_employNo, ads_title, ads_created, memo, processs, id, state, useJobReport, useUserState -FROM vGroupUser -WHERE (gcode = @gcode) AND (ISNULL(processs, '') LIKE @processs) -ORDER BY name - - - - - - - - - UPDATE EETGW_GroupUser -SET Process = @Process, state = @state -WHERE (gcode = @gcode) AND (uid = @id) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SELECT ISNULL(name, '') AS itemName -FROM Items -WHERE (idx = @id) - - - - - - - - - - SELECT ISNULL(name, '') AS ProjectName -FROM Projects -WHERE (idx = @idx) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + - + + + + + diff --git a/SubProject/FCOMMON/Info.cs b/SubProject/FCOMMON/Info.cs index 2f10380..d071c30 100644 --- a/SubProject/FCOMMON/Info.cs +++ b/SubProject/FCOMMON/Info.cs @@ -56,10 +56,10 @@ namespace FCOMMON public static string libxlCompany = "Amkor Technology korea, Inc"; public static string libxlKey = "windows-282b2b0800c5e0016bb06a6fafjfd6o8"; public static int camIndex = 0; - public static string serverip = "10.131.32.33"; - public static string ftp_id = "project"; - public static string ftp_pw = "Amkor1234"; - public static int ftp_port = 2121; - public static bool ftp_passive = true; + public static string datapath; + //public static string ftp_id = "project"; + //public static string ftp_pw = "Amkor1234"; + //public static int ftp_port = 2121; + //public static bool ftp_passive = true; } } diff --git a/SubProject/FPJ0000/Model1.edmx.diagram b/SubProject/FPJ0000/Model1.edmx.diagram index 3a67ca3..5f2918e 100644 --- a/SubProject/FPJ0000/Model1.edmx.diagram +++ b/SubProject/FPJ0000/Model1.edmx.diagram @@ -20,7 +20,7 @@ - + diff --git a/SubProject/FPJ0000/Note/fNote.cs b/SubProject/FPJ0000/Note/fNote.cs index 7439c41..b7ac796 100644 --- a/SubProject/FPJ0000/Note/fNote.cs +++ b/SubProject/FPJ0000/Note/fNote.cs @@ -32,7 +32,7 @@ namespace FPJ0000.Note Boolean binit = false; - + private void __Load(object sender, EventArgs e) { this.dtSD.Text = DateTime.Now.AddYears(-1).ToString("yyyy-MM-01"); @@ -56,7 +56,7 @@ namespace FPJ0000.Note foreach (FarPoint.Win.Spread.Column col in fpSpread1.ActiveSheet.Columns) col.Locked = true; } - + refreshData(); binit = true; @@ -71,7 +71,7 @@ namespace FPJ0000.Note { } - + void dtSD_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode != Keys.Enter) return; @@ -109,7 +109,7 @@ namespace FPJ0000.Note { // string state = "%"; // if (cmbState.SelectedIndex > 0) state = cmbState.Text.Split(',')[0].Substring(1); - + //var cmd = new System.Data.SqlClient.SqlCommand("select idx,gcode,pdate,uid,'' as description,'' as description2,share,wuid,wdate from eetgw_note where gcode = @gcode and pdate between @sd and @ed and (uid=@uid or isnull(share,0) = 1)",ta.Connection); //cmd.Parameters.Add("gcode", SqlDbType.VarChar).Value = FCOMMON.info.Login.gcode; //cmd.Parameters.Add("sd", SqlDbType.VarChar).Value = dtSD.Text; @@ -137,7 +137,7 @@ namespace FPJ0000.Note var stateStr = false; if (state != null) stateStr = (bool)state; - if(stateStr == true) + if (stateStr == true) this.fpSpread1.ActiveSheet.Rows[i].BackColor = Color.WhiteSmoke; else this.fpSpread1.ActiveSheet.Rows[i].BackColor = Color.SkyBlue; @@ -259,7 +259,7 @@ namespace FPJ0000.Note { if (filter != "") filter += " or "; filter += col + " like ?"; - } + } filter = filter.Replace("?", "'%" + search + "%'"); this.bs.Filter = filter; tbFind.BackColor = Color.Lime; @@ -319,7 +319,7 @@ namespace FPJ0000.Note private void btCopy_Click(object sender, EventArgs e) { - // funcCopy(); //190509 + // funcCopy(); //190509 } //void funcCopy() //{ @@ -419,7 +419,7 @@ namespace FPJ0000.Note private void toolStripButton1_Click(object sender, EventArgs e) { - + } private void toolStripButton2_Click(object sender, EventArgs e) @@ -443,15 +443,15 @@ namespace FPJ0000.Note var dr = drv.Row as DSNote.EETGW_NoteRow; - var serverpath = Properties.Settings.Default.SharePath; // @"\\10.131.32.29\Data\Project"; - if (System.IO.Directory.Exists(serverpath) == false) - { - FCOMMON.Util.MsgE("프로젝트 기본경로가 존재하지 않아 진행할 수 없습니다\n\n" + - serverpath); - return; - } + //var serverpath = Properties.Settings.Default.SharePath; // @"\\10.131.32.29\Data\Project"; + //if (System.IO.Directory.Exists(serverpath) == false) + //{ + // FCOMMON.Util.MsgE("프로젝트 기본경로가 존재하지 않아 진행할 수 없습니다\n\n" + + // serverpath); + // return; + //} - var path = serverpath + "\\Note\\" + dr.guid; + var path = System.IO.Path.Combine(FCOMMON.info.datapath,"Data","Note", dr.guid); if (System.IO.Directory.Exists(path) == false) { try diff --git a/SubProject/FPJ0000/Note/fNote_Add.cs b/SubProject/FPJ0000/Note/fNote_Add.cs index c35ae46..6665dae 100644 --- a/SubProject/FPJ0000/Note/fNote_Add.cs +++ b/SubProject/FPJ0000/Note/fNote_Add.cs @@ -210,7 +210,7 @@ namespace FPJ0000.Note private void button1_Click_1(object sender, EventArgs e) { - var serverpath = Properties.Settings.Default.SharePath; // @"\\10.131.32.29\Data\Project"; + var serverpath = FCOMMON.info.datapath; // @"\\10.131.32.29\Data\Project"; if (System.IO.Directory.Exists(serverpath) == false) { FCOMMON.Util.MsgE("프로젝트 기본경로가 존재하지 않아 진행할 수 없습니다\n\n" + diff --git a/SubProject/FPJ0000/Project/fPartBuyStatus.cs b/SubProject/FPJ0000/Project/fPartBuyStatus.cs index 9c195da..a125351 100644 --- a/SubProject/FPJ0000/Project/fPartBuyStatus.cs +++ b/SubProject/FPJ0000/Project/fPartBuyStatus.cs @@ -770,9 +770,9 @@ namespace FPJ0000 var drv = this.bsPart.Current as DataRowView; if (drv == null) return; var dr = drv.Row as dsPRJ.ProjectPartStatusRow; + var serverpath = System.IO.Path.Combine(FCOMMON.info.datapath, "Data", "Project"); - - var serverpath = Properties.Settings.Default.SharePath + @"\Project"; // + // var serverpath = Properties.Settings.Default.SharePath + @"\Project"; // if (dr.path.isEmpty() == false) { diff --git a/SubProject/FPJ0000/Project/fProjectData.cs b/SubProject/FPJ0000/Project/fProjectData.cs index 4aa675c..591e36b 100644 --- a/SubProject/FPJ0000/Project/fProjectData.cs +++ b/SubProject/FPJ0000/Project/fProjectData.cs @@ -96,14 +96,14 @@ namespace FPJ0000 btSendMail.Enabled = false; tabControl2.Enabled = false; - + } else { //디비에서 조회한다. var dtMessage = ta.GetbyIDX(dr.idx); - if(dtMessage.Rows.Count > 0) + if (dtMessage.Rows.Count > 0) { var dr2 = dtMessage.Rows[0] as dsPRJ.ProjectsRow; if (string.IsNullOrEmpty(dr2.CMP_After) == false) rtAft.Rtf = dr2.CMP_After; @@ -111,7 +111,7 @@ namespace FPJ0000 if (string.IsNullOrEmpty(dr2.CMP_Description) == false) rtDesc.Rtf = dr2.CMP_Description; if (string.IsNullOrEmpty(dr2.CMP_Background) == false) rtBack.Rtf = dr2.CMP_Background; } - + } btIO.Enabled = btPart.Enabled; @@ -145,10 +145,10 @@ namespace FPJ0000 //신규데이터일때에만 완료 자료를 처리한다. //if(this.dr.RowState == DataRowState.Detached || dr.RowState == DataRowState.Deleted) //{ - this.dr.CMP_After = rtAft.Rtf; - this.dr.CMP_Before = rtBef.Rtf; - this.dr.CMP_Description = rtDesc.Rtf; - this.dr.CMP_Background = rtBack.Rtf; + this.dr.CMP_After = rtAft.Rtf; + this.dr.CMP_Before = rtBef.Rtf; + this.dr.CMP_Description = rtDesc.Rtf; + this.dr.CMP_Background = rtBack.Rtf; //} //else //{ @@ -156,7 +156,7 @@ namespace FPJ0000 // var taq = new dsPRJTableAdapters.QueriesTableAdapter(); // var ucnt = taq.UpdateProjectCompleteMessage(rtBack.Rtf, rtDesc.Rtf, rtBef.Rtf, rtAft.Rtf, dr.idx); //} - + this.dr.crdue = tbDue.Text.Trim(); @@ -329,7 +329,7 @@ namespace FPJ0000 else tbPath.Text = "\\" + tbPath.Text; } - var serverpath = Properties.Settings.Default.SharePath + "\\Project"; + var serverpath = System.IO.Path.Combine(FCOMMON.info.datapath, "Data","Project"); if (System.IO.Directory.Exists(serverpath) == false) { FCOMMON.Util.MsgE("프로젝트 기본경로가 존재하지 않아 진행할 수 없습니다\n\n" + diff --git a/SubProject/FPJ0000/Project/fProjectLayout.cs b/SubProject/FPJ0000/Project/fProjectLayout.cs index 6075ce1..9b459ec 100644 --- a/SubProject/FPJ0000/Project/fProjectLayout.cs +++ b/SubProject/FPJ0000/Project/fProjectLayout.cs @@ -388,15 +388,29 @@ namespace FPJ0000 var dr = db.EETGW_Project_Layout.Where(t => t.no == this.no && t.project == this.project).FirstOrDefault(); if (dr == null) { - util.MsgE("기존 레이아웃 자료를 확인 할 수 없습니다"); + //없으면 추가 해야하마 + var newdr = new EETGW_Project_Layout(); + newdr.gcode = FCOMMON.info.Login.gcode; + newdr.no = this.no; + newdr.project = f.Index; + newdr.remark = string.Empty; + newdr.reserve = string.Empty; + newdr.row = 1; + newdr.col = 1; + newdr.rowspan = 1; + newdr.colspan = 1; + newdr.wdate = DateTime.Now; + newdr.wuid = FCOMMON.info.Login.no; + db.EETGW_Project_Layout.Add(newdr); + db.SaveChanges(); } else { dr.project = f.Index; db.SaveChanges(); util.MsgI("프로젝트를 변경했습니다"); - refreshData(); } + refreshData(); } } @@ -502,7 +516,7 @@ namespace FPJ0000 else tbPath = "\\" + tbPath; } //\\10.131.32.29\Data - var serverpath = Properties.Settings.Default.SharePath + @"\Project"; + var serverpath = System.IO.Path.Combine(FCOMMON.info.datapath, "Data", "Project"); if (System.IO.Directory.Exists(serverpath) == false) { FCOMMON.Util.MsgE("프로젝트 기본경로가 존재하지 않아 진행할 수 없습니다\n\n" + diff --git a/SubProject/FPJ0000/Project/fProjectList.cs b/SubProject/FPJ0000/Project/fProjectList.cs index 8c0b25e..a7d5969 100644 --- a/SubProject/FPJ0000/Project/fProjectList.cs +++ b/SubProject/FPJ0000/Project/fProjectList.cs @@ -127,7 +127,7 @@ namespace FPJ0000 if (state.EndsWith("(") == false) state += ","; state += "'완료'"; } - if(chk완료보고.Checked) + if (chk완료보고.Checked) { if (state.EndsWith("(") == false) state += ","; state += "'완료(보고)'"; @@ -146,7 +146,7 @@ namespace FPJ0000 // var orgQuery = this.ta.Adapter.SelectCommand.CommandText; - + string State_Select = " SELECT [idx],[pidx],[gcode],[isdel],[status],[asset],[level],[rev],[process],[part],[pdate],[name],[userManager],[usermain],[usersub],[userhw2],[reqstaff],[costo],[costn],[cnt],[remark_req],[remark_ans],[sdate],[ddate],[edate],[odate],[progress],[memo],[wuid],[wdate],[orderno],[crdue],[import],[path],[userprocess],[bCost],[bFanOut],[div],dbo.getScheduleProgress(idx) as ProgressPrj, dbo.getLastHistory(idx) AS lasthistory,'' AS wws, '' AS wwo, '' AS wwe, '' AS wwd FROM Projects"; //string State_Select = " SELECT [idx],[pidx],[gcode],[isdel],[status],[asset],[level],[rev],[process],[part],[pdate],[name],[userManager],[usermain],[usersub],[userhw2],[reqstaff],[costo],[costn],[cnt],[remark_req],[remark_ans],[sdate],[ddate],[edate],[odate],[progress],[memo],[wuid],[wdate],[orderno],[crdue],[import],[path],[userprocess],[bCost],[bFanOut],[div],dbo.getScheduleProgress(idx) as ProgressPrj, dbo.getLastHistory(idx) AS lasthistory, dbo.getWorkWeek(sdate) AS wws, dbo.getWorkWeek(odate) AS wwo, dbo.getWorkWeek(edate) AS wwe, dbo.getWorkWeek(ddate) AS wwd FROM Projects"; string State_where = " WHERE gcode=@gcode and isnull(div,'') <> 'EB' and "; @@ -521,7 +521,7 @@ namespace FPJ0000 this.prb1.ProgressMax = 100; this.prb1.ProgressValue = perc; } - + try { taHist.Fill(this.dsMSSQL.ProjectsHistory, dr.idx); @@ -705,7 +705,7 @@ namespace FPJ0000 else tbPath = "\\" + tbPath; } //\\10.131.32.29\Data - var serverpath = Properties.Settings.Default.SharePath + @"\Project"; + var serverpath = System.IO.Path.Combine(FCOMMON.info.datapath, "Data", "Project"); if (System.IO.Directory.Exists(serverpath) == false) { FCOMMON.Util.MsgE("프로젝트 기본경로가 존재하지 않아 진행할 수 없습니다\n\n" + diff --git a/SubProject/FPJ0000/Project/fProjectList.resx b/SubProject/FPJ0000/Project/fProjectList.resx index 0a94e6e..3bc31e1 100644 --- a/SubProject/FPJ0000/Project/fProjectList.resx +++ b/SubProject/FPJ0000/Project/fProjectList.resx @@ -230,34 +230,34 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIwSURBVDhPpZL/SxNxHMbvPwoClVIkFrTKUtcmLY0WGChF - SKESs3ZTl5qMigpL15TLXClrrcWoTLd0MjV1aUv6al9mX7Zbm5utrYzu6e6zQ3fLn+oFDwf3fp6HNx/e - 1H9jdHxE2+0ADNb30Pcv4FTfG2iZV4/FsYTe0aiuZ2RpsedRBGZXGF1DYVCJ1C9kq/b0ECdmJDDu6Pds - L3XG2wSDRwf9iBYnXfXkZ43pGcSMhG73VzLvm78Kxn8F5tlLoJCFYDh8eW7dAtNwmMwzoSyeEDIlGA5d - 9EkKKiwKVRmzGyWdcqi7FBI/ZR0Pil1pwvEUNOemVgsqLMUqZXMR1zjcgNbRRpSe30mCAv1jwXSBfTIE - +0QQzukg3n5Zxr72CVKg7i1WKfQ7OO39Wuw1laKwOQ/ylq0Y8IZgFTTO/r3B609xlLV4oWJ2lZfQcq7e - WQMZnc8V0DnbjXcWEU+uwDbJEq+d/5ICsgW/gY1XlfUglN1FqLyxH8ccR7CF3sRtpjduEzZqtX1ALLEC - xxSLu9NpUYNPWCwn115Wc60cercWR+1VKKTzuNyGdFigaeAdlr79xD1feoOHs/whOWdYZErdqYSsLR8F - +hzkntiwGhbQ3VwgBYN8UAiTglv8Q2TyIhCDxuhd9w60118iyhe4noaJ1+3nC4RAtmTt7t9iRkId8xyR - 5R9gYyl8jiQRYBOg9hg8yJas7oFdzEg4bp4fq+7wJ6o75lB5wYcDZ9fu5R+hqD9WXyzOjc3mIgAAAABJ + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIwSURBVDhPpZL/SxNxHMbvPwoClVKkFrTKUtcmLY0WGChF + SKESs3bThpqMigpL15TLXClrrcWoNLd0MjVtaUv6al9mX7Zbm9taWxnd091nh+6WP9ULHg7u/TwPbz68 + qf/G6PiI9lsBGKzvoR9YwMn+N9Ayrx6JYwl9Y1Fd7+jSYu/DCMyuMLofhEEl07+Qq3rDMCdmJDDu6Pdc + L3Xa2wKDRwf9qBYnXI3kZ53pGcSMhB73VzLvn78Cxn8Z5tmLoJCDYDh0aW7NAtNImMyzoSyeELIlGA5e + 8EkKqiwKVQWzC2Vdcqi7FRI/ZZ0Iil0ZwvE0NGenVwqqLKUqZUsJ1zzShLaxZpSf20GCAgPjwUyBfSoE + +2QQzpkg3n5JYG/HJClQ95WqFPR2TnuvHntM5Sg+VQB56xYMekOwCppg/97g9ac4Klq9UDE7K8toOdfo + rIOMLuSK6LxtxtuLiKeWYZtiidfOf0kB2YLfwMarxnoAyp4SVF/fh6OOw9hEb+A20uu3Chu12T4gllyG + Y5rFnZmMqKEnLBKp1ZfVXK2E3q3FEXsNiukCLr8pExZoGXyHpW8/cdeX2WB4lj8k52MW2VJ3KSFrL0SR + Pg/5x9ethAV0NxZIwRAfFMKk4Cb/ENm8CMSgMXrXvAPttZeI8gWup2Hidfv5AiGQq80d7t9iRkID8xyR + xA+wsTQ+R1IIsElQuw0e5ErWcN8uZiQcM8+P13b6k7Wdc6g+78P+M6v38o9Q1B9KNyzJq/t++QAAAABJ RU5ErkJggg== iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJ1SURBVDhPpZFLTNNwHMd78M7NuwcvIhJFpjcOJiYmHjwZ - Eg8mGi9gosGEgweQGBAlAXmoySQYBXkLypCwGUIwsA0QhqxiGdvsHkw6gY52fazr+vW/UUVNTHx802/6 - yP/z/T1K/bdWRouWQiNntfAvXhs7GfC/OLI/0F+U95PfFOVNTpbsM3GKcndaVMPIADDIlfXuc1qJIzpZ - loq4LqjfHFu4poRcFSHm1bHzJk5R9HBxwtAVqNFGSMFmSOwTyKFBGGmeZCVh6CLxzu57ehscx6WYIQtt - 4hTl6z4qZLQdArch6W+F8KEGW3NliM9fBe+tBb98C/zSTWx7KokrSGccfEPHRRMnAQPFWlreAE+3YXux - HtzUDcjcLKkqmNWz98T3DrLjeQYKFRPPdnBCy82fUYllQJdyoC4zUGMPQNN9sDnd6Jhg0TO9DocnjOze - TJwEtFlShi5DF9xI83Zom4NIbbRDiTTAu9yJ0QUOa58lfNpUMRsQML70BSO2Jt3EyV+wWtSMJkDbsiHF - deWqKuFayMFK9DtjWImKmGNlOIMSZoi9MRW9b1mYOEV5mgoVQ+MJ/BTqejOUUA2BKyD5Lufa9sdVOANJ - TPuTmGBELIRVdE1F9wJW7xbE5ASd8M/0ZJJrHRB9DyEyjRA/1qGXzLyyLmHKtwtn/S6iwjq2uhfA1OVf - Z+oPd9N3DsU99QXKj349fF+f9QtYJJCLVTBPqtvei6hpsBr2qlMXzYjfq8XOHrA62OoBsou+mRgeO1yZ - 6oYOwzveDndrqfC8PL/UPPrnell15orr0SU+aG/B2O0Syfz8d3pWfrB0vPq07Lh3bm8X/yaK+gpWVSQu - F4AiQgAAAABJRU5ErkJggg== + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJ1SURBVDhPpZFJTBNhHMXn4J2bdw9eRCSKVG8cTExMPHgy + JB5MNF7ARIMJBw8sMSBiAmFRIyJGQXZBKRJaQwgG2gJCkY44dHNaSmUqMGWms3Q6nefXMoqamLi8zMss + +X7vvwz131oZLVgKjZzVwr/YN3Yy4H9xZH+gvyDnJ78pyJmcLNpn4hTl6rSohpEGYJAr493nlBJDZLIk + uea8oH5zdOGaEnKWhZhXx86bOEXRw4VxQ1egRhogBZsgsU8ghwZhpHiSlYChi8Q7u++pbXAcl2SGLLSJ + U5S3+6iQ1nYI3IqEvwXCh2pszZUgNn8VvKcG/HIV+KWb2HaXE5eRzjh4h46LJk4CBgq1lLwBnm7F9mId + uKkbkLlZUlUwq2fu8e8dZMZzD+QrJp7p4ISWnT+tEsuALmVBXWagRu+BpvtgdbjQMcGiZ3oddncYmb2Z + OAlotSQNXYYuuJDibdA2B5HcaIeydhee5U6MLnDwfZbwaVPFbEDA+NIXjFgbdBMnf6HNoqY1AdqWFUmu + K1tVCddADpaj3xHFSkTEHCvDEZQwQ+yJquh9y8LEKcrdmK8YGk/gp1DXm6CEqglcBsl7Odu2P6bCEUhg + 2p/ABCNiIayiayqyF7B6Jy8qx+m4b7onnfB1QPTeh8g0QPxYi14y88q6hCnvLpzxuzUVbWOrewFMbe51 + pu5wN337UMxdl6f86NfDjfqsX8AigZysgnlS3fpeRFX9Q8NWceqiGfF7NdvYA212tnKA7KJvJopHdke6 + sv6x4Rlvh6ulWHhemltsHv1zvaw4c8X54BIftDVj7FaRZH7+Oz0rPVg8Xnlattef29vFv4mivgJKfyQk + 67tT2wAAAABJRU5ErkJggg== diff --git a/SubProject/FPJ0000/Properties/Settings.Designer.cs b/SubProject/FPJ0000/Properties/Settings.Designer.cs index 77a37d7..1979ed0 100644 --- a/SubProject/FPJ0000/Properties/Settings.Designer.cs +++ b/SubProject/FPJ0000/Properties/Settings.Designer.cs @@ -45,30 +45,6 @@ namespace FPJ0000.Properties { } } - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("10.131")] - public string ServerIP { - get { - return ((string)(this["ServerIP"])); - } - set { - this["ServerIP"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("\\\\10.131.32.33\\Data")] - public string SharePath { - get { - return ((string)(this["SharePath"])); - } - set { - this["SharePath"] = value; - } - } - [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)] diff --git a/SubProject/FPJ0000/Properties/Settings.settings b/SubProject/FPJ0000/Properties/Settings.settings index 146e661..7b27cd0 100644 --- a/SubProject/FPJ0000/Properties/Settings.settings +++ b/SubProject/FPJ0000/Properties/Settings.settings @@ -18,12 +18,6 @@ </SerializableConnectionString> Data Source=10.131.15.18;Initial Catalog=EE;Persist Security Info=True;User ID=eeuser;Password=Amkor123! - - 10.131 - - - \\10.131.32.33\Data - <?xml version="1.0" encoding="utf-16"?> <SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> diff --git a/SubProject/FPJ0000/app.config b/SubProject/FPJ0000/app.config index 51a128f..5d001f7 100644 --- a/SubProject/FPJ0000/app.config +++ b/SubProject/FPJ0000/app.config @@ -3,9 +3,6 @@
- -
- - - - - 10.131 - - - \\10.131.32.33\Data - - - \ No newline at end of file diff --git a/SubProject/WebServer/App.config b/SubProject/WebServer/App.config new file mode 100644 index 0000000..bb34a86 --- /dev/null +++ b/SubProject/WebServer/App.config @@ -0,0 +1,35 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SubProject/WebServer/Auth.cs b/SubProject/WebServer/Auth.cs new file mode 100644 index 0000000..2a867be --- /dev/null +++ b/SubProject/WebServer/Auth.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace WebServer +{ + using System; + using System.Collections.Generic; + + public partial class Auth + { + public int idx { get; set; } + public string user { get; set; } + public string gcode { get; set; } + public Nullable purchase { get; set; } + public Nullable holyday { get; set; } + public Nullable project { get; set; } + public Nullable jobreport { get; set; } + public Nullable savecost { get; set; } + public Nullable scheapp { get; set; } + } +} diff --git a/SubProject/WebServer/BaseController.cs b/SubProject/WebServer/BaseController.cs new file mode 100644 index 0000000..4d18576 --- /dev/null +++ b/SubProject/WebServer/BaseController.cs @@ -0,0 +1,314 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Web.Http; +using agi = HtmlAgilityPack; + + +namespace WebServer +{ + 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); + } + } + + 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/SubProject/WebServer/Common.cs b/SubProject/WebServer/Common.cs new file mode 100644 index 0000000..aabb606 --- /dev/null +++ b/SubProject/WebServer/Common.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace WebServer +{ + using System; + using System.Collections.Generic; + + public partial class Common + { + public int idx { get; set; } + public string gcode { get; set; } + public string grp { get; set; } + public string code { get; set; } + public string svalue { get; set; } + public Nullable ivalue { get; set; } + public Nullable fvalue { get; set; } + public string memo { get; set; } + public string wuid { get; set; } + public System.DateTime wdate { get; set; } + } +} diff --git a/SubProject/WebServer/Controller/CustomerController.cs b/SubProject/WebServer/Controller/CustomerController.cs new file mode 100644 index 0000000..f8006ba --- /dev/null +++ b/SubProject/WebServer/Controller/CustomerController.cs @@ -0,0 +1,199 @@ +using System; +using System.Linq; +using System.Net.Http; +using System.Web.Http; + +namespace WebServer.OWIN + +{ + 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 EEEntities(); + var rows = 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 EEEntities(); + var sd = DateTime.Now.ToString("yyyy-MM-01"); + var rows = db.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/SubProject/WebServer/Controller/HomeController.cs b/SubProject/WebServer/Controller/HomeController.cs new file mode 100644 index 0000000..0d71172 --- /dev/null +++ b/SubProject/WebServer/Controller/HomeController.cs @@ -0,0 +1,93 @@ +using System; +using System.Linq; +using System.Net.Http; +using System.Web.Http; + +namespace WebServer +{ + 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/SubProject/WebServer/Controller/ItemController.cs b/SubProject/WebServer/Controller/ItemController.cs new file mode 100644 index 0000000..cd0e861 --- /dev/null +++ b/SubProject/WebServer/Controller/ItemController.cs @@ -0,0 +1,148 @@ +using System; +using System.Linq; +using System.Net.Http; +using System.Web.Http; + +namespace WebServer +{ + 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(); + + var tbody = new System.Text.StringBuilder(); + + //테이블데이터생성 + var itemcnt = 0; + if (searchkey.isEmpty() == false) + { + var db = new EEEntities(); + var rows = db.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.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 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/SubProject/WebServer/Controller/JobreportController.cs b/SubProject/WebServer/Controller/JobreportController.cs new file mode 100644 index 0000000..1b1d1a5 --- /dev/null +++ b/SubProject/WebServer/Controller/JobreportController.cs @@ -0,0 +1,290 @@ +using Microsoft.Owin; +using System; +using System.Linq; +using System.Net.Http; +using System.Web; +using System.Web.Http; + +namespace WebServer +{ + 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; + } + + + [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 EEEntities(); + var sd = DateTime.Now.ToString("yyyy-MM-01"); + var ed = DateTime.Now.ToShortDateString(); + var rows = db.vJobReportForUser.AsNoTracking().Where(t => t.gcode == FCOMMON.info.Login.gcode && t.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 EEEntities(); + var sd = DateTime.Now.ToShortDateString(); + var rows = db.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 EEEntities(); + var sd = DateTime.Now.ToString("yyyy-MM-01"); + var ed = DateTime.Now.ToShortDateString(); + var rows = db.vJobReportForUser.AsNoTracking().Where(t => t.gcode == FCOMMON.info.Login.gcode && t.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/SubProject/WebServer/Controller/ProjectController.cs b/SubProject/WebServer/Controller/ProjectController.cs new file mode 100644 index 0000000..9ccc627 --- /dev/null +++ b/SubProject/WebServer/Controller/ProjectController.cs @@ -0,0 +1,467 @@ +using System; +using System.Linq; +using System.Net.Http; +using System.Web.Http; + +namespace WebServer +{ + 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 EEEntities(); + 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 EEEntities(); + var prjinfo = db.Projects.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.idx == project).FirstOrDefault(); + var schrows = 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 EEEntities(); + + + 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.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 EEEntities(); + + + 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.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 EEEntities(); + + var prjinfo = 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 rows = 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/SubProject/WebServer/Controller/PurchaseController.cs b/SubProject/WebServer/Controller/PurchaseController.cs new file mode 100644 index 0000000..f9aed92 --- /dev/null +++ b/SubProject/WebServer/Controller/PurchaseController.cs @@ -0,0 +1,208 @@ +using System; +using System.Linq; +using System.Net.Http; +using System.Web.Http; + +namespace WebServer +{ + 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(); + + var tbody = new System.Text.StringBuilder(); + + //테이블데이터생성 + var itemcnt = 0; + if (searchkey.isEmpty() == false) + { + var db = new EEEntities(); + var rows = db.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.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 EEEntities(); + var sd = DateTime.Now.ToString("yyyy-MM-01"); + var rows = db.vPurchase.AsNoTracking().Where(t => t.gcode == FCOMMON.info.Login.gcode && t.pdate.CompareTo(sd) >= 0).OrderByDescending(t => t.pdate); + itemcnt = rows.Count(); + foreach (var item in rows) + { + tbody.AppendLine(""); + 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.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/SubProject/WebServer/Controller/ResourceController.cs b/SubProject/WebServer/Controller/ResourceController.cs new file mode 100644 index 0000000..a83eb51 --- /dev/null +++ b/SubProject/WebServer/Controller/ResourceController.cs @@ -0,0 +1,114 @@ +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 WebServer +{ + 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 == "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; + 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/SubProject/WebServer/Controller/ResultController.cs b/SubProject/WebServer/Controller/ResultController.cs new file mode 100644 index 0000000..76bd9e4 --- /dev/null +++ b/SubProject/WebServer/Controller/ResultController.cs @@ -0,0 +1,64 @@ +using System; +using System.Linq; +using System.Net.Http; +using System.Web.Http; + +namespace WebServer +{ + 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/SubProject/WebServer/Controller/SettingController.cs b/SubProject/WebServer/Controller/SettingController.cs new file mode 100644 index 0000000..ed7562b --- /dev/null +++ b/SubProject/WebServer/Controller/SettingController.cs @@ -0,0 +1,63 @@ +using System; +using System.Linq; +using System.Net.Http; +using System.Web.Http; + +namespace WebServer +{ + 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/SubProject/WebServer/Customs.cs b/SubProject/WebServer/Customs.cs new file mode 100644 index 0000000..b40a248 --- /dev/null +++ b/SubProject/WebServer/Customs.cs @@ -0,0 +1,35 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace WebServer +{ + using System; + using System.Collections.Generic; + + public partial class Customs + { + public int idx { get; set; } + public string gcode { get; set; } + public string grp { get; set; } + public string uptae { get; set; } + public string name { get; set; } + public string name2 { get; set; } + public string owner { get; set; } + public string ownertel { get; set; } + public string address { get; set; } + public string tel { get; set; } + public string fax { get; set; } + public string email { get; set; } + public string memo { get; set; } + public string staff { get; set; } + public string stafftel { get; set; } + public string wuid { get; set; } + public System.DateTime wdate { get; set; } + } +} diff --git a/SubProject/WebServer/EETGW_GroupUser.cs b/SubProject/WebServer/EETGW_GroupUser.cs new file mode 100644 index 0000000..d413fa6 --- /dev/null +++ b/SubProject/WebServer/EETGW_GroupUser.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace WebServer +{ + using System; + using System.Collections.Generic; + + public partial class EETGW_GroupUser + { + public int idx { get; set; } + public string gcode { get; set; } + public string uid { get; set; } + public Nullable level { get; set; } + public string Process { get; set; } + public string state { get; set; } + public Nullable useJobReport { get; set; } + public Nullable useUserState { get; set; } + public string wuid { get; set; } + public System.DateTime wdate { get; set; } + } +} diff --git a/SubProject/WebServer/EETGW_Project_Layout.cs b/SubProject/WebServer/EETGW_Project_Layout.cs new file mode 100644 index 0000000..6697359 --- /dev/null +++ b/SubProject/WebServer/EETGW_Project_Layout.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace WebServer +{ + using System; + using System.Collections.Generic; + + public partial class EETGW_Project_Layout + { + public int idx { get; set; } + public string gcode { get; set; } + public int no { get; set; } + public int row { get; set; } + public int col { get; set; } + public int rowspan { get; set; } + public int colspan { get; set; } + public Nullable project { get; set; } + public string reserve { get; set; } + public string remark { get; set; } + public string wuid { get; set; } + public System.DateTime wdate { get; set; } + } +} diff --git a/SubProject/WebServer/EETGW_ProjectsSchedule.cs b/SubProject/WebServer/EETGW_ProjectsSchedule.cs new file mode 100644 index 0000000..30fbff8 --- /dev/null +++ b/SubProject/WebServer/EETGW_ProjectsSchedule.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace WebServer +{ + using System; + using System.Collections.Generic; + + public partial class EETGW_ProjectsSchedule + { + public int idx { get; set; } + public string gcode { get; set; } + public Nullable project { get; set; } + public Nullable no { get; set; } + public Nullable seq { get; set; } + public string title { get; set; } + public Nullable sw { get; set; } + public Nullable ew { get; set; } + public Nullable swa { get; set; } + public Nullable ewa { get; set; } + public string uid { get; set; } + public string memo { get; set; } + public Nullable appoval { get; set; } + public Nullable progress { get; set; } + public string wuid { get; set; } + public System.DateTime wdate { get; set; } + } +} diff --git a/SubProject/WebServer/HolidayLIst.cs b/SubProject/WebServer/HolidayLIst.cs new file mode 100644 index 0000000..83d1a85 --- /dev/null +++ b/SubProject/WebServer/HolidayLIst.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace WebServer +{ + using System; + using System.Collections.Generic; + + public partial class HolidayLIst + { + public int idx { get; set; } + public string pdate { get; set; } + public Nullable free { get; set; } + public string memo { get; set; } + public string wuid { get; set; } + public System.DateTime wdate { get; set; } + } +} diff --git a/SubProject/WebServer/Holyday.cs b/SubProject/WebServer/Holyday.cs new file mode 100644 index 0000000..f62f852 --- /dev/null +++ b/SubProject/WebServer/Holyday.cs @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace WebServer +{ + using System; + using System.Collections.Generic; + + public partial class Holyday + { + public int idx { get; set; } + public string gcode { get; set; } + public string cate { get; set; } + public string result { get; set; } + public Nullable sdate { get; set; } + public Nullable edate { get; set; } + public Nullable term { get; set; } + public Nullable termDr { get; set; } + public Nullable DrTime { get; set; } + public Nullable CrTime { get; set; } + public string title { get; set; } + public string contents { get; set; } + public string uid { get; set; } + public string tolist { get; set; } + public Nullable mail { get; set; } + public Nullable mailsend { get; set; } + public string tag { get; set; } + public string reason { get; set; } + public string wuid { get; set; } + public System.DateTime wdate { get; set; } + } +} diff --git a/SubProject/WebServer/Items.cs b/SubProject/WebServer/Items.cs new file mode 100644 index 0000000..d812873 --- /dev/null +++ b/SubProject/WebServer/Items.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace WebServer +{ + using System; + using System.Collections.Generic; + + public partial class Items + { + public int idx { get; set; } + public Nullable disable { get; set; } + public string gcode { get; set; } + public string cate { get; set; } + public string name { get; set; } + public string sid { get; set; } + public string model { get; set; } + public string manu { get; set; } + public Nullable scale { get; set; } + public string unit { get; set; } + public string supply { get; set; } + public Nullable supplyidx { get; set; } + public Nullable price { get; set; } + public string memo { get; set; } + public byte[] image { get; set; } + public Nullable bparam1 { get; set; } + public Nullable iparam1 { get; set; } + public string import { get; set; } + public string wuid { get; set; } + public System.DateTime wdate { get; set; } + public Nullable bEstimate { get; set; } + public Nullable bSAP { get; set; } + } +} diff --git a/SubProject/WebServer/JobReport.cs b/SubProject/WebServer/JobReport.cs new file mode 100644 index 0000000..6253ac7 --- /dev/null +++ b/SubProject/WebServer/JobReport.cs @@ -0,0 +1,39 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace WebServer +{ + using System; + using System.Collections.Generic; + + public partial class JobReport + { + public int idx { get; set; } + public string gcode { get; set; } + public string pdate { get; set; } + public Nullable pidx { get; set; } + public string projectName { get; set; } + public string uid { get; set; } + public string requestpart { get; set; } + public string package { get; set; } + public string status { get; set; } + public string type { get; set; } + public string process { get; set; } + public string description { get; set; } + public string remark { get; set; } + public Nullable hrs { get; set; } + public Nullable ot { get; set; } + public Nullable import { get; set; } + public string wuid { get; set; } + public System.DateTime wdate { get; set; } + public string description2 { get; set; } + public string tag { get; set; } + public Nullable autoinput { get; set; } + } +} diff --git a/SubProject/WebServer/LineCode.cs b/SubProject/WebServer/LineCode.cs new file mode 100644 index 0000000..dc06e24 --- /dev/null +++ b/SubProject/WebServer/LineCode.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace WebServer +{ + using System; + using System.Collections.Generic; + + public partial class LineCode + { + public int idx { get; set; } + public string code { get; set; } + public string team { get; set; } + public string part { get; set; } + public string plant { get; set; } + public string grp2 { get; set; } + public Nullable except { get; set; } + public string memo { get; set; } + public string wuid { get; set; } + public System.DateTime wdate { get; set; } + } +} diff --git a/SubProject/WebServer/MailData.cs b/SubProject/WebServer/MailData.cs new file mode 100644 index 0000000..4bea647 --- /dev/null +++ b/SubProject/WebServer/MailData.cs @@ -0,0 +1,35 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace WebServer +{ + using System; + using System.Collections.Generic; + + public partial class MailData + { + public int idx { get; set; } + public Nullable project { get; set; } + public string gcode { get; set; } + public string cate { get; set; } + public string pdate { get; set; } + public string subject { get; set; } + public string fromlist { get; set; } + public string tolist { get; set; } + public string bcc { get; set; } + public string cc { get; set; } + public string body { get; set; } + public Nullable SendOK { get; set; } + public string SendMsg { get; set; } + public Nullable aidx { get; set; } + public string atime { get; set; } + public string wuid { get; set; } + public System.DateTime wdate { get; set; } + } +} diff --git a/SubProject/WebServer/MailForm.cs b/SubProject/WebServer/MailForm.cs new file mode 100644 index 0000000..4925f7a --- /dev/null +++ b/SubProject/WebServer/MailForm.cs @@ -0,0 +1,35 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace WebServer +{ + using System; + using System.Collections.Generic; + + public partial class MailForm + { + public int idx { get; set; } + public string gcode { get; set; } + public string cate { get; set; } + public string title { get; set; } + public string tolist { get; set; } + public string bcc { get; set; } + public string cc { get; set; } + public string subject { get; set; } + public string tail { get; set; } + public string body { get; set; } + public Nullable selfTo { get; set; } + public Nullable selfCC { get; set; } + public Nullable selfBCC { get; set; } + public string wuid { get; set; } + public System.DateTime wdate { get; set; } + public string exceptmail { get; set; } + public string exceptmailcc { get; set; } + } +} diff --git a/SubProject/WebServer/MethodExtentions.cs b/SubProject/WebServer/MethodExtentions.cs new file mode 100644 index 0000000..cfb0701 --- /dev/null +++ b/SubProject/WebServer/MethodExtentions.cs @@ -0,0 +1,140 @@ +//180917 chi makefilepath,MakeFTPPath 입력 +//180705 chi GetHexStringNoSpace 다시 추가 ,UrlPathEncode 추가 +// getDateValue 추가 +//180625 chi GetHexStringNoSpace 삭제(이것은 util.cs로 이동) +//180614 chi Map 명령추가 + + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; + +namespace WebServer +{ + /// + /// generic method Extension + /// + public static class MethodExtensions + { + public static string MakeFilePath(this string value,params string[] param) + { + System.Text.StringBuilder sb = new System.Text.StringBuilder(); + sb.Append(value.Replace("/", "\\")); + foreach (var item in param) + { + if (sb.Length > 0 && sb.ToString().EndsWith("\\") == false) sb.Append("\\"); + sb.Append(item.Replace("/", "\\")); + } + var retval = sb.ToString().Replace("/", "\\").Replace("\\\\", "\\"); + return retval.ToString(); + } + + + public static string MakeFTPPath(this string value, params string[] param) + { + System.Text.StringBuilder sb = new System.Text.StringBuilder(); + sb.Append(value.Replace("\\", "/")); + foreach (var item in param) + { + if (sb.Length > 0 && sb.ToString().EndsWith("/") == false) sb.Append("/"); + sb.Append(item.Replace("\\", "/")); + } + var retval = sb.ToString().Replace("//", "/"); + return retval.ToString(); + } + + + public static double map(this double x, int in_min, int in_max, int out_min, int out_max) + { + return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; + } + + public static string Base64Encode(this string src) + { + string base64enc = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(src)); + return base64enc; + } + public static string Base64Decode(this string src) + { + var base64dec = Convert.FromBase64String(src); + return System.Text.Encoding.UTF8.GetString(base64dec); + } + + + /// + /// 0101이 반복되는 문자열 형태로 전환합니다. + /// + /// + /// + public static string BitString(this System.Collections.BitArray arr) + { + System.Text.StringBuilder sb = new System.Text.StringBuilder(); + for (int i = arr.Length; i > 0; i--) + sb.Append(arr[i - 1] ? "1" : "0"); + return sb.ToString(); + } + + /// + /// int 값으로 변환합니다. + /// + /// + /// + public static int ValueI(this System.Collections.BitArray arr) + { + byte[] buf = new byte[4]; + arr.CopyTo(buf, 0); + return BitConverter.ToInt32(buf, 0); + } + + /// + /// 숫자인지 검사합니다. + /// + /// + /// + public static bool IsNumeric(this string input) + { + double data; + return double.TryParse(input, out data); + //return Regex.IsMatch(input, @"^\d+$"); + } + + /// + /// isnullorempty 를 수행합니다. + /// + /// + /// + public static Boolean isEmpty(this string input) + { + return string.IsNullOrEmpty(input); + } + + /// + /// default 인코딩을 사용하여 문자열로 반환합니다. + /// + /// + /// + public static string GetString(this Byte[] input) + { + return System.Text.Encoding.Default.GetString(input); + } + + /// + /// 16진수 문자열 형태로 반환합니다. + /// + /// + /// + public static string GetHexString(this Byte[] input) + { + System.Text.StringBuilder sb = new System.Text.StringBuilder(); + foreach (byte b in input) + sb.Append(" " + b.ToString("X2")); + return sb.ToString(); + } + } + + +} diff --git a/SubProject/WebServer/Model/PageModel.cs b/SubProject/WebServer/Model/PageModel.cs new file mode 100644 index 0000000..ecc996f --- /dev/null +++ b/SubProject/WebServer/Model/PageModel.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WebServer +{ + public class PageModel + { + public List> RouteData { get; set; } + + + public string urlcontrol { get; set; } + public string urlaction { get; set; } + + } +} diff --git a/SubProject/WebServer/Model1.Context.cs b/SubProject/WebServer/Model1.Context.cs new file mode 100644 index 0000000..e67617e --- /dev/null +++ b/SubProject/WebServer/Model1.Context.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace WebServer +{ + using System; + using System.Data.Entity; + using System.Data.Entity.Infrastructure; + + public partial class EEEntities : DbContext + { + public EEEntities() + : base("name=EEEntities") + { + } + + protected override void OnModelCreating(DbModelBuilder modelBuilder) + { + throw new UnintentionalCodeFirstException(); + } + + public virtual DbSet EETGW_GroupUser { get; set; } + public virtual DbSet Items { get; set; } + public virtual DbSet JobReport { get; set; } + public virtual DbSet MailData { get; set; } + public virtual DbSet MailForm { get; set; } + public virtual DbSet Projects { get; set; } + public virtual DbSet ProjectsPart { get; set; } + public virtual DbSet Purchase { get; set; } + public virtual DbSet UserGroup { get; set; } + public virtual DbSet Users { get; set; } + public virtual DbSet vGroupUser { get; set; } + public virtual DbSet vJobReportForUser { get; set; } + public virtual DbSet vPurchase { get; set; } + public virtual DbSet Auth { get; set; } + public virtual DbSet Common { get; set; } + public virtual DbSet Customs { get; set; } + public virtual DbSet EETGW_Project_Layout { get; set; } + public virtual DbSet HolidayLIst { get; set; } + public virtual DbSet Holyday { get; set; } + public virtual DbSet LineCode { get; set; } + public virtual DbSet EETGW_ProjectsSchedule { get; set; } + public virtual DbSet vFindSID { get; set; } + } +} diff --git a/SubProject/WebServer/Model1.Context.tt b/SubProject/WebServer/Model1.Context.tt new file mode 100644 index 0000000..ba33bb5 --- /dev/null +++ b/SubProject/WebServer/Model1.Context.tt @@ -0,0 +1,636 @@ +<#@ template language="C#" debug="false" hostspecific="true"#> +<#@ include file="EF6.Utility.CS.ttinclude"#><#@ + output extension=".cs"#><# + +const string inputFile = @"Model1.edmx"; +var textTransform = DynamicTextTransformation.Create(this); +var code = new CodeGenerationTools(this); +var ef = new MetadataTools(this); +var typeMapper = new TypeMapper(code, ef, textTransform.Errors); +var loader = new EdmMetadataLoader(textTransform.Host, textTransform.Errors); +var itemCollection = loader.CreateEdmItemCollection(inputFile); +var modelNamespace = loader.GetModelNamespace(inputFile); +var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef); + +var container = itemCollection.OfType().FirstOrDefault(); +if (container == null) +{ + return string.Empty; +} +#> +//------------------------------------------------------------------------------ +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#> +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#> +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#> +// +//------------------------------------------------------------------------------ + +<# + +var codeNamespace = code.VsNamespaceSuggestion(); +if (!String.IsNullOrEmpty(codeNamespace)) +{ +#> +namespace <#=code.EscapeNamespace(codeNamespace)#> +{ +<# + PushIndent(" "); +} + +#> +using System; +using System.Data.Entity; +using System.Data.Entity.Infrastructure; +<# +if (container.FunctionImports.Any()) +{ +#> +using System.Data.Entity.Core.Objects; +using System.Linq; +<# +} +#> + +<#=Accessibility.ForType(container)#> partial class <#=code.Escape(container)#> : DbContext +{ + public <#=code.Escape(container)#>() + : base("name=<#=container.Name#>") + { +<# +if (!loader.IsLazyLoadingEnabled(container)) +{ +#> + this.Configuration.LazyLoadingEnabled = false; +<# +} + +foreach (var entitySet in container.BaseEntitySets.OfType()) +{ + // Note: the DbSet members are defined below such that the getter and + // setter always have the same accessibility as the DbSet definition + if (Accessibility.ForReadOnlyProperty(entitySet) != "public") + { +#> + <#=codeStringGenerator.DbSetInitializer(entitySet)#> +<# + } +} +#> + } + + protected override void OnModelCreating(DbModelBuilder modelBuilder) + { + throw new UnintentionalCodeFirstException(); + } + +<# + foreach (var entitySet in container.BaseEntitySets.OfType()) + { +#> + <#=codeStringGenerator.DbSet(entitySet)#> +<# + } + + foreach (var edmFunction in container.FunctionImports) + { + WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: false); + } +#> +} +<# + +if (!String.IsNullOrEmpty(codeNamespace)) +{ + PopIndent(); +#> +} +<# +} +#> +<#+ + +private void WriteFunctionImport(TypeMapper typeMapper, CodeStringGenerator codeStringGenerator, EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) +{ + if (typeMapper.IsComposable(edmFunction)) + { +#> + + [DbFunction("<#=edmFunction.NamespaceName#>", "<#=edmFunction.Name#>")] + <#=codeStringGenerator.ComposableFunctionMethod(edmFunction, modelNamespace)#> + { +<#+ + codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter); +#> + <#=codeStringGenerator.ComposableCreateQuery(edmFunction, modelNamespace)#> + } +<#+ + } + else + { +#> + + <#=codeStringGenerator.FunctionMethod(edmFunction, modelNamespace, includeMergeOption)#> + { +<#+ + codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter); +#> + <#=codeStringGenerator.ExecuteFunction(edmFunction, modelNamespace, includeMergeOption)#> + } +<#+ + if (typeMapper.GenerateMergeOptionFunction(edmFunction, includeMergeOption)) + { + WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: true); + } + } +} + +public void WriteFunctionParameter(string name, string isNotNull, string notNullInit, string nullInit) +{ +#> + var <#=name#> = <#=isNotNull#> ? + <#=notNullInit#> : + <#=nullInit#>; + +<#+ +} + +public const string TemplateId = "CSharp_DbContext_Context_EF6"; + +public class CodeStringGenerator +{ + private readonly CodeGenerationTools _code; + private readonly TypeMapper _typeMapper; + private readonly MetadataTools _ef; + + public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef) + { + ArgumentNotNull(code, "code"); + ArgumentNotNull(typeMapper, "typeMapper"); + ArgumentNotNull(ef, "ef"); + + _code = code; + _typeMapper = typeMapper; + _ef = ef; + } + + public string Property(EdmProperty edmProperty) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2} {{ {3}get; {4}set; }}", + Accessibility.ForProperty(edmProperty), + _typeMapper.GetTypeName(edmProperty.TypeUsage), + _code.Escape(edmProperty), + _code.SpaceAfter(Accessibility.ForGetter(edmProperty)), + _code.SpaceAfter(Accessibility.ForSetter(edmProperty))); + } + + public string NavigationProperty(NavigationProperty navProp) + { + var endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType()); + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2} {{ {3}get; {4}set; }}", + AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)), + navProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType, + _code.Escape(navProp), + _code.SpaceAfter(Accessibility.ForGetter(navProp)), + _code.SpaceAfter(Accessibility.ForSetter(navProp))); + } + + public string AccessibilityAndVirtual(string accessibility) + { + return accessibility + (accessibility != "private" ? " virtual" : ""); + } + + public string EntityClassOpening(EntityType entity) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1}partial class {2}{3}", + Accessibility.ForType(entity), + _code.SpaceAfter(_code.AbstractOption(entity)), + _code.Escape(entity), + _code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType))); + } + + public string EnumOpening(SimpleType enumType) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} enum {1} : {2}", + Accessibility.ForType(enumType), + _code.Escape(enumType), + _code.Escape(_typeMapper.UnderlyingClrType(enumType))); + } + + public void WriteFunctionParameters(EdmFunction edmFunction, Action writeParameter) + { + var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); + foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable)) + { + var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null"; + var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")"; + var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + TypeMapper.FixNamespaces(parameter.RawClrTypeName) + "))"; + writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit); + } + } + + public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace) + { + var parameters = _typeMapper.GetParameters(edmFunction); + + return string.Format( + CultureInfo.InvariantCulture, + "{0} IQueryable<{1}> {2}({3})", + AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), + _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), + _code.Escape(edmFunction), + string.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray())); + } + + public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace) + { + var parameters = _typeMapper.GetParameters(edmFunction); + + return string.Format( + CultureInfo.InvariantCulture, + "return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});", + _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), + edmFunction.NamespaceName, + edmFunction.Name, + string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()), + _code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()))); + } + + public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) + { + var parameters = _typeMapper.GetParameters(edmFunction); + var returnType = _typeMapper.GetReturnType(edmFunction); + + var paramList = String.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray()); + if (includeMergeOption) + { + paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption"; + } + + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2}({3})", + AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), + returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", + _code.Escape(edmFunction), + paramList); + } + + public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) + { + var parameters = _typeMapper.GetParameters(edmFunction); + var returnType = _typeMapper.GetReturnType(edmFunction); + + var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())); + if (includeMergeOption) + { + callParams = ", mergeOption" + callParams; + } + + return string.Format( + CultureInfo.InvariantCulture, + "return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});", + returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", + edmFunction.Name, + callParams); + } + + public string DbSet(EntitySet entitySet) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} virtual DbSet<{1}> {2} {{ get; set; }}", + Accessibility.ForReadOnlyProperty(entitySet), + _typeMapper.GetTypeName(entitySet.ElementType), + _code.Escape(entitySet)); + } + + public string DbSetInitializer(EntitySet entitySet) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} = Set<{1}>();", + _code.Escape(entitySet), + _typeMapper.GetTypeName(entitySet.ElementType)); + } + + public string UsingDirectives(bool inHeader, bool includeCollections = true) + { + return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion()) + ? string.Format( + CultureInfo.InvariantCulture, + "{0}using System;{1}" + + "{2}", + inHeader ? Environment.NewLine : "", + includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "", + inHeader ? "" : Environment.NewLine) + : ""; + } +} + +public class TypeMapper +{ + private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName"; + + private readonly System.Collections.IList _errors; + private readonly CodeGenerationTools _code; + private readonly MetadataTools _ef; + + public static string FixNamespaces(string typeName) + { + return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial."); + } + + public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors) + { + ArgumentNotNull(code, "code"); + ArgumentNotNull(ef, "ef"); + ArgumentNotNull(errors, "errors"); + + _code = code; + _ef = ef; + _errors = errors; + } + + public string GetTypeName(TypeUsage typeUsage) + { + return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null); + } + + public string GetTypeName(EdmType edmType) + { + return GetTypeName(edmType, isNullable: null, modelNamespace: null); + } + + public string GetTypeName(TypeUsage typeUsage, string modelNamespace) + { + return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace); + } + + public string GetTypeName(EdmType edmType, string modelNamespace) + { + return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace); + } + + public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace) + { + if (edmType == null) + { + return null; + } + + var collectionType = edmType as CollectionType; + if (collectionType != null) + { + return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace)); + } + + var typeName = _code.Escape(edmType.MetadataProperties + .Where(p => p.Name == ExternalTypeNameAttributeName) + .Select(p => (string)p.Value) + .FirstOrDefault()) + ?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ? + _code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) : + _code.Escape(edmType)); + + if (edmType is StructuralType) + { + return typeName; + } + + if (edmType is SimpleType) + { + var clrType = UnderlyingClrType(edmType); + if (!IsEnumType(edmType)) + { + typeName = _code.Escape(clrType); + } + + typeName = FixNamespaces(typeName); + + return clrType.IsValueType && isNullable == true ? + String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) : + typeName; + } + + throw new ArgumentException("edmType"); + } + + public Type UnderlyingClrType(EdmType edmType) + { + ArgumentNotNull(edmType, "edmType"); + + var primitiveType = edmType as PrimitiveType; + if (primitiveType != null) + { + return primitiveType.ClrEquivalentType; + } + + if (IsEnumType(edmType)) + { + return GetEnumUnderlyingType(edmType).ClrEquivalentType; + } + + return typeof(object); + } + + public object GetEnumMemberValue(MetadataItem enumMember) + { + ArgumentNotNull(enumMember, "enumMember"); + + var valueProperty = enumMember.GetType().GetProperty("Value"); + return valueProperty == null ? null : valueProperty.GetValue(enumMember, null); + } + + public string GetEnumMemberName(MetadataItem enumMember) + { + ArgumentNotNull(enumMember, "enumMember"); + + var nameProperty = enumMember.GetType().GetProperty("Name"); + return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null); + } + + public System.Collections.IEnumerable GetEnumMembers(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + var membersProperty = enumType.GetType().GetProperty("Members"); + return membersProperty != null + ? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null) + : Enumerable.Empty(); + } + + public bool EnumIsFlags(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + var isFlagsProperty = enumType.GetType().GetProperty("IsFlags"); + return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null); + } + + public bool IsEnumType(GlobalItem edmType) + { + ArgumentNotNull(edmType, "edmType"); + + return edmType.GetType().Name == "EnumType"; + } + + public PrimitiveType GetEnumUnderlyingType(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null); + } + + public string CreateLiteral(object value) + { + if (value == null || value.GetType() != typeof(TimeSpan)) + { + return _code.CreateLiteral(value); + } + + return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks); + } + + public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable types, string sourceFile) + { + ArgumentNotNull(types, "types"); + ArgumentNotNull(sourceFile, "sourceFile"); + + var hash = new HashSet(StringComparer.InvariantCultureIgnoreCase); + if (types.Any(item => !hash.Add(item))) + { + _errors.Add( + new CompilerError(sourceFile, -1, -1, "6023", + String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict")))); + return false; + } + return true; + } + + public IEnumerable GetEnumItemsToGenerate(IEnumerable itemCollection) + { + return GetItemsToGenerate(itemCollection) + .Where(e => IsEnumType(e)); + } + + public IEnumerable GetItemsToGenerate(IEnumerable itemCollection) where T: EdmType + { + return itemCollection + .OfType() + .Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName)) + .OrderBy(i => i.Name); + } + + public IEnumerable GetAllGlobalItems(IEnumerable itemCollection) + { + return itemCollection + .Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i)) + .Select(g => GetGlobalItemName(g)); + } + + public string GetGlobalItemName(GlobalItem item) + { + if (item is EdmType) + { + return ((EdmType)item).Name; + } + else + { + return ((EntityContainer)item).Name; + } + } + + public IEnumerable GetSimpleProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetSimpleProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetPropertiesWithDefaultValues(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetPropertiesWithDefaultValues(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetNavigationProperties(EntityType type) + { + return type.NavigationProperties.Where(np => np.DeclaringType == type); + } + + public IEnumerable GetCollectionNavigationProperties(EntityType type) + { + return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many); + } + + public FunctionParameter GetReturnParameter(EdmFunction edmFunction) + { + ArgumentNotNull(edmFunction, "edmFunction"); + + var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters"); + return returnParamsProperty == null + ? edmFunction.ReturnParameter + : ((IEnumerable)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault(); + } + + public bool IsComposable(EdmFunction edmFunction) + { + ArgumentNotNull(edmFunction, "edmFunction"); + + var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute"); + return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null); + } + + public IEnumerable GetParameters(EdmFunction edmFunction) + { + return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); + } + + public TypeUsage GetReturnType(EdmFunction edmFunction) + { + var returnParam = GetReturnParameter(edmFunction); + return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage); + } + + public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption) + { + var returnType = GetReturnType(edmFunction); + return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType; + } +} + +public static void ArgumentNotNull(T arg, string name) where T : class +{ + if (arg == null) + { + throw new ArgumentNullException(name); + } +} +#> \ No newline at end of file diff --git a/SubProject/WebServer/Model1.Designer.cs b/SubProject/WebServer/Model1.Designer.cs new file mode 100644 index 0000000..1092d13 --- /dev/null +++ b/SubProject/WebServer/Model1.Designer.cs @@ -0,0 +1,10 @@ +// 모델 'D:\Source\##### 완료아이템\(014) GroupWare\Source\SubProject\WebServer\Model1.edmx'에 대해 T4 코드 생성이 사용됩니다. +// 레거시 코드 생성을 사용하려면 '코드 생성 전략' 디자이너 속성의 값을 +// 'Legacy ObjectContext'로 변경하십시오. 이 속성은 모델이 디자이너에서 열릴 때 +// 속성 창에서 사용할 수 있습니다. + +// 컨텍스트 및 엔터티 클래스가 생성되지 않은 경우 빈 모델을 만들었기 때문일 수도 있지만 +// 사용할 Entity Framework 버전을 선택하지 않았기 때문일 수도 있습니다. 모델에 맞는 컨텍스트 클래스 및 +// 엔터티 클래스를 생성하려면 디자이너에서 모델을 열고 디자이너 화면에서 마우스 오른쪽 단추를 클릭한 +// 다음 '데이터베이스에서 모델 업데이트...', '모델에서 데이터베이스 생성...' 또는 '코드 생성 항목 추가...'를 +// 선택하십시오. \ No newline at end of file diff --git a/SubProject/WebServer/Model1.cs b/SubProject/WebServer/Model1.cs new file mode 100644 index 0000000..7a9ab12 --- /dev/null +++ b/SubProject/WebServer/Model1.cs @@ -0,0 +1,9 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + diff --git a/SubProject/WebServer/Model1.edmx b/SubProject/WebServer/Model1.edmx new file mode 100644 index 0000000..d71dacc --- /dev/null +++ b/SubProject/WebServer/Model1.edmx @@ -0,0 +1,1810 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SELECT + [vFindSID].[idx] AS [idx], + [vFindSID].[Location] AS [Location], + [vFindSID].[date] AS [date], + [vFindSID].[gcode] AS [gcode], + [vFindSID].[name] AS [name], + [vFindSID].[sid] AS [sid], + [vFindSID].[model] AS [model], + [vFindSID].[manu] AS [manu], + [vFindSID].[unit] AS [unit], + [vFindSID].[supply] AS [supply], + [vFindSID].[price] AS [price], + [vFindSID].[remark] AS [remark] + FROM [dbo].[vFindSID] AS [vFindSID] + + + SELECT + [vGroupUser].[gcode] AS [gcode], + [vGroupUser].[dept] AS [dept], + [vGroupUser].[level] AS [level], + [vGroupUser].[name] AS [name], + [vGroupUser].[nameE] AS [nameE], + [vGroupUser].[grade] AS [grade], + [vGroupUser].[email] AS [email], + [vGroupUser].[tel] AS [tel], + [vGroupUser].[indate] AS [indate], + [vGroupUser].[outdate] AS [outdate], + [vGroupUser].[hp] AS [hp], + [vGroupUser].[place] AS [place], + [vGroupUser].[ads_employNo] AS [ads_employNo], + [vGroupUser].[ads_title] AS [ads_title], + [vGroupUser].[ads_created] AS [ads_created], + [vGroupUser].[memo] AS [memo], + [vGroupUser].[processs] AS [processs], + [vGroupUser].[id] AS [id], + [vGroupUser].[state] AS [state], + [vGroupUser].[useJobReport] AS [useJobReport], + [vGroupUser].[useUserState] AS [useUserState] + FROM [dbo].[vGroupUser] AS [vGroupUser] + + + SELECT + [vJobReportForUser].[idx] AS [idx], + [vJobReportForUser].[pdate] AS [pdate], + [vJobReportForUser].[gcode] AS [gcode], + [vJobReportForUser].[id] AS [id], + [vJobReportForUser].[name] AS [name], + [vJobReportForUser].[process] AS [process], + [vJobReportForUser].[type] AS [type], + [vJobReportForUser].[svalue] AS [svalue], + [vJobReportForUser].[hrs] AS [hrs], + [vJobReportForUser].[ot] AS [ot], + [vJobReportForUser].[requestpart] AS [requestpart], + [vJobReportForUser].[package] AS [package], + [vJobReportForUser].[userProcess] AS [userProcess], + [vJobReportForUser].[status] AS [status], + [vJobReportForUser].[projectName] AS [projectName], + [vJobReportForUser].[description] AS [description], + [vJobReportForUser].[ww] AS [ww] + FROM [dbo].[vJobReportForUser] AS [vJobReportForUser] + + + SELECT + [vPurchase].[name] AS [name], + [vPurchase].[idx] AS [idx], + [vPurchase].[gcode] AS [gcode], + [vPurchase].[pdate] AS [pdate], + [vPurchase].[state] AS [state], + [vPurchase].[process] AS [process], + [vPurchase].[receive] AS [receive], + [vPurchase].[sc] AS [sc], + [vPurchase].[request] AS [request], + [vPurchase].[sid] AS [sid], + [vPurchase].[pumname] AS [pumname], + [vPurchase].[pumidx] AS [pumidx], + [vPurchase].[pumscale] AS [pumscale], + [vPurchase].[pumunit] AS [pumunit], + [vPurchase].[pumqty] AS [pumqty], + [vPurchase].[pumprice] AS [pumprice], + [vPurchase].[pumamt] AS [pumamt], + [vPurchase].[supply] AS [supply], + [vPurchase].[supplyidx] AS [supplyidx], + [vPurchase].[project] AS [project], + [vPurchase].[projectidx] AS [projectidx], + [vPurchase].[asset] AS [asset], + [vPurchase].[manuproc] AS [manuproc], + [vPurchase].[edate] AS [edate], + [vPurchase].[indate] AS [indate], + [vPurchase].[po] AS [po], + [vPurchase].[dept] AS [dept], + [vPurchase].[bigo] AS [bigo], + [vPurchase].[import] AS [import], + [vPurchase].[isdel] AS [isdel], + [vPurchase].[orderno] AS [orderno], + [vPurchase].[place] AS [place], + [vPurchase].[wuid] AS [wuid], + [vPurchase].[wdate] AS [wdate], + [vPurchase].[inqty] AS [inqty] + FROM [dbo].[vPurchase] AS [vPurchase] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SubProject/WebServer/Model1.edmx.diagram b/SubProject/WebServer/Model1.edmx.diagram new file mode 100644 index 0000000..1070def --- /dev/null +++ b/SubProject/WebServer/Model1.edmx.diagram @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SubProject/WebServer/Model1.tt b/SubProject/WebServer/Model1.tt new file mode 100644 index 0000000..985966b --- /dev/null +++ b/SubProject/WebServer/Model1.tt @@ -0,0 +1,733 @@ +<#@ template language="C#" debug="false" hostspecific="true"#> +<#@ include file="EF6.Utility.CS.ttinclude"#><#@ + output extension=".cs"#><# + +const string inputFile = @"Model1.edmx"; +var textTransform = DynamicTextTransformation.Create(this); +var code = new CodeGenerationTools(this); +var ef = new MetadataTools(this); +var typeMapper = new TypeMapper(code, ef, textTransform.Errors); +var fileManager = EntityFrameworkTemplateFileManager.Create(this); +var itemCollection = new EdmMetadataLoader(textTransform.Host, textTransform.Errors).CreateEdmItemCollection(inputFile); +var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef); + +if (!typeMapper.VerifyCaseInsensitiveTypeUniqueness(typeMapper.GetAllGlobalItems(itemCollection), inputFile)) +{ + return string.Empty; +} + +WriteHeader(codeStringGenerator, fileManager); + +foreach (var entity in typeMapper.GetItemsToGenerate(itemCollection)) +{ + fileManager.StartNewFile(entity.Name + ".cs"); + BeginNamespace(code); +#> +<#=codeStringGenerator.UsingDirectives(inHeader: false)#> +<#=codeStringGenerator.EntityClassOpening(entity)#> +{ +<# + var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(entity); + var collectionNavigationProperties = typeMapper.GetCollectionNavigationProperties(entity); + var complexProperties = typeMapper.GetComplexProperties(entity); + + if (propertiesWithDefaultValues.Any() || collectionNavigationProperties.Any() || complexProperties.Any()) + { +#> + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public <#=code.Escape(entity)#>() + { +<# + foreach (var edmProperty in propertiesWithDefaultValues) + { +#> + this.<#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>; +<# + } + + foreach (var navigationProperty in collectionNavigationProperties) + { +#> + this.<#=code.Escape(navigationProperty)#> = new HashSet<<#=typeMapper.GetTypeName(navigationProperty.ToEndMember.GetEntityType())#>>(); +<# + } + + foreach (var complexProperty in complexProperties) + { +#> + this.<#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>(); +<# + } +#> + } + +<# + } + + var simpleProperties = typeMapper.GetSimpleProperties(entity); + if (simpleProperties.Any()) + { + foreach (var edmProperty in simpleProperties) + { +#> + <#=codeStringGenerator.Property(edmProperty)#> +<# + } + } + + if (complexProperties.Any()) + { +#> + +<# + foreach(var complexProperty in complexProperties) + { +#> + <#=codeStringGenerator.Property(complexProperty)#> +<# + } + } + + var navigationProperties = typeMapper.GetNavigationProperties(entity); + if (navigationProperties.Any()) + { +#> + +<# + foreach (var navigationProperty in navigationProperties) + { + if (navigationProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many) + { +#> + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] +<# + } +#> + <#=codeStringGenerator.NavigationProperty(navigationProperty)#> +<# + } + } +#> +} +<# + EndNamespace(code); +} + +foreach (var complex in typeMapper.GetItemsToGenerate(itemCollection)) +{ + fileManager.StartNewFile(complex.Name + ".cs"); + BeginNamespace(code); +#> +<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#> +<#=Accessibility.ForType(complex)#> partial class <#=code.Escape(complex)#> +{ +<# + var complexProperties = typeMapper.GetComplexProperties(complex); + var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(complex); + + if (propertiesWithDefaultValues.Any() || complexProperties.Any()) + { +#> + public <#=code.Escape(complex)#>() + { +<# + foreach (var edmProperty in propertiesWithDefaultValues) + { +#> + this.<#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>; +<# + } + + foreach (var complexProperty in complexProperties) + { +#> + this.<#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>(); +<# + } +#> + } + +<# + } + + var simpleProperties = typeMapper.GetSimpleProperties(complex); + if (simpleProperties.Any()) + { + foreach(var edmProperty in simpleProperties) + { +#> + <#=codeStringGenerator.Property(edmProperty)#> +<# + } + } + + if (complexProperties.Any()) + { +#> + +<# + foreach(var edmProperty in complexProperties) + { +#> + <#=codeStringGenerator.Property(edmProperty)#> +<# + } + } +#> +} +<# + EndNamespace(code); +} + +foreach (var enumType in typeMapper.GetEnumItemsToGenerate(itemCollection)) +{ + fileManager.StartNewFile(enumType.Name + ".cs"); + BeginNamespace(code); +#> +<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#> +<# + if (typeMapper.EnumIsFlags(enumType)) + { +#> +[Flags] +<# + } +#> +<#=codeStringGenerator.EnumOpening(enumType)#> +{ +<# + var foundOne = false; + + foreach (MetadataItem member in typeMapper.GetEnumMembers(enumType)) + { + foundOne = true; +#> + <#=code.Escape(typeMapper.GetEnumMemberName(member))#> = <#=typeMapper.GetEnumMemberValue(member)#>, +<# + } + + if (foundOne) + { + this.GenerationEnvironment.Remove(this.GenerationEnvironment.Length - 3, 1); + } +#> +} +<# + EndNamespace(code); +} + +fileManager.Process(); + +#> +<#+ + +public void WriteHeader(CodeStringGenerator codeStringGenerator, EntityFrameworkTemplateFileManager fileManager) +{ + fileManager.StartHeader(); +#> +//------------------------------------------------------------------------------ +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#> +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#> +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#> +// +//------------------------------------------------------------------------------ +<#=codeStringGenerator.UsingDirectives(inHeader: true)#> +<#+ + fileManager.EndBlock(); +} + +public void BeginNamespace(CodeGenerationTools code) +{ + var codeNamespace = code.VsNamespaceSuggestion(); + if (!String.IsNullOrEmpty(codeNamespace)) + { +#> +namespace <#=code.EscapeNamespace(codeNamespace)#> +{ +<#+ + PushIndent(" "); + } +} + +public void EndNamespace(CodeGenerationTools code) +{ + if (!String.IsNullOrEmpty(code.VsNamespaceSuggestion())) + { + PopIndent(); +#> +} +<#+ + } +} + +public const string TemplateId = "CSharp_DbContext_Types_EF6"; + +public class CodeStringGenerator +{ + private readonly CodeGenerationTools _code; + private readonly TypeMapper _typeMapper; + private readonly MetadataTools _ef; + + public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef) + { + ArgumentNotNull(code, "code"); + ArgumentNotNull(typeMapper, "typeMapper"); + ArgumentNotNull(ef, "ef"); + + _code = code; + _typeMapper = typeMapper; + _ef = ef; + } + + public string Property(EdmProperty edmProperty) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2} {{ {3}get; {4}set; }}", + Accessibility.ForProperty(edmProperty), + _typeMapper.GetTypeName(edmProperty.TypeUsage), + _code.Escape(edmProperty), + _code.SpaceAfter(Accessibility.ForGetter(edmProperty)), + _code.SpaceAfter(Accessibility.ForSetter(edmProperty))); + } + + public string NavigationProperty(NavigationProperty navProp) + { + var endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType()); + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2} {{ {3}get; {4}set; }}", + AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)), + navProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType, + _code.Escape(navProp), + _code.SpaceAfter(Accessibility.ForGetter(navProp)), + _code.SpaceAfter(Accessibility.ForSetter(navProp))); + } + + public string AccessibilityAndVirtual(string accessibility) + { + return accessibility + (accessibility != "private" ? " virtual" : ""); + } + + public string EntityClassOpening(EntityType entity) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1}partial class {2}{3}", + Accessibility.ForType(entity), + _code.SpaceAfter(_code.AbstractOption(entity)), + _code.Escape(entity), + _code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType))); + } + + public string EnumOpening(SimpleType enumType) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} enum {1} : {2}", + Accessibility.ForType(enumType), + _code.Escape(enumType), + _code.Escape(_typeMapper.UnderlyingClrType(enumType))); + } + + public void WriteFunctionParameters(EdmFunction edmFunction, Action writeParameter) + { + var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); + foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable)) + { + var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null"; + var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")"; + var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + TypeMapper.FixNamespaces(parameter.RawClrTypeName) + "))"; + writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit); + } + } + + public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace) + { + var parameters = _typeMapper.GetParameters(edmFunction); + + return string.Format( + CultureInfo.InvariantCulture, + "{0} IQueryable<{1}> {2}({3})", + AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), + _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), + _code.Escape(edmFunction), + string.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray())); + } + + public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace) + { + var parameters = _typeMapper.GetParameters(edmFunction); + + return string.Format( + CultureInfo.InvariantCulture, + "return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});", + _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), + edmFunction.NamespaceName, + edmFunction.Name, + string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()), + _code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()))); + } + + public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) + { + var parameters = _typeMapper.GetParameters(edmFunction); + var returnType = _typeMapper.GetReturnType(edmFunction); + + var paramList = String.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray()); + if (includeMergeOption) + { + paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption"; + } + + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2}({3})", + AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), + returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", + _code.Escape(edmFunction), + paramList); + } + + public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) + { + var parameters = _typeMapper.GetParameters(edmFunction); + var returnType = _typeMapper.GetReturnType(edmFunction); + + var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())); + if (includeMergeOption) + { + callParams = ", mergeOption" + callParams; + } + + return string.Format( + CultureInfo.InvariantCulture, + "return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});", + returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", + edmFunction.Name, + callParams); + } + + public string DbSet(EntitySet entitySet) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} virtual DbSet<{1}> {2} {{ get; set; }}", + Accessibility.ForReadOnlyProperty(entitySet), + _typeMapper.GetTypeName(entitySet.ElementType), + _code.Escape(entitySet)); + } + + public string UsingDirectives(bool inHeader, bool includeCollections = true) + { + return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion()) + ? string.Format( + CultureInfo.InvariantCulture, + "{0}using System;{1}" + + "{2}", + inHeader ? Environment.NewLine : "", + includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "", + inHeader ? "" : Environment.NewLine) + : ""; + } +} + +public class TypeMapper +{ + private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName"; + + private readonly System.Collections.IList _errors; + private readonly CodeGenerationTools _code; + private readonly MetadataTools _ef; + + public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors) + { + ArgumentNotNull(code, "code"); + ArgumentNotNull(ef, "ef"); + ArgumentNotNull(errors, "errors"); + + _code = code; + _ef = ef; + _errors = errors; + } + + public static string FixNamespaces(string typeName) + { + return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial."); + } + + public string GetTypeName(TypeUsage typeUsage) + { + return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null); + } + + public string GetTypeName(EdmType edmType) + { + return GetTypeName(edmType, isNullable: null, modelNamespace: null); + } + + public string GetTypeName(TypeUsage typeUsage, string modelNamespace) + { + return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace); + } + + public string GetTypeName(EdmType edmType, string modelNamespace) + { + return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace); + } + + public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace) + { + if (edmType == null) + { + return null; + } + + var collectionType = edmType as CollectionType; + if (collectionType != null) + { + return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace)); + } + + var typeName = _code.Escape(edmType.MetadataProperties + .Where(p => p.Name == ExternalTypeNameAttributeName) + .Select(p => (string)p.Value) + .FirstOrDefault()) + ?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ? + _code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) : + _code.Escape(edmType)); + + if (edmType is StructuralType) + { + return typeName; + } + + if (edmType is SimpleType) + { + var clrType = UnderlyingClrType(edmType); + if (!IsEnumType(edmType)) + { + typeName = _code.Escape(clrType); + } + + typeName = FixNamespaces(typeName); + + return clrType.IsValueType && isNullable == true ? + String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) : + typeName; + } + + throw new ArgumentException("edmType"); + } + + public Type UnderlyingClrType(EdmType edmType) + { + ArgumentNotNull(edmType, "edmType"); + + var primitiveType = edmType as PrimitiveType; + if (primitiveType != null) + { + return primitiveType.ClrEquivalentType; + } + + if (IsEnumType(edmType)) + { + return GetEnumUnderlyingType(edmType).ClrEquivalentType; + } + + return typeof(object); + } + + public object GetEnumMemberValue(MetadataItem enumMember) + { + ArgumentNotNull(enumMember, "enumMember"); + + var valueProperty = enumMember.GetType().GetProperty("Value"); + return valueProperty == null ? null : valueProperty.GetValue(enumMember, null); + } + + public string GetEnumMemberName(MetadataItem enumMember) + { + ArgumentNotNull(enumMember, "enumMember"); + + var nameProperty = enumMember.GetType().GetProperty("Name"); + return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null); + } + + public System.Collections.IEnumerable GetEnumMembers(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + var membersProperty = enumType.GetType().GetProperty("Members"); + return membersProperty != null + ? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null) + : Enumerable.Empty(); + } + + public bool EnumIsFlags(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + var isFlagsProperty = enumType.GetType().GetProperty("IsFlags"); + return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null); + } + + public bool IsEnumType(GlobalItem edmType) + { + ArgumentNotNull(edmType, "edmType"); + + return edmType.GetType().Name == "EnumType"; + } + + public PrimitiveType GetEnumUnderlyingType(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null); + } + + public string CreateLiteral(object value) + { + if (value == null || value.GetType() != typeof(TimeSpan)) + { + return _code.CreateLiteral(value); + } + + return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks); + } + + public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable types, string sourceFile) + { + ArgumentNotNull(types, "types"); + ArgumentNotNull(sourceFile, "sourceFile"); + + var hash = new HashSet(StringComparer.InvariantCultureIgnoreCase); + if (types.Any(item => !hash.Add(item))) + { + _errors.Add( + new CompilerError(sourceFile, -1, -1, "6023", + String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict")))); + return false; + } + return true; + } + + public IEnumerable GetEnumItemsToGenerate(IEnumerable itemCollection) + { + return GetItemsToGenerate(itemCollection) + .Where(e => IsEnumType(e)); + } + + public IEnumerable GetItemsToGenerate(IEnumerable itemCollection) where T: EdmType + { + return itemCollection + .OfType() + .Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName)) + .OrderBy(i => i.Name); + } + + public IEnumerable GetAllGlobalItems(IEnumerable itemCollection) + { + return itemCollection + .Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i)) + .Select(g => GetGlobalItemName(g)); + } + + public string GetGlobalItemName(GlobalItem item) + { + if (item is EdmType) + { + return ((EdmType)item).Name; + } + else + { + return ((EntityContainer)item).Name; + } + } + + public IEnumerable GetSimpleProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetSimpleProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetPropertiesWithDefaultValues(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetPropertiesWithDefaultValues(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetNavigationProperties(EntityType type) + { + return type.NavigationProperties.Where(np => np.DeclaringType == type); + } + + public IEnumerable GetCollectionNavigationProperties(EntityType type) + { + return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many); + } + + public FunctionParameter GetReturnParameter(EdmFunction edmFunction) + { + ArgumentNotNull(edmFunction, "edmFunction"); + + var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters"); + return returnParamsProperty == null + ? edmFunction.ReturnParameter + : ((IEnumerable)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault(); + } + + public bool IsComposable(EdmFunction edmFunction) + { + ArgumentNotNull(edmFunction, "edmFunction"); + + var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute"); + return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null); + } + + public IEnumerable GetParameters(EdmFunction edmFunction) + { + return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); + } + + public TypeUsage GetReturnType(EdmFunction edmFunction) + { + var returnParam = GetReturnParameter(edmFunction); + return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage); + } + + public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption) + { + var returnType = GetReturnType(edmFunction); + return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType; + } +} + +public static void ArgumentNotNull(T arg, string name) where T : class +{ + if (arg == null) + { + throw new ArgumentNullException(name); + } +} +#> \ No newline at end of file diff --git a/SubProject/WebServer/OWIN/Startup.cs b/SubProject/WebServer/OWIN/Startup.cs new file mode 100644 index 0000000..c099628 --- /dev/null +++ b/SubProject/WebServer/OWIN/Startup.cs @@ -0,0 +1,79 @@ +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 WebServer.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.UseStaticFiles(); + appBuilder.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll); + 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/SubProject/WebServer/OWIN/StartupSSE.cs b/SubProject/WebServer/OWIN/StartupSSE.cs new file mode 100644 index 0000000..e93f2c4 --- /dev/null +++ b/SubProject/WebServer/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 WebServer.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/SubProject/WebServer/Program.cs b/SubProject/WebServer/Program.cs new file mode 100644 index 0000000..a2a889b --- /dev/null +++ b/SubProject/WebServer/Program.cs @@ -0,0 +1,27 @@ +using Microsoft.Owin.Hosting; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WebServer +{ + class Program + { + static void Main(string[] args) + { + // Start OWIN host + try + { + WebApp.Start(url: "http://127.0.0.1:9000"); + Console.WriteLine("start webapp"); + Console.ReadLine(); + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + } + } + } +} diff --git a/SubProject/WebServer/Projects.cs b/SubProject/WebServer/Projects.cs new file mode 100644 index 0000000..337a876 --- /dev/null +++ b/SubProject/WebServer/Projects.cs @@ -0,0 +1,70 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace WebServer +{ + using System; + using System.Collections.Generic; + + public partial class Projects + { + public int idx { get; set; } + public Nullable pidx { get; set; } + public string gcode { get; set; } + public Nullable isdel { get; set; } + public string category { get; set; } + public string status { get; set; } + public string asset { get; set; } + public Nullable level { get; set; } + public Nullable rev { get; set; } + public string process { get; set; } + public string part { get; set; } + public string pdate { get; set; } + public string name { get; set; } + public string userManager { get; set; } + public string usermain { get; set; } + public string usersub { get; set; } + public string userhw2 { get; set; } + public string reqstaff { get; set; } + public Nullable costo { get; set; } + public Nullable costn { get; set; } + public Nullable cnt { get; set; } + public string remark_req { get; set; } + public string remark_ans { get; set; } + public string sdate { get; set; } + public string ddate { get; set; } + public string edate { get; set; } + public string odate { get; set; } + public Nullable progress { get; set; } + public string memo { get; set; } + public string wuid { get; set; } + public System.DateTime wdate { get; set; } + public string orderno { get; set; } + public string crdue { get; set; } + public Nullable import { get; set; } + public string path { get; set; } + public string userprocess { get; set; } + public string CMP_Background { get; set; } + public string CMP_Description { get; set; } + public string CMP_Before { get; set; } + public string CMP_After { get; set; } + public Nullable bCost { get; set; } + public Nullable bFanOut { get; set; } + public string div { get; set; } + public string EB_Site { get; set; } + public string EB_Line { get; set; } + public string EB_Team { get; set; } + public string EB_Model { get; set; } + public string EB_OutSourceName { get; set; } + public Nullable EB_RepairTime { get; set; } + public Nullable EB_ConstNew { get; set; } + public string EB_BoardName { get; set; } + public Nullable bAlert { get; set; } + } +} diff --git a/SubProject/WebServer/ProjectsPart.cs b/SubProject/WebServer/ProjectsPart.cs new file mode 100644 index 0000000..e3e7eea --- /dev/null +++ b/SubProject/WebServer/ProjectsPart.cs @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace WebServer +{ + using System; + using System.Collections.Generic; + + public partial class ProjectsPart + { + public int idx { get; set; } + public Nullable no { get; set; } + public Nullable Project { get; set; } + public string ItemGroup { get; set; } + public string ItemModel { get; set; } + public string ItemUnit { get; set; } + public string ItemName { get; set; } + public string ItemSid { get; set; } + public string ItemSupply { get; set; } + public Nullable ItemSupplyidx { get; set; } + public string ItemManu { get; set; } + public Nullable Item { get; set; } + public string option1 { get; set; } + public string option2 { get; set; } + public string option3 { get; set; } + public Nullable qty { get; set; } + public Nullable qtyn { get; set; } + public Nullable price { get; set; } + public Nullable amt { get; set; } + public Nullable amtn { get; set; } + public Nullable jago { get; set; } + public string remark { get; set; } + public string memo { get; set; } + public string wuid { get; set; } + public System.DateTime wdate { get; set; } + public Nullable import { get; set; } + public string qtyjago { get; set; } + public Nullable qtybuy { get; set; } + public Nullable qtyin { get; set; } + public Nullable bbuy { get; set; } + public Nullable bconfirm { get; set; } + public Nullable bCancel { get; set; } + } +} diff --git a/SubProject/WebServer/Properties/AssemblyInfo.cs b/SubProject/WebServer/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..172d467 --- /dev/null +++ b/SubProject/WebServer/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해 +// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면 +// 이러한 특성 값을 변경하세요. +[assembly: AssemblyTitle("WebServer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WebServer")] +[assembly: AssemblyCopyright("Copyright © 2021")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에 +// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면 +// 해당 형식에 대해 ComVisible 특성을 true로 설정하세요. +[assembly: ComVisible(false)] + +// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다. +[assembly: Guid("cafe5cd0-c055-4c77-9253-8d5ee9558d43")] + +// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다. +// +// 주 버전 +// 부 버전 +// 빌드 번호 +// 수정 버전 +// +// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를 +// 기본값으로 할 수 있습니다. +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/SubProject/WebServer/Purchase.cs b/SubProject/WebServer/Purchase.cs new file mode 100644 index 0000000..d1b3ad7 --- /dev/null +++ b/SubProject/WebServer/Purchase.cs @@ -0,0 +1,52 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace WebServer +{ + using System; + using System.Collections.Generic; + + public partial class Purchase + { + public int idx { get; set; } + public string gcode { get; set; } + public string pdate { get; set; } + public string state { get; set; } + public string process { get; set; } + public string receive { get; set; } + public string sc { get; set; } + public string request { get; set; } + public string sid { get; set; } + public string pumname { get; set; } + public Nullable pumidx { get; set; } + public string pumscale { get; set; } + public string pumunit { get; set; } + public Nullable pumqty { get; set; } + public Nullable pumprice { get; set; } + public Nullable pumamt { get; set; } + public string supply { get; set; } + public Nullable supplyidx { get; set; } + public string project { get; set; } + public Nullable projectidx { get; set; } + public string asset { get; set; } + public string manuproc { get; set; } + public string edate { get; set; } + public string indate { get; set; } + public string po { get; set; } + public string dept { get; set; } + public string bigo { get; set; } + public Nullable import { get; set; } + public Nullable isdel { get; set; } + public string orderno { get; set; } + public string place { get; set; } + public string wuid { get; set; } + public System.DateTime wdate { get; set; } + public Nullable inqty { get; set; } + } +} diff --git a/SubProject/WebServer/UserGroup.cs b/SubProject/WebServer/UserGroup.cs new file mode 100644 index 0000000..96be7c1 --- /dev/null +++ b/SubProject/WebServer/UserGroup.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace WebServer +{ + using System; + using System.Collections.Generic; + + public partial class UserGroup + { + public string dept { get; set; } + public string gcode { get; set; } + public string path_kj { get; set; } + public Nullable advpurchase { get; set; } + public Nullable permission { get; set; } + } +} diff --git a/SubProject/WebServer/Users.cs b/SubProject/WebServer/Users.cs new file mode 100644 index 0000000..dac7239 --- /dev/null +++ b/SubProject/WebServer/Users.cs @@ -0,0 +1,39 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace WebServer +{ + using System; + using System.Collections.Generic; + + public partial class Users + { + public string id { get; set; } + public string gcode { get; set; } + public string password { get; set; } + public string nameE { get; set; } + public string name { get; set; } + public string dept { get; set; } + public string grade { get; set; } + public string email { get; set; } + public Nullable level { get; set; } + public string indate { get; set; } + public string outdate { get; set; } + public string tel { get; set; } + public string hp { get; set; } + public string place { get; set; } + public string ads_employNo { get; set; } + public string ads_title { get; set; } + public string ads_created { get; set; } + public string memo { get; set; } + public string wuid { get; set; } + public System.DateTime wdate { get; set; } + public string processs { get; set; } + } +} diff --git a/SubProject/WebServer/WebServer.csproj b/SubProject/WebServer/WebServer.csproj new file mode 100644 index 0000000..f957b38 --- /dev/null +++ b/SubProject/WebServer/WebServer.csproj @@ -0,0 +1,258 @@ + + + + + Debug + AnyCPU + {CAFE5CD0-C055-4C77-9253-8D5EE9558D43} + Exe + WebServer + WebServer + v4.7 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + + + ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + + + ..\..\packages\HtmlAgilityPack.CssSelectors.1.0.2\lib\net45\HtmlAgilityPack.dll + + + ..\..\packages\HtmlAgilityPack.CssSelectors.1.0.2\lib\net45\HtmlAgilityPack.CssSelectors.dll + + + ..\..\packages\Microsoft.AspNet.SignalR.Core.1.2.2\lib\net40\Microsoft.AspNet.SignalR.Core.dll + + + ..\..\packages\Microsoft.AspNet.SignalR.Owin.1.2.2\lib\net45\Microsoft.AspNet.SignalR.Owin.dll + + + ..\..\packages\Microsoft.Owin.4.2.0\lib\net45\Microsoft.Owin.dll + + + ..\..\packages\Microsoft.Owin.Cors.4.2.0\lib\net45\Microsoft.Owin.Cors.dll + + + ..\..\packages\Microsoft.Owin.Diagnostics.4.2.0\lib\net45\Microsoft.Owin.Diagnostics.dll + + + ..\..\packages\Microsoft.Owin.FileSystems.4.2.0\lib\net45\Microsoft.Owin.FileSystems.dll + + + ..\..\packages\Microsoft.Owin.Host.HttpListener.4.2.0\lib\net45\Microsoft.Owin.Host.HttpListener.dll + + + ..\..\packages\Microsoft.Owin.Hosting.4.2.0\lib\net45\Microsoft.Owin.Hosting.dll + + + ..\..\packages\Microsoft.Owin.StaticFiles.4.2.0\lib\net45\Microsoft.Owin.StaticFiles.dll + + + ..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll + + + ..\..\packages\Owin.1.0\lib\net40\Owin.dll + + + + + + + ..\..\packages\System.IO.4.3.0\lib\net462\System.IO.dll + + + ..\..\packages\System.Net.Http.4.3.4\lib\net46\System.Net.Http.dll + + + ..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll + + + ..\..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll + + + + + ..\..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net463\System.Security.Cryptography.Algorithms.dll + + + ..\..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll + + + ..\..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll + + + ..\..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll + + + ..\..\packages\Microsoft.AspNet.Cors.5.0.0\lib\net45\System.Web.Cors.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 + + + + + + + + + + Model1.tt + + + + Model1.tt + + + + + + + + + + + + Model1.tt + + + Model1.tt + + + Model1.tt + + + Model1.tt + + + Model1.tt + + + Model1.tt + + + Model1.tt + + + Model1.tt + + + Model1.tt + + + Model1.tt + + + Model1.tt + + + + True + True + Model1.Context.tt + + + True + True + Model1.tt + + + True + True + Model1.edmx + + + + + + + Model1.tt + + + Model1.tt + + + + Model1.tt + + + Model1.tt + + + Model1.tt + + + Model1.tt + + + Model1.tt + + + Model1.tt + + + Model1.tt + + + + + + EntityModelCodeGenerator + Model1.Designer.cs + + + Model1.edmx + + + + + + {304bd018-194b-47da-b4e0-f16df7b606da} + FCOMMON + + + + + TextTemplatingFileGenerator + Model1.Context.cs + Model1.edmx + + + TextTemplatingFileGenerator + Model1.edmx + Model1.cs + + + + + + + \ No newline at end of file diff --git a/SubProject/WebServer/packages.config b/SubProject/WebServer/packages.config new file mode 100644 index 0000000..37ae6ea --- /dev/null +++ b/SubProject/WebServer/packages.config @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SubProject/WebServer/vFindSID.cs b/SubProject/WebServer/vFindSID.cs new file mode 100644 index 0000000..aee4604 --- /dev/null +++ b/SubProject/WebServer/vFindSID.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace WebServer +{ + using System; + using System.Collections.Generic; + + public partial class vFindSID + { + public int idx { get; set; } + public string Location { get; set; } + public string date { get; set; } + public string gcode { get; set; } + public string name { get; set; } + public string sid { get; set; } + public string model { get; set; } + public string manu { get; set; } + public string unit { get; set; } + public string supply { get; set; } + public Nullable price { get; set; } + public string remark { get; set; } + } +} diff --git a/SubProject/WebServer/vGroupUser.cs b/SubProject/WebServer/vGroupUser.cs new file mode 100644 index 0000000..c1e8205 --- /dev/null +++ b/SubProject/WebServer/vGroupUser.cs @@ -0,0 +1,39 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace WebServer +{ + using System; + using System.Collections.Generic; + + public partial class vGroupUser + { + public string gcode { get; set; } + public string dept { get; set; } + public Nullable level { get; set; } + public string name { get; set; } + public string nameE { get; set; } + public string grade { get; set; } + public string email { get; set; } + public string tel { get; set; } + public string indate { get; set; } + public string outdate { get; set; } + public string hp { get; set; } + public string place { get; set; } + public string ads_employNo { get; set; } + public string ads_title { get; set; } + public string ads_created { get; set; } + public string memo { get; set; } + public string processs { get; set; } + public string id { get; set; } + public string state { get; set; } + public Nullable useJobReport { get; set; } + public Nullable useUserState { get; set; } + } +} diff --git a/SubProject/WebServer/vJobReportForUser.cs b/SubProject/WebServer/vJobReportForUser.cs new file mode 100644 index 0000000..c831555 --- /dev/null +++ b/SubProject/WebServer/vJobReportForUser.cs @@ -0,0 +1,35 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace WebServer +{ + using System; + using System.Collections.Generic; + + public partial class vJobReportForUser + { + public int idx { get; set; } + public string pdate { get; set; } + public string gcode { get; set; } + public string id { get; set; } + public string name { get; set; } + public string process { get; set; } + public string type { get; set; } + public string svalue { get; set; } + public Nullable hrs { get; set; } + public Nullable ot { get; set; } + public string requestpart { get; set; } + public string package { get; set; } + public string userProcess { get; set; } + public string status { get; set; } + public string projectName { get; set; } + public string description { get; set; } + public string ww { get; set; } + } +} diff --git a/SubProject/WebServer/vPurchase.cs b/SubProject/WebServer/vPurchase.cs new file mode 100644 index 0000000..48f510f --- /dev/null +++ b/SubProject/WebServer/vPurchase.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace WebServer +{ + using System; + using System.Collections.Generic; + + public partial class vPurchase + { + public string name { get; set; } + public int idx { get; set; } + public string gcode { get; set; } + public string pdate { get; set; } + public string state { get; set; } + public string process { get; set; } + public string receive { get; set; } + public string sc { get; set; } + public string request { get; set; } + public string sid { get; set; } + public string pumname { get; set; } + public Nullable pumidx { get; set; } + public string pumscale { get; set; } + public string pumunit { get; set; } + public Nullable pumqty { get; set; } + public Nullable pumprice { get; set; } + public Nullable pumamt { get; set; } + public string supply { get; set; } + public Nullable supplyidx { get; set; } + public string project { get; set; } + public Nullable projectidx { get; set; } + public string asset { get; set; } + public string manuproc { get; set; } + public string edate { get; set; } + public string indate { get; set; } + public string po { get; set; } + public string dept { get; set; } + public string bigo { get; set; } + public Nullable import { get; set; } + public Nullable isdel { get; set; } + public string orderno { get; set; } + public string place { get; set; } + public string wuid { get; set; } + public System.DateTime wdate { get; set; } + public Nullable inqty { get; set; } + } +}