add webtestversion
This commit is contained in:
@@ -1,93 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Web.Http;
|
|
||||||
|
|
||||||
namespace Project
|
|
||||||
{
|
|
||||||
public class HomeController : BaseController
|
|
||||||
{
|
|
||||||
[HttpPost]
|
|
||||||
public void Index([FromBody]string value)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// PUT api/values/5
|
|
||||||
public void Put(int id, [FromBody]string value)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// DELETE api/values/5
|
|
||||||
public void Delete(int id)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet]
|
|
||||||
public string Test()
|
|
||||||
{
|
|
||||||
return "test";
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet]
|
|
||||||
public HttpResponseMessage Login()
|
|
||||||
{
|
|
||||||
//로그인이 되어있지않다면 로그인을 가져온다
|
|
||||||
MethodResult result;
|
|
||||||
result = View();
|
|
||||||
|
|
||||||
var model = GetGlobalModel();
|
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
|
||||||
|
|
||||||
//기본값을 찾아서 없애줘야한다
|
|
||||||
var contents = result.Content;
|
|
||||||
|
|
||||||
//공용값 적용
|
|
||||||
ApplyCommonValue(ref contents);
|
|
||||||
|
|
||||||
//최종문자 적용
|
|
||||||
result.Content = contents;
|
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
|
||||||
{
|
|
||||||
Content = new StringContent(
|
|
||||||
result.Content,
|
|
||||||
System.Text.Encoding.UTF8,
|
|
||||||
"text/html")
|
|
||||||
};
|
|
||||||
|
|
||||||
return resp;
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet]
|
|
||||||
public HttpResponseMessage Index()
|
|
||||||
{
|
|
||||||
//로그인이 되어있지않다면 로그인을 가져온다
|
|
||||||
MethodResult result;
|
|
||||||
result = View();
|
|
||||||
|
|
||||||
var model = GetGlobalModel();
|
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
|
||||||
|
|
||||||
//기본값을 찾아서 없애줘야한다
|
|
||||||
var contents = result.Content;
|
|
||||||
|
|
||||||
//공용값 적용
|
|
||||||
ApplyCommonValue(ref contents);
|
|
||||||
|
|
||||||
//최종문자 적용
|
|
||||||
result.Content = contents;
|
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
|
||||||
{
|
|
||||||
Content = new StringContent(
|
|
||||||
result.Content,
|
|
||||||
System.Text.Encoding.UTF8,
|
|
||||||
"text/html")
|
|
||||||
};
|
|
||||||
|
|
||||||
return resp;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -61,15 +61,9 @@ namespace Project.Dialog
|
|||||||
// 시스템에 설치된 WebView2 사용
|
// 시스템에 설치된 WebView2 사용
|
||||||
await this.webView21.EnsureCoreWebView2Async();
|
await this.webView21.EnsureCoreWebView2Async();
|
||||||
}
|
}
|
||||||
var fn = "intro.html";
|
// OWIN 서버의 DashBoard 페이지로 연결
|
||||||
if (System.Diagnostics.Debugger.IsAttached)
|
webView21.Source = new Uri("http://127.0.0.1:9000/DashBoard");
|
||||||
fn = "dashboard.html";
|
label1.Visible = false;
|
||||||
var fi = new System.IO.FileInfo($"view\\{fn}");
|
|
||||||
if(fi.Exists)
|
|
||||||
{
|
|
||||||
webView21.Source = new Uri(fi.FullName);
|
|
||||||
label1.Visible = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
289
Project/Dialog/fLogin_WB.Designer.cs
generated
Normal file
289
Project/Dialog/fLogin_WB.Designer.cs
generated
Normal file
@@ -0,0 +1,289 @@
|
|||||||
|
namespace Project.Dialog
|
||||||
|
{
|
||||||
|
partial class fLogin_WB
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(fLogin));
|
||||||
|
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||||
|
this.panel1 = new System.Windows.Forms.Panel();
|
||||||
|
this.tabControl1 = new System.Windows.Forms.TabControl();
|
||||||
|
this.tabPage1 = new System.Windows.Forms.TabPage();
|
||||||
|
this.listView1 = new System.Windows.Forms.ListView();
|
||||||
|
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
|
this.tabPage2 = new System.Windows.Forms.TabPage();
|
||||||
|
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
|
||||||
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
|
this.cmbDept = new System.Windows.Forms.ComboBox();
|
||||||
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
|
this.tbID = new System.Windows.Forms.ComboBox();
|
||||||
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.tbPW = new System.Windows.Forms.TextBox();
|
||||||
|
this.panel2 = new System.Windows.Forms.Panel();
|
||||||
|
this.btLogin = new System.Windows.Forms.Button();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||||
|
this.panel1.SuspendLayout();
|
||||||
|
this.tabControl1.SuspendLayout();
|
||||||
|
this.tabPage1.SuspendLayout();
|
||||||
|
this.panel2.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// pictureBox1
|
||||||
|
//
|
||||||
|
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
|
||||||
|
this.pictureBox1.Location = new System.Drawing.Point(405, 25);
|
||||||
|
this.pictureBox1.Name = "pictureBox1";
|
||||||
|
this.pictureBox1.Size = new System.Drawing.Size(80, 80);
|
||||||
|
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
|
||||||
|
this.pictureBox1.TabIndex = 3;
|
||||||
|
this.pictureBox1.TabStop = false;
|
||||||
|
//
|
||||||
|
// panel1
|
||||||
|
//
|
||||||
|
this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(245)))), ((int)(((byte)(244)))));
|
||||||
|
this.panel1.Controls.Add(this.tabControl1);
|
||||||
|
this.panel1.Controls.Add(this.linkLabel1);
|
||||||
|
this.panel1.Controls.Add(this.label4);
|
||||||
|
this.panel1.Controls.Add(this.cmbDept);
|
||||||
|
this.panel1.Controls.Add(this.label3);
|
||||||
|
this.panel1.Controls.Add(this.tbID);
|
||||||
|
this.panel1.Controls.Add(this.label2);
|
||||||
|
this.panel1.Controls.Add(this.label1);
|
||||||
|
this.panel1.Controls.Add(this.tbPW);
|
||||||
|
this.panel1.Controls.Add(this.pictureBox1);
|
||||||
|
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.panel1.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.panel1.Name = "panel1";
|
||||||
|
this.panel1.Size = new System.Drawing.Size(888, 639);
|
||||||
|
this.panel1.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// tabControl1
|
||||||
|
//
|
||||||
|
this.tabControl1.Controls.Add(this.tabPage1);
|
||||||
|
this.tabControl1.Controls.Add(this.tabPage2);
|
||||||
|
this.tabControl1.Location = new System.Drawing.Point(16, 288);
|
||||||
|
this.tabControl1.Name = "tabControl1";
|
||||||
|
this.tabControl1.SelectedIndex = 0;
|
||||||
|
this.tabControl1.Size = new System.Drawing.Size(860, 327);
|
||||||
|
this.tabControl1.TabIndex = 13;
|
||||||
|
//
|
||||||
|
// tabPage1
|
||||||
|
//
|
||||||
|
this.tabPage1.Controls.Add(this.listView1);
|
||||||
|
this.tabPage1.Location = new System.Drawing.Point(4, 32);
|
||||||
|
this.tabPage1.Name = "tabPage1";
|
||||||
|
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
|
||||||
|
this.tabPage1.Size = new System.Drawing.Size(852, 291);
|
||||||
|
this.tabPage1.TabIndex = 0;
|
||||||
|
this.tabPage1.Text = "FAQ";
|
||||||
|
this.tabPage1.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// listView1
|
||||||
|
//
|
||||||
|
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||||
|
this.columnHeader1});
|
||||||
|
this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.listView1.HideSelection = false;
|
||||||
|
this.listView1.Location = new System.Drawing.Point(3, 3);
|
||||||
|
this.listView1.Name = "listView1";
|
||||||
|
this.listView1.Size = new System.Drawing.Size(846, 285);
|
||||||
|
this.listView1.TabIndex = 13;
|
||||||
|
this.listView1.UseCompatibleStateImageBehavior = false;
|
||||||
|
this.listView1.View = System.Windows.Forms.View.Details;
|
||||||
|
this.listView1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.listView1_MouseDoubleClick);
|
||||||
|
//
|
||||||
|
// columnHeader1
|
||||||
|
//
|
||||||
|
this.columnHeader1.Text = "제목";
|
||||||
|
this.columnHeader1.Width = 836;
|
||||||
|
//
|
||||||
|
// tabPage2
|
||||||
|
//
|
||||||
|
this.tabPage2.Location = new System.Drawing.Point(4, 22);
|
||||||
|
this.tabPage2.Name = "tabPage2";
|
||||||
|
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
|
||||||
|
this.tabPage2.Size = new System.Drawing.Size(852, 301);
|
||||||
|
this.tabPage2.TabIndex = 1;
|
||||||
|
this.tabPage2.Text = "PATCH";
|
||||||
|
this.tabPage2.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// linkLabel1
|
||||||
|
//
|
||||||
|
this.linkLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.linkLabel1.AutoSize = true;
|
||||||
|
this.linkLabel1.Location = new System.Drawing.Point(806, 110);
|
||||||
|
this.linkLabel1.Name = "linkLabel1";
|
||||||
|
this.linkLabel1.Size = new System.Drawing.Size(70, 23);
|
||||||
|
this.linkLabel1.TabIndex = 11;
|
||||||
|
this.linkLabel1.TabStop = true;
|
||||||
|
this.linkLabel1.Text = "신규가입";
|
||||||
|
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
|
||||||
|
//
|
||||||
|
// label4
|
||||||
|
//
|
||||||
|
this.label4.AutoSize = true;
|
||||||
|
this.label4.Font = new System.Drawing.Font("맑은 고딕", 9F);
|
||||||
|
this.label4.ForeColor = System.Drawing.Color.Teal;
|
||||||
|
this.label4.Location = new System.Drawing.Point(13, 257);
|
||||||
|
this.label4.Name = "label4";
|
||||||
|
this.label4.Size = new System.Drawing.Size(243, 15);
|
||||||
|
this.label4.TabIndex = 10;
|
||||||
|
this.label4.Text = "문의 ) Chickyun.kim@amkor.co.kr, T.8567";
|
||||||
|
//
|
||||||
|
// cmbDept
|
||||||
|
//
|
||||||
|
this.cmbDept.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.cmbDept.Font = new System.Drawing.Font("Calibri", 20.25F);
|
||||||
|
this.cmbDept.FormattingEnabled = true;
|
||||||
|
this.cmbDept.Location = new System.Drawing.Point(16, 136);
|
||||||
|
this.cmbDept.Name = "cmbDept";
|
||||||
|
this.cmbDept.Size = new System.Drawing.Size(860, 41);
|
||||||
|
this.cmbDept.TabIndex = 9;
|
||||||
|
this.cmbDept.SelectedIndexChanged += new System.EventHandler(this.cmbDept_SelectedIndexChanged);
|
||||||
|
//
|
||||||
|
// label3
|
||||||
|
//
|
||||||
|
this.label3.AutoSize = true;
|
||||||
|
this.label3.Font = new System.Drawing.Font("맑은 고딕", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.label3.ForeColor = System.Drawing.Color.Gray;
|
||||||
|
this.label3.Location = new System.Drawing.Point(13, 119);
|
||||||
|
this.label3.Name = "label3";
|
||||||
|
this.label3.Size = new System.Drawing.Size(31, 15);
|
||||||
|
this.label3.TabIndex = 8;
|
||||||
|
this.label3.Text = "부서";
|
||||||
|
//
|
||||||
|
// tbID
|
||||||
|
//
|
||||||
|
this.tbID.Font = new System.Drawing.Font("Calibri", 20.25F);
|
||||||
|
this.tbID.FormattingEnabled = true;
|
||||||
|
this.tbID.ImeMode = System.Windows.Forms.ImeMode.Alpha;
|
||||||
|
this.tbID.Location = new System.Drawing.Point(16, 205);
|
||||||
|
this.tbID.Name = "tbID";
|
||||||
|
this.tbID.Size = new System.Drawing.Size(364, 41);
|
||||||
|
this.tbID.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
this.label2.AutoSize = true;
|
||||||
|
this.label2.Font = new System.Drawing.Font("맑은 고딕", 9F);
|
||||||
|
this.label2.ForeColor = System.Drawing.Color.Gray;
|
||||||
|
this.label2.Location = new System.Drawing.Point(509, 187);
|
||||||
|
this.label2.Name = "label2";
|
||||||
|
this.label2.Size = new System.Drawing.Size(31, 15);
|
||||||
|
this.label2.TabIndex = 4;
|
||||||
|
this.label2.Text = "암호";
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Font = new System.Drawing.Font("맑은 고딕", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.label1.ForeColor = System.Drawing.Color.Gray;
|
||||||
|
this.label1.Location = new System.Drawing.Point(13, 188);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(55, 15);
|
||||||
|
this.label1.TabIndex = 2;
|
||||||
|
this.label1.Text = "사원번호";
|
||||||
|
//
|
||||||
|
// tbPW
|
||||||
|
//
|
||||||
|
this.tbPW.Font = new System.Drawing.Font("Calibri", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.tbPW.ImeMode = System.Windows.Forms.ImeMode.Alpha;
|
||||||
|
this.tbPW.Location = new System.Drawing.Point(512, 205);
|
||||||
|
this.tbPW.Name = "tbPW";
|
||||||
|
this.tbPW.PasswordChar = '●';
|
||||||
|
this.tbPW.Size = new System.Drawing.Size(364, 40);
|
||||||
|
this.tbPW.TabIndex = 5;
|
||||||
|
this.tbPW.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
|
//
|
||||||
|
// panel2
|
||||||
|
//
|
||||||
|
this.panel2.BackColor = System.Drawing.SystemColors.Control;
|
||||||
|
this.panel2.Controls.Add(this.btLogin);
|
||||||
|
this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||||
|
this.panel2.Location = new System.Drawing.Point(0, 639);
|
||||||
|
this.panel2.Name = "panel2";
|
||||||
|
this.panel2.Size = new System.Drawing.Size(888, 82);
|
||||||
|
this.panel2.TabIndex = 6;
|
||||||
|
//
|
||||||
|
// btLogin
|
||||||
|
//
|
||||||
|
this.btLogin.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.btLogin.Font = new System.Drawing.Font("맑은 고딕", 25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.btLogin.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.btLogin.Name = "btLogin";
|
||||||
|
this.btLogin.Size = new System.Drawing.Size(888, 82);
|
||||||
|
this.btLogin.TabIndex = 0;
|
||||||
|
this.btLogin.Text = "접속";
|
||||||
|
this.btLogin.UseVisualStyleBackColor = true;
|
||||||
|
this.btLogin.Click += new System.EventHandler(this.button1_Click);
|
||||||
|
//
|
||||||
|
// fLogin
|
||||||
|
//
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||||
|
this.BackColor = System.Drawing.Color.OrangeRed;
|
||||||
|
this.ClientSize = new System.Drawing.Size(888, 721);
|
||||||
|
this.Controls.Add(this.panel1);
|
||||||
|
this.Controls.Add(this.panel2);
|
||||||
|
this.Font = new System.Drawing.Font("Calibri", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||||
|
this.MaximizeBox = false;
|
||||||
|
this.MinimizeBox = false;
|
||||||
|
this.Name = "fLogin";
|
||||||
|
this.Text = "사용자확인";
|
||||||
|
this.Load += new System.EventHandler(this.fLogin_Load);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||||
|
this.panel1.ResumeLayout(false);
|
||||||
|
this.panel1.PerformLayout();
|
||||||
|
this.tabControl1.ResumeLayout(false);
|
||||||
|
this.tabPage1.ResumeLayout(false);
|
||||||
|
this.panel2.ResumeLayout(false);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.PictureBox pictureBox1;
|
||||||
|
private System.Windows.Forms.Panel panel1;
|
||||||
|
private System.Windows.Forms.Panel panel2;
|
||||||
|
private System.Windows.Forms.Button btLogin;
|
||||||
|
public System.Windows.Forms.TextBox tbPW;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.Label label2;
|
||||||
|
private System.Windows.Forms.ComboBox tbID;
|
||||||
|
private System.Windows.Forms.ComboBox cmbDept;
|
||||||
|
private System.Windows.Forms.Label label3;
|
||||||
|
private System.Windows.Forms.Label label4;
|
||||||
|
private System.Windows.Forms.LinkLabel linkLabel1;
|
||||||
|
private System.Windows.Forms.TabControl tabControl1;
|
||||||
|
private System.Windows.Forms.TabPage tabPage1;
|
||||||
|
private System.Windows.Forms.ListView listView1;
|
||||||
|
private System.Windows.Forms.ColumnHeader columnHeader1;
|
||||||
|
private System.Windows.Forms.TabPage tabPage2;
|
||||||
|
}
|
||||||
|
}
|
||||||
556
Project/Dialog/fLogin_WB.cs
Normal file
556
Project/Dialog/fLogin_WB.cs
Normal file
@@ -0,0 +1,556 @@
|
|||||||
|
using FCOMMON;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Net.NetworkInformation;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using Microsoft.Web.WebView2.Core;
|
||||||
|
using Microsoft.Web.WebView2.WinForms;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace Project.Dialog
|
||||||
|
{
|
||||||
|
public partial class fLogin_WB : fBase
|
||||||
|
{
|
||||||
|
private WebView2 webView21;
|
||||||
|
public fLogin_WB()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
InitializeWebView2();
|
||||||
|
this.tbID.KeyDown += (s1, e1) => { if (e1.KeyCode == Keys.Enter) tbPW.Focus(); };
|
||||||
|
this.tbPW.KeyDown += (s1, e1) => { if (e1.KeyCode == Keys.Enter) btLogin.PerformClick(); };
|
||||||
|
this.KeyPreview = true;
|
||||||
|
this.KeyDown += (s1, e1) =>
|
||||||
|
{
|
||||||
|
if (e1.KeyCode == Keys.Escape) this.Close();
|
||||||
|
};
|
||||||
|
this.Text = string.Format("사용자 확인(v{0})", Application.ProductVersion);
|
||||||
|
|
||||||
|
var lv = this.listView1.Items.Add("[25-04-06] 데이터베이스 이전 작업 완료 (버그신고:chikyun.kim@amkor.co.kr)");
|
||||||
|
lv.Tag = "기존 데이터베이스 삭제 예정으로 인한 신규 데이터베이스 업데이트 작업 완료\n일부 기능에 문제가 발생할 수 있습니다. 문제 발생시에는 chikyun.kim@amkor.co.kr 로 문의 주세요";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
private void InitializeWebView2()
|
||||||
|
{
|
||||||
|
// 수동으로 WebView2 컨트롤 생성
|
||||||
|
this.webView21 = new WebView2();
|
||||||
|
|
||||||
|
// 기본 속성 설정
|
||||||
|
this.webView21.CreationProperties = null;
|
||||||
|
this.webView21.DefaultBackgroundColor = Color.White;
|
||||||
|
this.webView21.Dock = DockStyle.Fill;
|
||||||
|
this.webView21.Location = new Point(0, 0);
|
||||||
|
this.webView21.Name = "webView21";
|
||||||
|
this.webView21.Size = new Size(800, 600);
|
||||||
|
this.webView21.TabIndex = 0;
|
||||||
|
this.webView21.ZoomFactor = 1D;
|
||||||
|
|
||||||
|
// 폼에 추가
|
||||||
|
this.Controls.Clear();
|
||||||
|
this.Controls.Add(this.webView21);
|
||||||
|
|
||||||
|
// 비동기 초기화
|
||||||
|
InitializeAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void InitializeAsync()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Fixed Version 경로 설정
|
||||||
|
string runtimePath = Path.Combine(Application.StartupPath, "WebView2Runtime");
|
||||||
|
|
||||||
|
if (Directory.Exists(runtimePath))
|
||||||
|
{
|
||||||
|
var env = await CoreWebView2Environment.CreateAsync(runtimePath);
|
||||||
|
await this.webView21.EnsureCoreWebView2Async(env);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 시스템에 설치된 WebView2 사용
|
||||||
|
await this.webView21.EnsureCoreWebView2Async();
|
||||||
|
}
|
||||||
|
// OWIN 서버의 DashBoard 페이지로 연결
|
||||||
|
webView21.Source = new Uri("http://127.0.0.1:9000/Home/Login");
|
||||||
|
label1.Visible = false;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"WebView2 초기화 실패: {ex.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
protected override void OnLoad(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnLoad(e);
|
||||||
|
EnsureVisibleAndUsableSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fLogin_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
//EnsureVisibleAndUsableSize();
|
||||||
|
var list = Pub.setting.lastid.Split(';');
|
||||||
|
foreach (var item in list)
|
||||||
|
if (item != "") tbID.Items.Add(item);
|
||||||
|
if (tbID.Items.Count > 0) tbID.SelectedIndex = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//S1 사용자 그룹목록 확인
|
||||||
|
//var tas1 = new S1ACCESS300Entities();
|
||||||
|
//var deptlist = tas1.VIEW_CARD_PERSON
|
||||||
|
// .Where(t => t.CardStatusID == 0 && string.IsNullOrEmpty(t.CardUser2) == false)
|
||||||
|
// .GroupBy(t => t.PersonUser2)
|
||||||
|
// .OrderBy(t => t.Key)
|
||||||
|
// .ToList();
|
||||||
|
|
||||||
|
//this.cmbDept.Items.Clear();
|
||||||
|
//foreach (var dept in deptlist)
|
||||||
|
// cmbDept.Items.Add(dept);
|
||||||
|
|
||||||
|
|
||||||
|
//그룹목록가져오기
|
||||||
|
//Util.MsgE(Properties.Settings.Default.CS);
|
||||||
|
var tagrp = new dsMSSQLTableAdapters.UserGroupTableAdapter();
|
||||||
|
//Util.MsgE(tagrp.Connection.ConnectionString);
|
||||||
|
var grplist = tagrp.GetData();
|
||||||
|
this.cmbDept.DataSource = grplist;
|
||||||
|
this.cmbDept.DisplayMember = "dept";
|
||||||
|
this.cmbDept.ValueMember = "gcode";
|
||||||
|
|
||||||
|
//마지막으로사용한 부서이름
|
||||||
|
if (Pub.setting.lastdpt.isEmpty()) this.cmbDept.SelectedIndex = -1;
|
||||||
|
else this.cmbDept.Text = Pub.setting.lastdpt;
|
||||||
|
if (cmbDept.SelectedIndex == -1 && Pub.setting.lastgcode.isEmpty() == false)
|
||||||
|
{
|
||||||
|
var dr = grplist.Where(t => t.gcode.Equals(Pub.setting.lastgcode)).FirstOrDefault();
|
||||||
|
if (dr != null) cmbDept.Text = dr.dept;
|
||||||
|
}
|
||||||
|
//foreach (var item in dlist)
|
||||||
|
// if (item != "") this.cmbDept.Items.Add(item);
|
||||||
|
//if (cmbDept.Items.Count > 0) cmbDept.SelectedIndex = 0;
|
||||||
|
|
||||||
|
this.Show();
|
||||||
|
Application.DoEvents();
|
||||||
|
|
||||||
|
if (this.tbID.Text.isEmpty() == false) tbPW.Focus();
|
||||||
|
else tbID.Focus();
|
||||||
|
}
|
||||||
|
private void button1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
DateTime dt = DateTime.Now;
|
||||||
|
|
||||||
|
//if(tbID.Text != "dev" && (dt.ToShortDateString() == "2025-04-05" ||
|
||||||
|
// dt.ToShortDateString() == "2025-04-06"))
|
||||||
|
//{
|
||||||
|
// Util.MsgE("4월 5일~6일은 데이터베이스 마이그레이션 기간이므로 프로그램 사용이 중단 됩니다\n문의 010-9155-9051 (EEDP:김치균)");
|
||||||
|
// return;
|
||||||
|
//}
|
||||||
|
if (this.tbID.Text.isEmpty())
|
||||||
|
{
|
||||||
|
tbID.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.tbPW.Text.isEmpty())
|
||||||
|
{
|
||||||
|
tbPW.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (cmbDept.SelectedIndex < 0)
|
||||||
|
{
|
||||||
|
FCOMMON.Util.MsgE("소속 부서를 선택하세요");
|
||||||
|
cmbDept.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> idlist = new List<string>();
|
||||||
|
idlist.Add(tbID.Text.Trim());
|
||||||
|
foreach (var item in this.tbID.Items)
|
||||||
|
if (idlist.Contains(item) == false) idlist.Add(item.ToString());
|
||||||
|
|
||||||
|
//List<string> deptlist = new List<string>();
|
||||||
|
//deptlist.Add(cmbDept.Text.Trim());
|
||||||
|
//foreach (var item in this.cmbDept.Items)
|
||||||
|
// if (deptlist.Contains(item) == false) deptlist.Add(item.ToString());
|
||||||
|
|
||||||
|
//180605
|
||||||
|
var vuserlist = "";
|
||||||
|
foreach (var item in idlist)
|
||||||
|
vuserlist += ";" + item;
|
||||||
|
|
||||||
|
//var vdeptlist = "";
|
||||||
|
//foreach(var item in deptlist)
|
||||||
|
// vdeptlist += ";" + item;
|
||||||
|
|
||||||
|
var gCode = this.cmbDept.SelectedValue.ToString();// as dsMSSQL.UserGroupRow;
|
||||||
|
|
||||||
|
Pub.setting.lastid = vuserlist;// tbID.Text.Trim();
|
||||||
|
Pub.setting.lastdpt = cmbDept.Text; //부서저장 201006
|
||||||
|
Pub.setting.lastgcode = gCode;
|
||||||
|
Pub.setting.Save();
|
||||||
|
|
||||||
|
var encpass = Pub.MakePasswordEnc(tbPW.Text.Trim());
|
||||||
|
var id = tbID.Text.Trim();
|
||||||
|
//var ta = new dsMSSQLTableAdapters.QueriesTableAdapter();//.UsersTableAdapter();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (id.ToUpper().Equals("DEV") == false)
|
||||||
|
{
|
||||||
|
var taGrpUser = new dsMSSQLTableAdapters.EETGW_GroupUserTableAdapter();
|
||||||
|
var drGrpUser = taGrpUser.GetbyID(gCode, id).FirstOrDefault();
|
||||||
|
if (drGrpUser == null)
|
||||||
|
{
|
||||||
|
Util.MsgE($"입력한 사용자 계정이 존재하지 않습니다\n\n담당부서명:{cmbDept.Text}\n부서코드:{gCode}\n\n접속 부서를 확인하시고 관리자 문의 하세요");
|
||||||
|
tbPW.SelectAll();
|
||||||
|
tbPW.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (drGrpUser.level == 0)
|
||||||
|
{
|
||||||
|
Util.MsgE($"해당 계정이 활성화되지 않았습니다\n계정 담당자 문의하세요");
|
||||||
|
tbPW.SelectAll();
|
||||||
|
tbPW.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//사용자테이블에서 암호를 확인합니다.
|
||||||
|
var taUser = new dsMSSQLTableAdapters.UsersTableAdapter();
|
||||||
|
var drUser = taUser.GetID(id).FirstOrDefault();
|
||||||
|
if (drUser == null)
|
||||||
|
{
|
||||||
|
Util.MsgE($"입력한 사용자 계정이 존재하지 않습니다\n\n담당부서명:{cmbDept.Text}\n부서코드:{gCode}\n\n접속 부서를 확인하시고 관리자 문의 하세요");
|
||||||
|
tbPW.SelectAll();
|
||||||
|
tbPW.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (drUser.password.Equals(encpass) == false)
|
||||||
|
{
|
||||||
|
Util.MsgE($"암호가 일치하지 않습니다.\n암호를 분실했을 경우에는 계정담당자에 초기화를 요청 하세요");
|
||||||
|
tbPW.SelectAll();
|
||||||
|
tbPW.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//이사용자의 부서 코드확인
|
||||||
|
//var taUser = new dsMSSQLTableAdapters.vGroupUserTableAdapter();
|
||||||
|
//var userdr = taUser.GetByID(userGcode, id).Rows[0] as dsMSSQL.vGroupUserRow;
|
||||||
|
|
||||||
|
var MaxVerstion = FCOMMON.DBM.GetMaxVersion();
|
||||||
|
if (MaxVerstion.isEmpty() == false)
|
||||||
|
{
|
||||||
|
var curversion = Application.ProductVersion;
|
||||||
|
var verchk = curversion.CompareTo(MaxVerstion);
|
||||||
|
if (verchk < 0)
|
||||||
|
{
|
||||||
|
//내버젼이 낮다
|
||||||
|
Util.MsgE("현재 구 버젼을 사용하고 있습니다.\n업데이트를 진행 하고 사용하시기 바랍니다");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FCOMMON.info.Login.no = drUser.id;
|
||||||
|
FCOMMON.info.Login.nameK = drUser.name;
|
||||||
|
FCOMMON.info.Login.dept = cmbDept.Text;// userdr.dept;// cmbDept.Text;
|
||||||
|
FCOMMON.info.Login.level = drGrpUser.level;
|
||||||
|
FCOMMON.info.Login.email = drUser.email;
|
||||||
|
FCOMMON.info.Login.nameE = drUser.nameE;
|
||||||
|
FCOMMON.info.Login.hp = drUser.hp;
|
||||||
|
FCOMMON.info.Login.tel = drUser.tel;
|
||||||
|
FCOMMON.info.Login.title = drUser.dept + "(" + drUser.grade + ")";
|
||||||
|
FCOMMON.info.NotShowJobReportview = Pub.setting.NotShowJobreportPRewView;
|
||||||
|
//var gcode = FCOMMON.DBM.ExecuteScalar("select isnull(gcode,'NOGCODE') from UserGroup where dept ='" + cmbDept.Text + "'");
|
||||||
|
var gperm = FCOMMON.DBM.ExecuteScalar("select isnull(permission,0) from UserGroup where dept ='" + cmbDept.Text + "'");
|
||||||
|
FCOMMON.info.Login.gcode = gCode;// gcode;
|
||||||
|
FCOMMON.info.Login.process = drUser.id == "dev" ? "개발자" : drGrpUser.Process;
|
||||||
|
FCOMMON.info.Login.permission = 0;
|
||||||
|
FCOMMON.info.Login.gpermission = int.Parse(gperm);
|
||||||
|
//FCOMMON.info.datapath = Pub.setting.SharedDataPath;
|
||||||
|
FCOMMON.info.ShowBuyerror = Pub.setting.Showbuyerror; //210625
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (tbPW.Text.Equals("123") == false)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
FCOMMON.info.Login.no = "dev";
|
||||||
|
FCOMMON.info.Login.nameK = "개발자";
|
||||||
|
FCOMMON.info.Login.dept = cmbDept.Text;// userdr.dept;// cmbDept.Text;
|
||||||
|
FCOMMON.info.Login.level = 10;
|
||||||
|
FCOMMON.info.Login.email = "";
|
||||||
|
FCOMMON.info.Login.nameE = "DEVELOPER";
|
||||||
|
FCOMMON.info.Login.hp = "";
|
||||||
|
FCOMMON.info.Login.tel = "";
|
||||||
|
FCOMMON.info.Login.title = "업무일지 개발자";
|
||||||
|
FCOMMON.info.NotShowJobReportview = Pub.setting.NotShowJobreportPRewView;
|
||||||
|
//var gcode = FCOMMON.DBM.ExecuteScalar("select isnull(gcode,'NOGCODE') from UserGroup where dept ='" + cmbDept.Text + "'");
|
||||||
|
var gperm = FCOMMON.DBM.ExecuteScalar("select isnull(permission,0) from UserGroup where dept ='" + cmbDept.Text + "'");
|
||||||
|
FCOMMON.info.Login.gcode = gCode;
|
||||||
|
FCOMMON.info.Login.process = "개발자";
|
||||||
|
FCOMMON.info.Login.permission = 0;
|
||||||
|
FCOMMON.info.Login.gpermission = int.Parse(gperm);
|
||||||
|
//var datapath = FCOMMON.DBM.getCodeSavlue("55", "01");
|
||||||
|
//FCOMMON.info.datapath = datapath;// Pub.setting.SharedDataPath;
|
||||||
|
FCOMMON.info.ShowBuyerror = Pub.setting.Showbuyerror; //210625
|
||||||
|
}
|
||||||
|
|
||||||
|
//if (FCOMMON.info.datapath.isEmpty() && gCode == "EET1P") //210524
|
||||||
|
// FCOMMON.info.datapath = @"\\k4fs3201n\k4bpartcenter$";
|
||||||
|
//using (var dbEnity = new EEEntitiesMain())
|
||||||
|
//{
|
||||||
|
// var drGrpUser = dbEnity.EETGW_GroupUser.Where(t => t.uid == userdr.id & t.gcode == gCode).FirstOrDefault();
|
||||||
|
// if (drGrpUser == null) FCOMMON.info.Login.process = (userdr.id == "dev" ? "개발자" : "");
|
||||||
|
// else FCOMMON.info.Login.process = drGrpUser.Process;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//로그인정보 기록
|
||||||
|
AddLoginInfo();
|
||||||
|
|
||||||
|
//210221
|
||||||
|
MakeAutoJobReportbyLogin();
|
||||||
|
|
||||||
|
//210613
|
||||||
|
MakeAutoJobReportByAuto();
|
||||||
|
|
||||||
|
DialogResult = DialogResult.OK;
|
||||||
|
FCOMMON.info.Login.loginusetime = (DateTime.Now - dt).TotalMilliseconds;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Util.MsgE("데이터베이스 조회 실패 다음 오류 메세지를 참고하세요.\n\n" + ex.Message + "\n\n증상이 동일 할 경우 서버가 접속가능한지 먼저 확인하세요");
|
||||||
|
DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 무조건 업무일지를 자동으로 작성하는 경우
|
||||||
|
/// </summary>
|
||||||
|
void MakeAutoJobReportByAuto()
|
||||||
|
{
|
||||||
|
//누군가가 로그인하면 당일 자동 생성되어야할 유저의 데이터를 기록한다.
|
||||||
|
|
||||||
|
var dbAI = new dsMSSQLTableAdapters.EETGW_JobReport_AutoInputTableAdapter();// EEEntitiesMain();
|
||||||
|
var dbGU = new dsMSSQLTableAdapters.vGroupUserTableAdapter();// EEEntitiesMain();
|
||||||
|
var dbHL = new dsMSSQLTableAdapters.HolidayLIstTableAdapter();
|
||||||
|
var dbJR = new dsMSSQLTableAdapters.JobReportTableAdapter();
|
||||||
|
var taQuery = new DSQueryTableAdapters.QueriesTableAdapter();
|
||||||
|
|
||||||
|
var nd = DateTime.Now.ToShortDateString();
|
||||||
|
|
||||||
|
//이 날짜가 휴일인지 체크한다.
|
||||||
|
var Holyinfo = dbHL.GetData(nd).FirstOrDefault();// db.HolidayLIst.Where(t => t.pdate == nd).FirstOrDefault();
|
||||||
|
if (Holyinfo != null && Holyinfo.IsfreeNull() == false && Holyinfo.free == true) return;
|
||||||
|
|
||||||
|
|
||||||
|
//토,일은 처리하지 않음
|
||||||
|
if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday || DateTime.Now.DayOfWeek == DayOfWeek.Sunday) return;
|
||||||
|
|
||||||
|
// db.EETGW_JobReport_AutoInput.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.enable == true && t.autoinput == "A" && t.pdate.CompareTo(nd) <= 0 && (string.IsNullOrEmpty(t.edate) == true || t.edate.CompareTo(nd) > 0));
|
||||||
|
var rows = dbAI.GetActiveList(info.Login.gcode, "A", "%", nd);
|
||||||
|
|
||||||
|
foreach (var dr in rows)
|
||||||
|
{
|
||||||
|
//퇴사자 확인
|
||||||
|
var userdata = dbGU.GetByID(FCOMMON.info.Login.gcode, dr.uid).FirstOrDefault();// db.vGroupUser.Where(t => t.id == dr.uid).FirstOrDefault();
|
||||||
|
if (userdata != null && userdata.IsoutdateNull() == false) continue;
|
||||||
|
|
||||||
|
//오늘자 자동생성된 데이터가 있다면 처리하지 않는다
|
||||||
|
if (taQuery.ExistAutoInputData(info.Login.gcode, dr.uid, nd) > 0) continue; //db.JobReport.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.pdate == nd && t.uid == dr.uid && t.autoinput == true).Any())
|
||||||
|
|
||||||
|
//이데이터를 그대로 생성해준다.
|
||||||
|
var dtjr = new dsMSSQL.JobReportDataTable();
|
||||||
|
var newdr = dtjr.NewJobReportRow();
|
||||||
|
newdr.gcode = FCOMMON.info.Login.gcode;
|
||||||
|
newdr.wuid = dr.uid;// FCOMMON.info.Login.no;
|
||||||
|
newdr.wdate = DateTime.Now;
|
||||||
|
newdr.pdate = nd;
|
||||||
|
newdr.import = false;
|
||||||
|
newdr.hrs = dr.hrs;
|
||||||
|
newdr.type = dr.type;//210305 누락분 추가
|
||||||
|
newdr.ot = dr.ot;
|
||||||
|
newdr.process = dr.process;
|
||||||
|
newdr.projectName = dr.projectName;
|
||||||
|
newdr.pidx = dr.pidx;
|
||||||
|
newdr.package = dr.package;
|
||||||
|
newdr.autoinput = true;
|
||||||
|
newdr.description = dr.description;
|
||||||
|
newdr.description2 = dr.description2;
|
||||||
|
newdr.remark = dr.remark;
|
||||||
|
newdr.requestpart = dr.requestpart;
|
||||||
|
newdr.status = dr.status;
|
||||||
|
newdr.tag = dr.tag;
|
||||||
|
newdr.uid = dr.uid;
|
||||||
|
dtjr.AddJobReportRow(newdr);
|
||||||
|
dbJR.Update(dtjr);
|
||||||
|
}
|
||||||
|
dbAI.Dispose();
|
||||||
|
dbGU.Dispose();
|
||||||
|
dbHL.Dispose();
|
||||||
|
dbJR.Dispose();
|
||||||
|
taQuery.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 로그인으로 업무일지를 작성하는 경우
|
||||||
|
/// </summary>
|
||||||
|
void MakeAutoJobReportbyLogin()
|
||||||
|
{
|
||||||
|
//자동로그인 업무일지 기록 기능 추가 = 210220
|
||||||
|
//select* from EETGW_JobReport_AutoInput where gcode = 'EET1P' and pdate <= '2021-02-20' and(edate is null or edate > '2021-02-20') and autoinput = 'L'
|
||||||
|
var nd = DateTime.Now.ToShortDateString();
|
||||||
|
|
||||||
|
var taQ = new DSQueryTableAdapters.QueriesTableAdapter();
|
||||||
|
var exist = taQ.ExistAutoInputData(info.Login.gcode, info.Login.no, nd) > 0;
|
||||||
|
//var db = new EEEntitiesMain();
|
||||||
|
|
||||||
|
if (exist == false)
|
||||||
|
{
|
||||||
|
var taM = new dsMSSQLTableAdapters.EETGW_JobReport_AutoInputTableAdapter();
|
||||||
|
var rows = taM.GetActiveList(info.Login.gcode, "L", info.Login.no, nd);
|
||||||
|
|
||||||
|
//var rows = db.EETGW_JobReport_AutoInput.Where(t => t.gcode == FCOMMON.info.Login.gcode &&
|
||||||
|
//t.enable == true &&
|
||||||
|
//t.autoinput == "L" &&
|
||||||
|
//t.uid == FCOMMON.info.Login.no &&
|
||||||
|
//t.pdate.CompareTo(nd) <= 0 && (string.IsNullOrEmpty(t.edate) == true || t.edate.CompareTo(nd) > 0));
|
||||||
|
|
||||||
|
var newjob = new dsMSSQL.JobReportDataTable();
|
||||||
|
foreach (var dr in rows)
|
||||||
|
{
|
||||||
|
//이데이터를 그대로 생성해준다.
|
||||||
|
var newdr = newjob.NewJobReportRow();
|
||||||
|
newdr.gcode = FCOMMON.info.Login.gcode;
|
||||||
|
newdr.wuid = FCOMMON.info.Login.no;
|
||||||
|
newdr.wdate = DateTime.Now;
|
||||||
|
newdr.pdate = nd;
|
||||||
|
newdr.import = false;
|
||||||
|
if (dr.IshrsNull() == false) newdr.hrs = dr.hrs;
|
||||||
|
if (dr.IstypeNull() == false) newdr.type = dr.type;//210305 누락분 추가
|
||||||
|
if (dr.IsotNull() == false) newdr.ot = dr.ot;
|
||||||
|
if (dr.IsprocessNull() == false) newdr.process = dr.process;
|
||||||
|
if (dr.IsprojectNameNull() == false) newdr.projectName = dr.projectName;
|
||||||
|
if (dr.IspidxNull() == false) newdr.pidx = dr.pidx;
|
||||||
|
if (dr.IspackageNull() == false) newdr.package = dr.package;
|
||||||
|
newdr.autoinput = true;
|
||||||
|
if (dr.IsdescriptionNull() == false) newdr.description = dr.description;
|
||||||
|
if (dr.Isdescription2Null() == false) newdr.description2 = dr.description2;
|
||||||
|
if (dr.IsremarkNull() == false) newdr.remark = dr.remark;
|
||||||
|
if (dr.IsrequestpartNull() == false) newdr.requestpart = dr.requestpart;
|
||||||
|
if (dr.IsstatusNull() == false) newdr.status = dr.status;
|
||||||
|
if (dr.IstagNull() == false) newdr.tag = dr.tag;
|
||||||
|
if (dr.IsuidNull() == false) newdr.uid = dr.uid;
|
||||||
|
newjob.AddJobReportRow(newdr);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (newjob.Count() > 0)
|
||||||
|
{
|
||||||
|
var taJ = new dsMSSQLTableAdapters.JobReportTableAdapter();
|
||||||
|
var cnt = taJ.Update(newjob);
|
||||||
|
//db.SaveChanges();
|
||||||
|
Util.MsgI($"{cnt} 건의 업무일지가 자동 생성 되었습니다\n업무일지는 로그인시 최초 1회 자동 등록됩니다\n" +
|
||||||
|
"자동입력을 해제하려면 '업무일지-자동입력' 화면에서 내역을 변경하거나 종료일자를 설정하시기 바랍니다");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddLoginInfo()
|
||||||
|
{
|
||||||
|
string ip = string.Empty;
|
||||||
|
string hostname = Dns.GetHostName();
|
||||||
|
string fullname = System.Net.Dns.GetHostEntry("").HostName;
|
||||||
|
|
||||||
|
var nif = NetworkInterface.GetAllNetworkInterfaces();
|
||||||
|
var host = Dns.GetHostEntry(hostname);
|
||||||
|
foreach (IPAddress r in host.AddressList)
|
||||||
|
{
|
||||||
|
string str = r.ToString();
|
||||||
|
|
||||||
|
if (str != "" && str.Substring(0, 3) == "10.")
|
||||||
|
{
|
||||||
|
ip = str;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ip == "" || hostname == "") return;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var ta = new dsMSSQLTableAdapters.EETGW_LoginInfoTableAdapter();
|
||||||
|
ta.Insert(FCOMMON.info.Login.no, DateTime.Now, ip, fullname, info.Login.no, DateTime.Now);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
FCOMMON.Util.MsgE(ex.Message);
|
||||||
|
Console.WriteLine(ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||||
|
{
|
||||||
|
FCOMMON.Util.RunExplorer("mailto:chikyun.kim@amkor.co.kr");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cmbDept_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
//부서명이 변경되었다
|
||||||
|
label4.Text = "문의) 정보없음(?)";
|
||||||
|
var sel = cmbDept.SelectedItem as DataRowView;
|
||||||
|
if (sel == null) return;
|
||||||
|
var dr = sel.Row as dsMSSQL.UserGroupRow;
|
||||||
|
if (dr == null) return;
|
||||||
|
|
||||||
|
var admin = dr.managerinfo;
|
||||||
|
if (string.IsNullOrEmpty(admin))
|
||||||
|
admin = "--";
|
||||||
|
|
||||||
|
var dev = dr.devinfo;
|
||||||
|
if (string.IsNullOrEmpty(dev))
|
||||||
|
dev = "chikyun.kim@amkor.co.kr(T8567)";
|
||||||
|
|
||||||
|
label4.Text = $"문의) 관리:{admin},개발:{dev}";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||||
|
{
|
||||||
|
//if (System.Diagnostics.Debugger.IsAttached == false)
|
||||||
|
//{
|
||||||
|
// Util.MsgE("이 기능은 준비중 입니다");
|
||||||
|
// return;
|
||||||
|
//}
|
||||||
|
|
||||||
|
var gCode = this.cmbDept.SelectedValue.ToString();// as dsMSSQL.UserGroupRow;
|
||||||
|
FCOMMON.info.Login.gcode = gCode;
|
||||||
|
FCOMMON.info.Login.no = "new";
|
||||||
|
FCOMMON.info.Login.dept = this.cmbDept.Text;
|
||||||
|
|
||||||
|
var dlg = FCOMMON.Util.MsgQ($"현재 선택된 그룹[{this.cmbDept.Text}]의 사용자를 추가할까요?\n" +
|
||||||
|
"추가된 사용자는 담당자로부터 승인 완료되어야 접속이 가능 합니다\n" +
|
||||||
|
"사용자 추가 후 그룹담당자에게 문의 하시기 바랍니다");
|
||||||
|
if (dlg != DialogResult.Yes) return;
|
||||||
|
var f = new _Common.fAddNewUser(cmbDept.Text, string.Empty, 0);//.fUserInfo();
|
||||||
|
dlg = f.ShowDialog();
|
||||||
|
if (dlg == DialogResult.OK)
|
||||||
|
{
|
||||||
|
tbID.Text = f.tbId.Text.Trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void listView1_MouseDoubleClick(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
var lv = this.listView1.FocusedItem;
|
||||||
|
if (lv == null) return;
|
||||||
|
if (lv.Tag == null) return;
|
||||||
|
var msg = lv.Tag.ToString();
|
||||||
|
Util.MsgI(msg);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
160
Project/Dialog/fLogin_WB.resx
Normal file
160
Project/Dialog/fLogin_WB.resx
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||||
|
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>
|
||||||
|
iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAb
|
||||||
|
rQAAG60BIeRSlQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAeaSURBVHhe7Vrr
|
||||||
|
bxRVFK9+8ItRY/Qf8BE1auIravykRpjdlvcbFCMkxsREfACKxmCqobszW55CUikgL5ECkoLQIkTjB9md
|
||||||
|
2W6rQmm7te1SmijvtpQ3FMZzZs+F6fYMULZ3d7adX/ILZM+555z768w9985MngcPHoao1fcpochwRTNC
|
||||||
|
PlWvBDYD21PYpGh6BfyroW9+oXEvDR+cKCw071S0yGifGtkGolwEmn0kjDHKgaMwFoUdBDDNO/zByBQQ
|
||||||
|
oD5FkHRYB5xIGQYu8kPhR2Civ9om3q/0q5HdQ4KxhyndwAJddV2pk7bxkF+LLIdb+k1fSH9+xPzqB4cF
|
||||||
|
/7gfif9XgsYLlk3VS32a3pYy1s5OyDWB0g4AwC0Lkw8wE0V2gxhl+aHIq31Zx9DXH9Rf82nGZisGG9v4
|
||||||
|
GnPTkBwFTAAEKmEnGNR3FASij5HnbcOv7X2cunPvHJA7p0X0BSPfMBM7C1fO2+TSb4Arcpqi6ueYfBq5
|
||||||
|
5BaUoD6JmcwxXMvIpd/hD4ZfhBwnUnKacIW+RS65AbjyHoXCUxvG8fyA8SS5SINSFH4acp1MyX0qp7oz
|
||||||
|
bCd+S5nAeZ8WeYnM0uEPhF+BnBd61mD8QmZ3g7t1YW16n8wZA+SckVoHbG/GkNmdwO0FFNrQs/DITjJn
|
||||||
|
HJAfz9W2WvQ6Vx/74K+en1JwtxKIPEHmjMOnVj2FNdhrguXFR2b3AYrbYi8WBF1PpqwBtkw/2mvCjTuZ
|
||||||
|
3IWR2t57oMAeC7cS0F8mc9ZADeV6TbBXVIr33U1m98AfMArshQKbyJRd4GlI1RP22oYGDYWs7gHcGqq9
|
||||||
|
SGgey8iUdSiq8V3P2vQiMrkHeLa1F4lPX8iUdfhVY6q9NnyISyb3AAprtBc5NBR+lkxZR/JRmF1AvZ5M
|
||||||
|
7gEU1eP49EYg+gCZsg58nmivDXiMTO4BFHXJXuSEwrq7yJR1YC322oAXyOQepBRo0s+ugdvr8wRMF24v
|
||||||
|
0O31eQKmC7cX6Pb6PAH7gvxg5DnYzX8FheyBI1wt/HvUXlyO8CjVDnMw5srf+OP7XdWYDAl7nDgGFo04
|
||||||
|
PlHv91eh+P4WEtSIRBOXVpuBHQmzorbDjBw8ax44csk82Hk1p4g1Y+0Vte3WXCZ8W31NSL8aieGLMZp+
|
||||||
|
elBUfQQEPY2Bp5b8ZW6tOW4mOviicpk4J5wbzpGE7MLP6EiG2wOsDa9DIOuI9vmmRjN+optNPpAYP37Z
|
||||||
|
nFPWKES8iJ+dkBx9g/UllZZ8QFBc2WommGQDlXg1ahUHLRHhDjyhFEcfIlluEcmnuFEM8FlZfEDesjcj
|
||||||
|
znn2xri4EsN9aiyKZozHgZOW1liXNJdgMLD+2GWrYaIWt/5OOXn1We92N0SPsoEHE9frR8RVWEcK3Rj4
|
||||||
|
cSMOmLLsT7Ol4wobdDARNZi8rIZEjD5DMjkDHIvQOVTRygaUzXDijJV7+vK/zbGLYxanl+6zGlkY9m3c
|
||||||
|
GNlUqaHg53okkzPA8Xd03rm/nQ0mi80nr5jBnQkzXzPELdOLaMPJNLdn9s7Ysa/dyo8fTZFMzgDHf9A5
|
||||||
|
eugcG0wGUbyPf6hPihQyzNmbE+bq2GmzvP6SxdVVXfBbi1lA4n6yod4aw8WSQaP1LP0RjTjJ5AxwtE4d
|
||||||
|
mey+835usQocu6TGXFt92qxsvspyDYg6bnFyPcLjFxdLBlGLpIB6F8nkDHJkA8kgrnl+TTeHFUfNdTVn
|
||||||
|
WOHsRIELQlHrdo4kMrcmCl1IJmdkWkCxQH+xtZUVjOOcn5JjsLFwMWVQ6EIyOUM4ckFkcBp0W8yHax4n
|
||||||
|
FsfvYU3EMdiduZgyKHQhmZwhHLkgMjhyQZWVb3tjNysWx+3x5JqEY7mYMih0IZmcIRy5IDI4emFSwPKG
|
||||||
|
y6xYHLEz45gxi2JsTBkUupBMzhCOXBAZfHflfivfqugpViyOK4xT1pj3Vu1nY8qg0IVkcoZw5ILIIDYC
|
||||||
|
zDdrUwsrFseZ4Itj5u/ymohZBRt23MbgtmQlXFmcYHauMDotXxxT1XaejSmDrhUQuWj3ISvnqIUxSyBO
|
||||||
|
OGSp3glrZszyXbKnjY0li0IXkskZwpELIot4tp21scHKi8e1udvazMqm68JVNF0xvyxvu3aU+3RjPONP
|
||||||
|
ioQuJJMzhCMXRCZRELEe4vbEfuVVAIfPT3Zr9MnGYzahC8nkDOHIBZHNPQ2dVu5pKw70EBD5TmmtZUMf
|
||||||
|
bqxsCl1IJmcIRy6IbK7e+5+VG7tsqoAzy5Kdd034MDtWNoUuJJMzhCMXRDbxCQvmLtr1by8B58FvaMNn
|
||||||
|
htxY2RS6kEzOEI5cENn8YG2dlbsk3NFLwJJw8qHmjHV17FjZFLqQTM4QjlwQ2Ry3JPkGbEvthV4Cbobf
|
||||||
|
0DYefLixsil0IZmcIRy5IDJZe/iilXfkglgv8QTRhj7oy8WQSaELyeQM4cgFkcnd9c4dWBBt6JONTix0
|
||||||
|
IZmcIRy5IDJ5ow4smM1OLHQhmZwhHLkgMik6MHZbTjxkNjux0IVkcoZw5ILI5IfQXUXum/Gj9ZnvxCI3
|
||||||
|
yeQM4cgFkUnRgW+F6MvFkEmRm2RyhnDkggxmegKmSU/ANOkJmCY9AdOkJ2Ca9ARMk56AabLPAnrkSTI5
|
||||||
|
gxvk8TpJJg8ePHjwkJeX9z9IbqKdvJUGzgAAAABJRU5ErkJggg==
|
||||||
|
</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
@@ -259,19 +259,25 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="BaseController.cs" />
|
<Compile Include="Dialog\fLogin_WB.cs">
|
||||||
<Compile Include="Controller\APIController.cs" />
|
<SubType>Form</SubType>
|
||||||
<Compile Include="Controller\DashBoardController.cs" />
|
</Compile>
|
||||||
<Compile Include="Controller\ManualController.cs" />
|
<Compile Include="Dialog\fLogin_WB.Designer.cs">
|
||||||
<Compile Include="Controller\ProjectController.cs" />
|
<DependentUpon>fLogin_WB.cs</DependentUpon>
|
||||||
<Compile Include="Controller\JobreportController.cs" />
|
</Compile>
|
||||||
<Compile Include="Controller\CustomerController.cs" />
|
<Compile Include="Web\Controller\BaseController.cs" />
|
||||||
<Compile Include="Controller\PurchaseController.cs" />
|
<Compile Include="Web\Controller\APIController.cs" />
|
||||||
<Compile Include="Controller\ItemController.cs" />
|
<Compile Include="Web\Controller\DashBoardController.cs" />
|
||||||
<Compile Include="Controller\HomeController.cs" />
|
<Compile Include="Web\Controller\ManualController.cs" />
|
||||||
<Compile Include="Controller\ResourceController.cs" />
|
<Compile Include="Web\Controller\ProjectController.cs" />
|
||||||
<Compile Include="Controller\ResultController.cs" />
|
<Compile Include="Web\Controller\JobreportController.cs" />
|
||||||
<Compile Include="Controller\SettingController.cs" />
|
<Compile Include="Web\Controller\CustomerController.cs" />
|
||||||
|
<Compile Include="Web\Controller\PurchaseController.cs" />
|
||||||
|
<Compile Include="Web\Controller\ItemController.cs" />
|
||||||
|
<Compile Include="Web\Controller\HomeController.cs" />
|
||||||
|
<Compile Include="Web\Controller\ResourceController.cs" />
|
||||||
|
<Compile Include="Web\Controller\ResultController.cs" />
|
||||||
|
<Compile Include="Web\Controller\SettingController.cs" />
|
||||||
<Compile Include="CResult.cs" />
|
<Compile Include="CResult.cs" />
|
||||||
<Compile Include="DataSet1.Designer.cs">
|
<Compile Include="DataSet1.Designer.cs">
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
@@ -392,9 +398,9 @@
|
|||||||
<Compile Include="Manager\ModelManager.cs" />
|
<Compile Include="Manager\ModelManager.cs" />
|
||||||
<Compile Include="MessageWindow.cs" />
|
<Compile Include="MessageWindow.cs" />
|
||||||
<Compile Include="MethodExtentions.cs" />
|
<Compile Include="MethodExtentions.cs" />
|
||||||
<Compile Include="Model\PageModel.cs" />
|
<Compile Include="Web\Model\PageModel.cs" />
|
||||||
<Compile Include="OWIN\Startup.cs" />
|
<Compile Include="Web\Startup.cs" />
|
||||||
<Compile Include="OWIN\StartupSSE.cs" />
|
<Compile Include="Web\StartupSSE.cs" />
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
<Compile Include="Settings.cs" />
|
<Compile Include="Settings.cs" />
|
||||||
<Compile Include="SqlServerTypes\Loader.cs" />
|
<Compile Include="SqlServerTypes\Loader.cs" />
|
||||||
@@ -463,6 +469,9 @@
|
|||||||
<EmbeddedResource Include="Dialog\fDebug.resx">
|
<EmbeddedResource Include="Dialog\fDebug.resx">
|
||||||
<DependentUpon>fDebug.cs</DependentUpon>
|
<DependentUpon>fDebug.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Dialog\fLogin_WB.resx">
|
||||||
|
<DependentUpon>fLogin_WB.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Dialog\fMsgWindow.resx">
|
<EmbeddedResource Include="Dialog\fMsgWindow.resx">
|
||||||
<DependentUpon>fMsgWindow.cs</DependentUpon>
|
<DependentUpon>fMsgWindow.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
@@ -624,10 +633,16 @@
|
|||||||
<Content Include="SqlServerTypes\x86\SqlServerSpatial140.dll">
|
<Content Include="SqlServerTypes\x86\SqlServerSpatial140.dll">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<None Include="View\intro.html">
|
<Content Include="Web\wwwroot\DashBoard\index.html">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="Web\wwwroot\login.html">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<None Include="Web\wwwroot\index.html">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Include="View\dashboard.html">
|
<None Include="Web\wwwroot\dashboard.html">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@@ -712,6 +727,9 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<WCFMetadata Include="Connected Services\" />
|
<WCFMetadata Include="Connected Services\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Web\wwwroot\js\" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<Import Project="..\packages\Microsoft.Web.WebView2.1.0.2210.55\build\Microsoft.Web.WebView2.targets" Condition="Exists('..\packages\Microsoft.Web.WebView2.1.0.2210.55\build\Microsoft.Web.WebView2.targets')" />
|
<Import Project="..\packages\Microsoft.Web.WebView2.1.0.2210.55\build\Microsoft.Web.WebView2.targets" Condition="Exists('..\packages\Microsoft.Web.WebView2.1.0.2210.55\build\Microsoft.Web.WebView2.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using Project.Web.Model;
|
||||||
|
using System.Data;
|
||||||
|
|
||||||
namespace Project.Manager
|
namespace Project.Manager
|
||||||
{
|
{
|
||||||
@@ -14,6 +16,38 @@ namespace Project.Manager
|
|||||||
cn.ConnectionString = cs;
|
cn.ConnectionString = cs;
|
||||||
return cn;
|
return cn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 입력된 id의 그룹정보를 반환
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="gcode"></param>
|
||||||
|
/// <param name="uid"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static GroupUserModel GetGroupUser(string gcode, string uid)
|
||||||
|
{
|
||||||
|
var retval = new GroupUserModel();
|
||||||
|
var cn = getCn();
|
||||||
|
|
||||||
|
var sql = "select * from EETGW_GroupUser where gcode = @gcode and uid = @uid";
|
||||||
|
var cmd = new System.Data.SqlClient.SqlCommand(sql,cn);
|
||||||
|
cmd.Parameters.Add("gcode", SqlDbType.VarChar).Value = gcode;
|
||||||
|
cmd.Parameters.Add("uid", SqlDbType.VarChar).Value = uid;
|
||||||
|
cn.Open();
|
||||||
|
var rdr = cmd.ExecuteReader();
|
||||||
|
var cnt = 0;
|
||||||
|
foreach(var dr in rdr)
|
||||||
|
{
|
||||||
|
cnt += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
retval.Gcode = gcode;
|
||||||
|
retval.uid = uid;
|
||||||
|
|
||||||
|
cn.Dispose();
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static List<String> getGroupList(string GroupColumn, string table, string where = "")
|
public static List<String> getGroupList(string GroupColumn, string table, string where = "")
|
||||||
{
|
{
|
||||||
List<string> retval = new List<string>();
|
List<string> retval = new List<string>();
|
||||||
|
|||||||
@@ -1,79 +0,0 @@
|
|||||||
using Microsoft.Owin;
|
|
||||||
using Owin;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Web.Http;
|
|
||||||
using System.Web.Http.Routing;
|
|
||||||
|
|
||||||
namespace Project.OWIN
|
|
||||||
{
|
|
||||||
public class Startup
|
|
||||||
{
|
|
||||||
public void Configuration(IAppBuilder app)
|
|
||||||
{
|
|
||||||
// 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);
|
|
||||||
|
|
||||||
app.UseStaticFiles();
|
|
||||||
app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);
|
|
||||||
app.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
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
intro file
|
|
||||||
@@ -1,148 +1,148 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Web.Http;
|
using System.Web.Http;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Project
|
namespace Project.Web.Controllers
|
||||||
{
|
{
|
||||||
public class APIController : BaseController
|
public class APIController : BaseController
|
||||||
{
|
{
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage Getdata()
|
public HttpResponseMessage Getdata()
|
||||||
{
|
{
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
var sql = string.Empty;
|
var sql = string.Empty;
|
||||||
var p_sql = getParams.Where(t => t.Key == "sql").FirstOrDefault();
|
var p_sql = getParams.Where(t => t.Key == "sql").FirstOrDefault();
|
||||||
if (p_sql.Key.isEmpty() == false) sql = p_sql.Value;
|
if (p_sql.Key.isEmpty() == false) sql = p_sql.Value;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var p_table = getParams.Where(t => t.Key == "table").FirstOrDefault();
|
var p_table = getParams.Where(t => t.Key == "table").FirstOrDefault();
|
||||||
var p_gcode = getParams.Where(t => t.Key == "gcode").FirstOrDefault();
|
var p_gcode = getParams.Where(t => t.Key == "gcode").FirstOrDefault();
|
||||||
var p_where = getParams.Where(t => t.Key == "w").FirstOrDefault();
|
var p_where = getParams.Where(t => t.Key == "w").FirstOrDefault();
|
||||||
var p_order = getParams.Where(t => t.Key == "o").FirstOrDefault();
|
var p_order = getParams.Where(t => t.Key == "o").FirstOrDefault();
|
||||||
sql = "select * from {0} where gcode = '{gcode}'";
|
sql = "select * from {0} where gcode = '{gcode}'";
|
||||||
sql = string.Format(sql, p_table.Value, p_gcode.Value);
|
sql = string.Format(sql, p_table.Value, p_gcode.Value);
|
||||||
if (p_where.Key != null) sql += " and " + p_where.Value;
|
if (p_where.Key != null) sql += " and " + p_where.Value;
|
||||||
if (p_order.Key != null) sql += " order by " + p_order.Value;
|
if (p_order.Key != null) sql += " order by " + p_order.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (FCOMMON.info.Login.gcode == null)
|
if (FCOMMON.info.Login.gcode == null)
|
||||||
FCOMMON.info.Login.gcode = "EET1P";
|
FCOMMON.info.Login.gcode = "EET1P";
|
||||||
sql = sql.Replace("{gcode}", FCOMMON.info.Login.gcode);
|
sql = sql.Replace("{gcode}", FCOMMON.info.Login.gcode);
|
||||||
|
|
||||||
var cs = Properties.Settings.Default.gwcs; // "Data Source=K4FASQL.kr.ds.amkor.com,50150;Initial Catalog=EE;Persist Security Info=True;User ID=eeadm;Password=uJnU8a8q&DJ+ug-D!";
|
var cs = Properties.Settings.Default.gwcs; // "Data Source=K4FASQL.kr.ds.amkor.com,50150;Initial Catalog=EE;Persist Security Info=True;User ID=eeadm;Password=uJnU8a8q&DJ+ug-D!";
|
||||||
var cn = new System.Data.SqlClient.SqlConnection(cs);
|
var cn = new System.Data.SqlClient.SqlConnection(cs);
|
||||||
var cmd = new System.Data.SqlClient.SqlCommand(sql, cn);
|
var cmd = new System.Data.SqlClient.SqlCommand(sql, cn);
|
||||||
var da = new System.Data.SqlClient.SqlDataAdapter(cmd);
|
var da = new System.Data.SqlClient.SqlDataAdapter(cmd);
|
||||||
var dt = new System.Data.DataTable();
|
var dt = new System.Data.DataTable();
|
||||||
da.Fill(dt);
|
da.Fill(dt);
|
||||||
da.Dispose();
|
da.Dispose();
|
||||||
cmd.Dispose();
|
cmd.Dispose();
|
||||||
cn.Dispose();
|
cn.Dispose();
|
||||||
|
|
||||||
var txtjson = JsonConvert.SerializeObject(dt, new JsonSerializerSettings
|
var txtjson = JsonConvert.SerializeObject(dt, new JsonSerializerSettings
|
||||||
{
|
{
|
||||||
NullValueHandling = NullValueHandling.Ignore
|
NullValueHandling = NullValueHandling.Ignore
|
||||||
});
|
});
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
var resp = new HttpResponseMessage()
|
||||||
{
|
{
|
||||||
Content = new StringContent(
|
Content = new StringContent(
|
||||||
txtjson,
|
txtjson,
|
||||||
System.Text.Encoding.UTF8,
|
System.Text.Encoding.UTF8,
|
||||||
"application/json")
|
"application/json")
|
||||||
};
|
};
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage Gettable()
|
public HttpResponseMessage Gettable()
|
||||||
{
|
{
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
var sql = string.Empty;
|
var sql = string.Empty;
|
||||||
var p_sql = getParams.Where(t => t.Key == "sql").FirstOrDefault();
|
var p_sql = getParams.Where(t => t.Key == "sql").FirstOrDefault();
|
||||||
if (p_sql.Key.isEmpty() == false) sql = p_sql.Value;
|
if (p_sql.Key.isEmpty() == false) sql = p_sql.Value;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var p_table = getParams.Where(t => t.Key == "table").FirstOrDefault();
|
var p_table = getParams.Where(t => t.Key == "table").FirstOrDefault();
|
||||||
var p_gcode = getParams.Where(t => t.Key == "gcode").FirstOrDefault();
|
var p_gcode = getParams.Where(t => t.Key == "gcode").FirstOrDefault();
|
||||||
var p_where = getParams.Where(t => t.Key == "w").FirstOrDefault();
|
var p_where = getParams.Where(t => t.Key == "w").FirstOrDefault();
|
||||||
var p_order = getParams.Where(t => t.Key == "o").FirstOrDefault();
|
var p_order = getParams.Where(t => t.Key == "o").FirstOrDefault();
|
||||||
sql = "select * from {0} where gcode = '{gcode}'";
|
sql = "select * from {0} where gcode = '{gcode}'";
|
||||||
sql = string.Format(sql, p_table.Value, p_gcode.Value);
|
sql = string.Format(sql, p_table.Value, p_gcode.Value);
|
||||||
if (p_where.Key != null) sql += " and " + p_where.Value;
|
if (p_where.Key != null) sql += " and " + p_where.Value;
|
||||||
if (p_order.Key != null) sql += " order by " + p_order.Value;
|
if (p_order.Key != null) sql += " order by " + p_order.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (FCOMMON.info.Login.gcode == null)
|
if (FCOMMON.info.Login.gcode == null)
|
||||||
FCOMMON.info.Login.gcode = "EET1P";
|
FCOMMON.info.Login.gcode = "EET1P";
|
||||||
sql = sql.Replace("{gcode}", FCOMMON.info.Login.gcode);
|
sql = sql.Replace("{gcode}", FCOMMON.info.Login.gcode);
|
||||||
|
|
||||||
var cs = Properties.Settings.Default.gwcs;// "Data Source=K4FASQL.kr.ds.amkor.com,50150;Initial Catalog=EE;Persist Security Info=True;User ID=eeadm;Password=uJnU8a8q&DJ+ug-D!";
|
var cs = Properties.Settings.Default.gwcs;// "Data Source=K4FASQL.kr.ds.amkor.com,50150;Initial Catalog=EE;Persist Security Info=True;User ID=eeadm;Password=uJnU8a8q&DJ+ug-D!";
|
||||||
var cn = new System.Data.SqlClient.SqlConnection(cs);
|
var cn = new System.Data.SqlClient.SqlConnection(cs);
|
||||||
var cmd = new System.Data.SqlClient.SqlCommand(sql, cn);
|
var cmd = new System.Data.SqlClient.SqlCommand(sql, cn);
|
||||||
var da = new System.Data.SqlClient.SqlDataAdapter(cmd);
|
var da = new System.Data.SqlClient.SqlDataAdapter(cmd);
|
||||||
var dt = new System.Data.DataTable();
|
var dt = new System.Data.DataTable();
|
||||||
da.Fill(dt);
|
da.Fill(dt);
|
||||||
da.Dispose();
|
da.Dispose();
|
||||||
cmd.Dispose();
|
cmd.Dispose();
|
||||||
cn.Dispose();
|
cn.Dispose();
|
||||||
|
|
||||||
var txtjson = JsonConvert.SerializeObject(dt, new JsonSerializerSettings
|
var txtjson = JsonConvert.SerializeObject(dt, new JsonSerializerSettings
|
||||||
{
|
{
|
||||||
NullValueHandling = NullValueHandling.Ignore
|
NullValueHandling = NullValueHandling.Ignore
|
||||||
});
|
});
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
var resp = new HttpResponseMessage()
|
||||||
{
|
{
|
||||||
Content = new StringContent(
|
Content = new StringContent(
|
||||||
txtjson,
|
txtjson,
|
||||||
System.Text.Encoding.UTF8,
|
System.Text.Encoding.UTF8,
|
||||||
"application/json")
|
"application/json")
|
||||||
};
|
};
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage Index()
|
public HttpResponseMessage Index()
|
||||||
{
|
{
|
||||||
//로그인이 되어있지않다면 로그인을 가져온다
|
//로그인이 되어있지않다면 로그인을 가져온다
|
||||||
MethodResult result;
|
MethodResult result;
|
||||||
result = View();
|
result = View();
|
||||||
|
|
||||||
var model = GetGlobalModel();
|
var model = GetGlobalModel();
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
//기본값을 찾아서 없애줘야한다
|
//기본값을 찾아서 없애줘야한다
|
||||||
var contents = result.Content;
|
var contents = result.Content;
|
||||||
|
|
||||||
//공용값 적용
|
//공용값 적용
|
||||||
ApplyCommonValue(ref contents);
|
ApplyCommonValue(ref contents);
|
||||||
|
|
||||||
//최종문자 적용
|
//최종문자 적용
|
||||||
result.Content = contents;
|
result.Content = contents;
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
var resp = new HttpResponseMessage()
|
||||||
{
|
{
|
||||||
Content = new StringContent(
|
Content = new StringContent(
|
||||||
result.Content,
|
result.Content,
|
||||||
System.Text.Encoding.UTF8,
|
System.Text.Encoding.UTF8,
|
||||||
"text/html")
|
"text/html")
|
||||||
};
|
};
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,318 +1,318 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Web.Http;
|
using System.Web.Http;
|
||||||
using agi = HtmlAgilityPack;
|
using agi = HtmlAgilityPack;
|
||||||
|
|
||||||
|
|
||||||
namespace Project
|
namespace Project.Web.Controllers
|
||||||
{
|
{
|
||||||
public struct MethodResult : IEquatable<MethodResult>
|
public struct MethodResult : IEquatable<MethodResult>
|
||||||
{
|
{
|
||||||
public string Content;
|
public string Content;
|
||||||
public byte[] Contentb;
|
public byte[] Contentb;
|
||||||
public string Redirecturl;
|
public string Redirecturl;
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if (!(obj is MethodResult))
|
if (!(obj is MethodResult))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return Equals((MethodResult)obj);
|
return Equals((MethodResult)obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int GetHashCode()
|
public override int GetHashCode()
|
||||||
{
|
{
|
||||||
if (Contentb == null)
|
if (Contentb == null)
|
||||||
return Content.GetHashCode() ^ Redirecturl.GetHashCode();
|
return Content.GetHashCode() ^ Redirecturl.GetHashCode();
|
||||||
else
|
else
|
||||||
return Content.GetHashCode() ^ Redirecturl.GetHashCode() ^ Contentb.GetHexString().GetHashCode();
|
return Content.GetHashCode() ^ Redirecturl.GetHashCode() ^ Contentb.GetHexString().GetHashCode();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(MethodResult other)
|
public bool Equals(MethodResult other)
|
||||||
{
|
{
|
||||||
if (Content != other.Content)
|
if (Content != other.Content)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (Redirecturl != other.Redirecturl)
|
if (Redirecturl != other.Redirecturl)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return Contentb == other.Contentb;
|
return Contentb == other.Contentb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static bool operator ==(MethodResult point1, MethodResult point2)
|
public static bool operator ==(MethodResult point1, MethodResult point2)
|
||||||
{
|
{
|
||||||
return point1.Equals(point2);
|
return point1.Equals(point2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool operator !=(MethodResult point1, MethodResult point2)
|
public static bool operator !=(MethodResult point1, MethodResult point2)
|
||||||
{
|
{
|
||||||
return !point1.Equals(point2);
|
return !point1.Equals(point2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class PostRequest : Attribute
|
sealed class PostRequest : Attribute
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BaseController : ApiController
|
public class BaseController : ApiController
|
||||||
{
|
{
|
||||||
public string QueryString { get; set; }
|
public string QueryString { get; set; }
|
||||||
public string PostData { get; set; }
|
public string PostData { get; set; }
|
||||||
public string ParamData { get; set; }
|
public string ParamData { get; set; }
|
||||||
|
|
||||||
protected string Trig_Ctrl { get; set; }
|
protected string Trig_Ctrl { get; set; }
|
||||||
protected string Trig_func { get; set; }
|
protected string Trig_func { get; set; }
|
||||||
|
|
||||||
public PageModel GetGlobalModel()
|
public PageModel GetGlobalModel()
|
||||||
{
|
{
|
||||||
var config = RequestContext.Configuration;
|
var config = RequestContext.Configuration;
|
||||||
var routeData = config.Routes.GetRouteData(Request).Values.ToList();
|
var routeData = config.Routes.GetRouteData(Request).Values.ToList();
|
||||||
var name_ctrl = routeData[0].Value.ToString();
|
var name_ctrl = routeData[0].Value.ToString();
|
||||||
var name_action = routeData[1].Value.ToString();
|
var name_action = routeData[1].Value.ToString();
|
||||||
|
|
||||||
|
|
||||||
return new PageModel
|
return new PageModel
|
||||||
{
|
{
|
||||||
RouteData = routeData,
|
RouteData = routeData,
|
||||||
urlcontrol = name_ctrl,
|
urlcontrol = name_ctrl,
|
||||||
urlaction = name_action
|
urlaction = name_action
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public MethodResult View(bool nosubdir=false)
|
public MethodResult View(bool nosubdir=false)
|
||||||
{
|
{
|
||||||
var config = RequestContext.Configuration;
|
var config = RequestContext.Configuration;
|
||||||
if (config != null)
|
if (config != null)
|
||||||
{
|
{
|
||||||
var routeData = config.Routes.GetRouteData(Request).Values.ToList();
|
var routeData = config.Routes.GetRouteData(Request).Values.ToList();
|
||||||
var name_ctrl = routeData[0].Value.ToString();
|
var name_ctrl = routeData[0].Value.ToString();
|
||||||
if (nosubdir) name_ctrl = string.Empty;
|
if (nosubdir) name_ctrl = string.Empty;
|
||||||
var name_action = routeData[1].Value.ToString();
|
var name_action = routeData[1].Value.ToString();
|
||||||
return View(name_ctrl, name_action);
|
return View(name_ctrl, name_action);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return View(Trig_Ctrl + "/" + Trig_func);
|
return View(Trig_Ctrl + "/" + Trig_func);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void ApplyCommonValue(ref string contents)
|
public static void ApplyCommonValue(ref string contents)
|
||||||
{
|
{
|
||||||
//메뉴 푸터 - 개발자 정보
|
//메뉴 푸터 - 개발자 정보
|
||||||
if (contents.Contains("{title}"))
|
if (contents.Contains("{title}"))
|
||||||
contents = contents.Replace("{title}", FCOMMON.info.Login.gcode + " Groupware");
|
contents = contents.Replace("{title}", FCOMMON.info.Login.gcode + " Groupware");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MethodResult View(string Controller, string Action, Boolean applydefaultview = true)
|
public MethodResult View(string Controller, string Action, Boolean applydefaultview = true)
|
||||||
{
|
{
|
||||||
var retval = new MethodResult();
|
var retval = new MethodResult();
|
||||||
|
|
||||||
if (Action.IndexOf(".") == -1)
|
if (Action.IndexOf(".") == -1)
|
||||||
Action += ".html"; //기본값 html 을 넣는다
|
Action += ".html"; //기본값 html 을 넣는다
|
||||||
|
|
||||||
var file = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "View", Controller, Action);
|
var file = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "View", Controller, Action);
|
||||||
|
|
||||||
var contents = string.Empty;
|
var contents = string.Empty;
|
||||||
|
|
||||||
if (System.IO.File.Exists(file) == false)
|
if (System.IO.File.Exists(file) == false)
|
||||||
{
|
{
|
||||||
//error 폴더의 404.html 파일을 찾는다.
|
//error 폴더의 404.html 파일을 찾는다.
|
||||||
var file404 = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "View", "Error", "404.html");
|
var file404 = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "View", "Error", "404.html");
|
||||||
if (System.IO.File.Exists(file404))
|
if (System.IO.File.Exists(file404))
|
||||||
{
|
{
|
||||||
contents = System.IO.File.ReadAllText(file404, System.Text.Encoding.UTF8);
|
contents = System.IO.File.ReadAllText(file404, System.Text.Encoding.UTF8);
|
||||||
contents = contents.Replace("{errorfilename}", file);
|
contents = contents.Replace("{errorfilename}", file);
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
contents = "ERROR CODE - 404 (NOT FOUND) <br />" + file;
|
contents = "ERROR CODE - 404 (NOT FOUND) <br />" + file;
|
||||||
|
|
||||||
Console.WriteLine("view File not found : " + file);
|
Console.WriteLine("view File not found : " + file);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//디폴트뷰의 내용을 가져온다 (있다면 적용한다)
|
//디폴트뷰의 내용을 가져온다 (있다면 적용한다)
|
||||||
if (applydefaultview)
|
if (applydefaultview)
|
||||||
{
|
{
|
||||||
//뷰파일이 있다면 그것을 적용한다
|
//뷰파일이 있다면 그것을 적용한다
|
||||||
var laytoutfile = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "View", "Layout", "default.html");
|
var laytoutfile = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "View", "Layout", "default.html");
|
||||||
if (System.IO.File.Exists(laytoutfile))
|
if (System.IO.File.Exists(laytoutfile))
|
||||||
contents = System.IO.File.ReadAllText(laytoutfile, System.Text.Encoding.UTF8);
|
contents = System.IO.File.ReadAllText(laytoutfile, System.Text.Encoding.UTF8);
|
||||||
|
|
||||||
var fileContents = System.IO.File.ReadAllText(file, System.Text.Encoding.UTF8);
|
var fileContents = System.IO.File.ReadAllText(file, System.Text.Encoding.UTF8);
|
||||||
if (String.IsNullOrEmpty(contents)) contents = fileContents;
|
if (String.IsNullOrEmpty(contents)) contents = fileContents;
|
||||||
else contents = contents.Replace("{contents}", fileContents);
|
else contents = contents.Replace("{contents}", fileContents);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//해당 뷰를 가져와서 반환한다
|
//해당 뷰를 가져와서 반환한다
|
||||||
contents = System.IO.File.ReadAllText(file, System.Text.Encoding.UTF8);
|
contents = System.IO.File.ReadAllText(file, System.Text.Encoding.UTF8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
agi.HtmlDocument doc = new agi.HtmlDocument();
|
agi.HtmlDocument doc = new agi.HtmlDocument();
|
||||||
doc.LoadHtml(contents);
|
doc.LoadHtml(contents);
|
||||||
|
|
||||||
//파일참조 태그를 모두 가져옴
|
//파일참조 태그를 모두 가져옴
|
||||||
var tags_include = doc.QuerySelectorAll("include");
|
var tags_include = doc.QuerySelectorAll("include");
|
||||||
foreach (var item in tags_include)
|
foreach (var item in tags_include)
|
||||||
{
|
{
|
||||||
var filename = item.InnerText;
|
var filename = item.InnerText;
|
||||||
|
|
||||||
var load_file = String.Concat(AppDomain.CurrentDomain.BaseDirectory, "View", filename.Replace("/", "\\"));
|
var load_file = String.Concat(AppDomain.CurrentDomain.BaseDirectory, "View", filename.Replace("/", "\\"));
|
||||||
load_file = load_file.Replace("\\\\", "\\");
|
load_file = load_file.Replace("\\\\", "\\");
|
||||||
String fileContents;// = String.Empty;
|
String fileContents;// = String.Empty;
|
||||||
|
|
||||||
Console.WriteLine("## " + item.OuterHtml);
|
Console.WriteLine("## " + item.OuterHtml);
|
||||||
if (System.IO.File.Exists(load_file))
|
if (System.IO.File.Exists(load_file))
|
||||||
{
|
{
|
||||||
fileContents = System.IO.File.ReadAllText(load_file, System.Text.Encoding.UTF8);
|
fileContents = System.IO.File.ReadAllText(load_file, System.Text.Encoding.UTF8);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fileContents = string.Format("<div class=\"fg-red\">#include Error:nofile:{0}</div>",
|
fileContents = string.Format("<div class=\"fg-red\">#include Error:nofile:{0}</div>",
|
||||||
filename); //파일이없다면 해당 부분은 오류 처리한다.
|
filename); //파일이없다면 해당 부분은 오류 처리한다.
|
||||||
}
|
}
|
||||||
contents = contents.Replace(item.OuterHtml, fileContents);
|
contents = contents.Replace(item.OuterHtml, fileContents);
|
||||||
}
|
}
|
||||||
|
|
||||||
//콘텐츠내의 file 을 찾아서 처리한다. ; 정규식의 처리속도가 느릴듯하여, 그냥 처리해본다
|
//콘텐츠내의 file 을 찾아서 처리한다. ; 정규식의 처리속도가 느릴듯하여, 그냥 처리해본다
|
||||||
|
|
||||||
|
|
||||||
//시스템변수 replace
|
//시스템변수 replace
|
||||||
contents = contents.Replace("{param_control}", Trig_Ctrl);
|
contents = contents.Replace("{param_control}", Trig_Ctrl);
|
||||||
contents = contents.Replace("{param_function}", Trig_func);
|
contents = contents.Replace("{param_function}", Trig_func);
|
||||||
|
|
||||||
retval.Content = contents;
|
retval.Content = contents;
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
public MethodResult View(string viewfilename, Boolean applydefaultview = true)
|
public MethodResult View(string viewfilename, Boolean applydefaultview = true)
|
||||||
{
|
{
|
||||||
var retval = new MethodResult();
|
var retval = new MethodResult();
|
||||||
|
|
||||||
if (viewfilename.IndexOf(".") == -1)
|
if (viewfilename.IndexOf(".") == -1)
|
||||||
viewfilename += ".html"; //기본값 html 을 넣는다
|
viewfilename += ".html"; //기본값 html 을 넣는다
|
||||||
|
|
||||||
var file = AppDomain.CurrentDomain.BaseDirectory + "View" + viewfilename.Replace("/", "\\");
|
var file = AppDomain.CurrentDomain.BaseDirectory + "View" + viewfilename.Replace("/", "\\");
|
||||||
|
|
||||||
var contents = string.Empty;
|
var contents = string.Empty;
|
||||||
|
|
||||||
if (System.IO.File.Exists(file) == false)
|
if (System.IO.File.Exists(file) == false)
|
||||||
{
|
{
|
||||||
//error 폴더의 404.html 파일을 찾는다.
|
//error 폴더의 404.html 파일을 찾는다.
|
||||||
var file404 = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "View", "Error", "404.html");
|
var file404 = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "View", "Error", "404.html");
|
||||||
if (System.IO.File.Exists(file404))
|
if (System.IO.File.Exists(file404))
|
||||||
{
|
{
|
||||||
contents = System.IO.File.ReadAllText(file404, System.Text.Encoding.UTF8);
|
contents = System.IO.File.ReadAllText(file404, System.Text.Encoding.UTF8);
|
||||||
contents = contents.Replace("{errorfilename}", file);
|
contents = contents.Replace("{errorfilename}", file);
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
contents = "ERROR CODE - 404 (NOT FOUND) <br />" + file;
|
contents = "ERROR CODE - 404 (NOT FOUND) <br />" + file;
|
||||||
|
|
||||||
Console.WriteLine("view File not found : " + file);
|
Console.WriteLine("view File not found : " + file);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//디폴트뷰의 내용을 가져온다 (있다면 적용한다)
|
//디폴트뷰의 내용을 가져온다 (있다면 적용한다)
|
||||||
if (applydefaultview)
|
if (applydefaultview)
|
||||||
{
|
{
|
||||||
//뷰파일이 있다면 그것을 적용한다
|
//뷰파일이 있다면 그것을 적용한다
|
||||||
var laytoutfile = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "View", "Layout", "default.html");
|
var laytoutfile = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "View", "Layout", "default.html");
|
||||||
if (System.IO.File.Exists(laytoutfile))
|
if (System.IO.File.Exists(laytoutfile))
|
||||||
contents = System.IO.File.ReadAllText(laytoutfile, System.Text.Encoding.UTF8);
|
contents = System.IO.File.ReadAllText(laytoutfile, System.Text.Encoding.UTF8);
|
||||||
|
|
||||||
var fileContents = System.IO.File.ReadAllText(file, System.Text.Encoding.UTF8);
|
var fileContents = System.IO.File.ReadAllText(file, System.Text.Encoding.UTF8);
|
||||||
if (String.IsNullOrEmpty(contents)) contents = fileContents;
|
if (String.IsNullOrEmpty(contents)) contents = fileContents;
|
||||||
else contents = contents.Replace("{contents}", fileContents);
|
else contents = contents.Replace("{contents}", fileContents);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//해당 뷰를 가져와서 반환한다
|
//해당 뷰를 가져와서 반환한다
|
||||||
contents = System.IO.File.ReadAllText(file, System.Text.Encoding.UTF8);
|
contents = System.IO.File.ReadAllText(file, System.Text.Encoding.UTF8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
agi.HtmlDocument doc = new agi.HtmlDocument();
|
agi.HtmlDocument doc = new agi.HtmlDocument();
|
||||||
doc.LoadHtml(contents);
|
doc.LoadHtml(contents);
|
||||||
|
|
||||||
//파일참조 태그를 모두 가져옴
|
//파일참조 태그를 모두 가져옴
|
||||||
var tags_include = doc.QuerySelectorAll("include");
|
var tags_include = doc.QuerySelectorAll("include");
|
||||||
foreach (var item in tags_include)
|
foreach (var item in tags_include)
|
||||||
{
|
{
|
||||||
var filename = item.InnerText;
|
var filename = item.InnerText;
|
||||||
|
|
||||||
var load_file = String.Concat(AppDomain.CurrentDomain.BaseDirectory, "View", filename.Replace("/", "\\"));
|
var load_file = String.Concat(AppDomain.CurrentDomain.BaseDirectory, "View", filename.Replace("/", "\\"));
|
||||||
load_file = load_file.Replace("\\\\", "\\");
|
load_file = load_file.Replace("\\\\", "\\");
|
||||||
String fileContents;// = String.Empty;
|
String fileContents;// = String.Empty;
|
||||||
|
|
||||||
Console.WriteLine("## " + item.OuterHtml);
|
Console.WriteLine("## " + item.OuterHtml);
|
||||||
if (System.IO.File.Exists(load_file))
|
if (System.IO.File.Exists(load_file))
|
||||||
{
|
{
|
||||||
fileContents = System.IO.File.ReadAllText(load_file, System.Text.Encoding.UTF8);
|
fileContents = System.IO.File.ReadAllText(load_file, System.Text.Encoding.UTF8);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fileContents = string.Format("<div class=\"fg-red\">#include Error:nofile:{0}</div>",
|
fileContents = string.Format("<div class=\"fg-red\">#include Error:nofile:{0}</div>",
|
||||||
filename); //파일이없다면 해당 부분은 오류 처리한다.
|
filename); //파일이없다면 해당 부분은 오류 처리한다.
|
||||||
}
|
}
|
||||||
contents = contents.Replace(item.OuterHtml, fileContents);
|
contents = contents.Replace(item.OuterHtml, fileContents);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//콘텐츠내의 file 을 찾아서 처리한다. ; 정규식의 처리속도가 느릴듯하여, 그냥 처리해본다
|
//콘텐츠내의 file 을 찾아서 처리한다. ; 정규식의 처리속도가 느릴듯하여, 그냥 처리해본다
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
var fileindexS = contents.IndexOf("{file:");
|
var fileindexS = contents.IndexOf("{file:");
|
||||||
if (fileindexS == -1) break;
|
if (fileindexS == -1) break;
|
||||||
var fileindexE = contents.IndexOf("}", fileindexS);
|
var fileindexE = contents.IndexOf("}", fileindexS);
|
||||||
if (fileindexE == -1) break;
|
if (fileindexE == -1) break;
|
||||||
if (fileindexE <= fileindexS + 5) break;
|
if (fileindexE <= fileindexS + 5) break;
|
||||||
var inlinestr = contents.Substring(fileindexS, fileindexE - fileindexS + 1);
|
var inlinestr = contents.Substring(fileindexS, fileindexE - fileindexS + 1);
|
||||||
var filename = contents.Substring(fileindexS + 7, fileindexE - fileindexS - 8);
|
var filename = contents.Substring(fileindexS + 7, fileindexE - fileindexS - 8);
|
||||||
var load_file = String.Concat(AppDomain.CurrentDomain.BaseDirectory, "View", "\\", filename.Replace("/", "\\"));
|
var load_file = String.Concat(AppDomain.CurrentDomain.BaseDirectory, "View", "\\", filename.Replace("/", "\\"));
|
||||||
load_file = load_file.Replace("\\\\", "\\");
|
load_file = load_file.Replace("\\\\", "\\");
|
||||||
String fileContents;// = String.Empty;
|
String fileContents;// = String.Empty;
|
||||||
|
|
||||||
Console.WriteLine("file impot : " + load_file);
|
Console.WriteLine("file impot : " + load_file);
|
||||||
if (System.IO.File.Exists(load_file))
|
if (System.IO.File.Exists(load_file))
|
||||||
{
|
{
|
||||||
fileContents = System.IO.File.ReadAllText(load_file, System.Text.Encoding.UTF8);
|
fileContents = System.IO.File.ReadAllText(load_file, System.Text.Encoding.UTF8);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fileContents = "{FileNotFound:" + filename + "}"; //파일이없다면 해당 부분은 오류 처리한다.
|
fileContents = "{FileNotFound:" + filename + "}"; //파일이없다면 해당 부분은 오류 처리한다.
|
||||||
}
|
}
|
||||||
contents = contents.Replace(inlinestr, fileContents);
|
contents = contents.Replace(inlinestr, fileContents);
|
||||||
}
|
}
|
||||||
|
|
||||||
//시스템변수 replace
|
//시스템변수 replace
|
||||||
contents = contents.Replace("{param_control}", Trig_Ctrl);
|
contents = contents.Replace("{param_control}", Trig_Ctrl);
|
||||||
contents = contents.Replace("{param_function}", Trig_func);
|
contents = contents.Replace("{param_function}", Trig_func);
|
||||||
|
|
||||||
retval.Content = contents;
|
retval.Content = contents;
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
protected class Parameter
|
protected class Parameter
|
||||||
{
|
{
|
||||||
public string Key { get; set; }
|
public string Key { get; set; }
|
||||||
public string Value { get; set; }
|
public string Value { get; set; }
|
||||||
public Parameter(string key_, string value_)
|
public Parameter(string key_, string value_)
|
||||||
{
|
{
|
||||||
Key = key_;
|
Key = key_;
|
||||||
Value = value_;
|
Value = value_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,198 +1,198 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Web.Http;
|
using System.Web.Http;
|
||||||
|
|
||||||
namespace Project
|
namespace Project.Web.Controllers
|
||||||
{
|
{
|
||||||
public class CustomerController : BaseController
|
public class CustomerController : BaseController
|
||||||
{
|
{
|
||||||
|
|
||||||
// PUT api/values/5
|
// PUT api/values/5
|
||||||
public void Put(int id, [FromBody] string value)
|
public void Put(int id, [FromBody] string value)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// DELETE api/values/5
|
// DELETE api/values/5
|
||||||
public void Delete(int id)
|
public void Delete(int id)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public string Test()
|
public string Test()
|
||||||
{
|
{
|
||||||
return "test";
|
return "test";
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage Find()
|
public HttpResponseMessage Find()
|
||||||
{
|
{
|
||||||
//로그인이 되어있지않다면 로그인을 가져온다
|
//로그인이 되어있지않다면 로그인을 가져온다
|
||||||
MethodResult result;
|
MethodResult result;
|
||||||
result = View();
|
result = View();
|
||||||
|
|
||||||
|
|
||||||
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
|
|
||||||
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
||||||
var model = GetGlobalModel();
|
var model = GetGlobalModel();
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
//기본값을 찾아서 없애줘야한다
|
//기본값을 찾아서 없애줘야한다
|
||||||
var searchkey = string.Empty;
|
var searchkey = string.Empty;
|
||||||
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
||||||
|
|
||||||
var tbody = new System.Text.StringBuilder();
|
var tbody = new System.Text.StringBuilder();
|
||||||
|
|
||||||
//테이블데이터생성
|
//테이블데이터생성
|
||||||
var itemcnt = 0;
|
var itemcnt = 0;
|
||||||
if (searchkey.isEmpty() == false)
|
if (searchkey.isEmpty() == false)
|
||||||
{
|
{
|
||||||
var db = new dsMSSQLTableAdapters.CustomsTableAdapter();//.custrom EEEntitiesCommon();
|
var db = new dsMSSQLTableAdapters.CustomsTableAdapter();//.custrom EEEntitiesCommon();
|
||||||
var rows = db.GetData(FCOMMON.info.Login.gcode);// db.Customs.Where(t => t.gcode == FCOMMON.info.Login.gcode).OrderBy(t => t.name);
|
var rows = db.GetData(FCOMMON.info.Login.gcode);// db.Customs.Where(t => t.gcode == FCOMMON.info.Login.gcode).OrderBy(t => t.name);
|
||||||
itemcnt = rows.Count();
|
itemcnt = rows.Count();
|
||||||
foreach (var item in rows)
|
foreach (var item in rows)
|
||||||
{
|
{
|
||||||
tbody.AppendLine("<tr>");
|
tbody.AppendLine("<tr>");
|
||||||
tbody.AppendLine($"<th scope='row'>{item.name}</th>");
|
tbody.AppendLine($"<th scope='row'>{item.name}</th>");
|
||||||
tbody.AppendLine($"<td>{item.name2}</td>");
|
tbody.AppendLine($"<td>{item.name2}</td>");
|
||||||
tbody.AppendLine($"<td>{item.name}</td>");
|
tbody.AppendLine($"<td>{item.name}</td>");
|
||||||
//tbody.AppendLine($"<td>{item.model}</td>");
|
//tbody.AppendLine($"<td>{item.model}</td>");
|
||||||
|
|
||||||
//if (item.price == null)
|
//if (item.price == null)
|
||||||
// tbody.AppendLine($"<td>--</td>");
|
// tbody.AppendLine($"<td>--</td>");
|
||||||
//else
|
//else
|
||||||
//{
|
//{
|
||||||
// var price = (double)item.price / 1000.0;
|
// var price = (double)item.price / 1000.0;
|
||||||
|
|
||||||
// tbody.AppendLine($"<td>{price.ToString("N0")}</td>");
|
// tbody.AppendLine($"<td>{price.ToString("N0")}</td>");
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
//tbody.AppendLine($"<td>{item.manu}</td>");
|
//tbody.AppendLine($"<td>{item.manu}</td>");
|
||||||
//tbody.AppendLine($"<td>{item.supply}</td>");
|
//tbody.AppendLine($"<td>{item.supply}</td>");
|
||||||
|
|
||||||
//if (item.remark.Length > 10)
|
//if (item.remark.Length > 10)
|
||||||
// tbody.AppendLine($"<td>{item.remark.Substring(0, 10)}...</td>");
|
// tbody.AppendLine($"<td>{item.remark.Substring(0, 10)}...</td>");
|
||||||
//else
|
//else
|
||||||
// tbody.AppendLine($"<td>{item.remark}</td>");
|
// tbody.AppendLine($"<td>{item.remark}</td>");
|
||||||
tbody.AppendLine("</tr>");
|
tbody.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//아잍쳄이 없는경우
|
//아잍쳄이 없는경우
|
||||||
if (itemcnt == 0)
|
if (itemcnt == 0)
|
||||||
{
|
{
|
||||||
tbody.AppendLine("<tr>");
|
tbody.AppendLine("<tr>");
|
||||||
tbody.AppendLine("<th scope='row'>1</th>");
|
tbody.AppendLine("<th scope='row'>1</th>");
|
||||||
tbody.AppendLine("<td colspan='6'>자료가 없습니다</td>");
|
tbody.AppendLine("<td colspan='6'>자료가 없습니다</td>");
|
||||||
tbody.AppendLine("</tr>");
|
tbody.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var contents = result.Content.Replace("{search}", searchkey);
|
var contents = result.Content.Replace("{search}", searchkey);
|
||||||
contents = contents.Replace("{tabledata}", tbody.ToString());
|
contents = contents.Replace("{tabledata}", tbody.ToString());
|
||||||
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
||||||
|
|
||||||
|
|
||||||
//공용값 적용
|
//공용값 적용
|
||||||
ApplyCommonValue(ref contents);
|
ApplyCommonValue(ref contents);
|
||||||
|
|
||||||
//최종문자 적용
|
//최종문자 적용
|
||||||
result.Content = contents;
|
result.Content = contents;
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
var resp = new HttpResponseMessage()
|
||||||
{
|
{
|
||||||
Content = new StringContent(
|
Content = new StringContent(
|
||||||
result.Content,
|
result.Content,
|
||||||
System.Text.Encoding.UTF8,
|
System.Text.Encoding.UTF8,
|
||||||
"text/html")
|
"text/html")
|
||||||
};
|
};
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage Index()
|
public HttpResponseMessage Index()
|
||||||
{
|
{
|
||||||
//로그인이 되어있지않다면 로그인을 가져온다
|
//로그인이 되어있지않다면 로그인을 가져온다
|
||||||
MethodResult result;
|
MethodResult result;
|
||||||
result = View();
|
result = View();
|
||||||
|
|
||||||
|
|
||||||
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
|
|
||||||
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
||||||
var model = GetGlobalModel();
|
var model = GetGlobalModel();
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
//기본값을 찾아서 없애줘야한다
|
//기본값을 찾아서 없애줘야한다
|
||||||
var searchkey = string.Empty;
|
var searchkey = string.Empty;
|
||||||
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
||||||
|
|
||||||
var tbody = new System.Text.StringBuilder();
|
var tbody = new System.Text.StringBuilder();
|
||||||
|
|
||||||
//테이블데이터생성
|
//테이블데이터생성
|
||||||
var itemcnt = 0;
|
var itemcnt = 0;
|
||||||
//if (searchkey.isEmpty() == false)
|
//if (searchkey.isEmpty() == false)
|
||||||
{
|
{
|
||||||
var db = new dsMSSQLTableAdapters.CustomsTableAdapter();// EEEntitiesCommon();
|
var db = new dsMSSQLTableAdapters.CustomsTableAdapter();// EEEntitiesCommon();
|
||||||
var sd = DateTime.Now.ToString("yyyy-MM-01");
|
var sd = DateTime.Now.ToString("yyyy-MM-01");
|
||||||
var rows = db.GetData(FCOMMON.info.Login.gcode);// .Customs.AsNoTracking().Where(t => t.gcode == FCOMMON.info.Login.gcode).OrderBy(t=>t.name);
|
var rows = db.GetData(FCOMMON.info.Login.gcode);// .Customs.AsNoTracking().Where(t => t.gcode == FCOMMON.info.Login.gcode).OrderBy(t=>t.name);
|
||||||
itemcnt = rows.Count();
|
itemcnt = rows.Count();
|
||||||
foreach (var item in rows)
|
foreach (var item in rows)
|
||||||
{
|
{
|
||||||
tbody.AppendLine("<tr>");
|
tbody.AppendLine("<tr>");
|
||||||
tbody.AppendLine($"<th scope='row'>{item.grp}</th>");
|
tbody.AppendLine($"<th scope='row'>{item.grp}</th>");
|
||||||
tbody.AppendLine($"<td>{item.name}</td>");
|
tbody.AppendLine($"<td>{item.name}</td>");
|
||||||
tbody.AppendLine($"<td>{item.name2}</td>");
|
tbody.AppendLine($"<td>{item.name2}</td>");
|
||||||
tbody.AppendLine($"<td>{item.tel}</td>");
|
tbody.AppendLine($"<td>{item.tel}</td>");
|
||||||
tbody.AppendLine($"<td>{item.fax}</td>");
|
tbody.AppendLine($"<td>{item.fax}</td>");
|
||||||
tbody.AppendLine($"<td>{item.email}</td>");
|
tbody.AppendLine($"<td>{item.email}</td>");
|
||||||
tbody.AppendLine($"<td>{item.address}</td>");
|
tbody.AppendLine($"<td>{item.address}</td>");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty( item.memo)==false && item.memo.Length > 10) tbody.AppendLine($"<td>{item.memo.Substring(0, 10)}...</td>");
|
if (string.IsNullOrEmpty( item.memo)==false && item.memo.Length > 10) tbody.AppendLine($"<td>{item.memo.Substring(0, 10)}...</td>");
|
||||||
else tbody.AppendLine($"<td>{item.memo}</td>");
|
else tbody.AppendLine($"<td>{item.memo}</td>");
|
||||||
|
|
||||||
tbody.AppendLine("</tr>");
|
tbody.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//아잍쳄이 없는경우
|
//아잍쳄이 없는경우
|
||||||
if (itemcnt == 0)
|
if (itemcnt == 0)
|
||||||
{
|
{
|
||||||
tbody.AppendLine("<tr>");
|
tbody.AppendLine("<tr>");
|
||||||
tbody.AppendLine("<th scope='row'>1</th>");
|
tbody.AppendLine("<th scope='row'>1</th>");
|
||||||
tbody.AppendLine("<td colspan='6'>자료가 없습니다</td>");
|
tbody.AppendLine("<td colspan='6'>자료가 없습니다</td>");
|
||||||
tbody.AppendLine("</tr>");
|
tbody.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var contents = result.Content.Replace("{search}", searchkey);
|
var contents = result.Content.Replace("{search}", searchkey);
|
||||||
contents = contents.Replace("{tabledata}", tbody.ToString());
|
contents = contents.Replace("{tabledata}", tbody.ToString());
|
||||||
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
||||||
|
|
||||||
|
|
||||||
//공용값 적용
|
//공용값 적용
|
||||||
ApplyCommonValue(ref contents);
|
ApplyCommonValue(ref contents);
|
||||||
|
|
||||||
//최종문자 적용
|
//최종문자 적용
|
||||||
result.Content = contents;
|
result.Content = contents;
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
var resp = new HttpResponseMessage()
|
||||||
{
|
{
|
||||||
Content = new StringContent(
|
Content = new StringContent(
|
||||||
result.Content,
|
result.Content,
|
||||||
System.Text.Encoding.UTF8,
|
System.Text.Encoding.UTF8,
|
||||||
"text/html")
|
"text/html")
|
||||||
};
|
};
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,115 +1,116 @@
|
|||||||
using FCOMMON;
|
using FCOMMON;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Web.Http;
|
using System.Web.Http;
|
||||||
|
|
||||||
namespace Project
|
namespace Project.Web.Controllers
|
||||||
{
|
{
|
||||||
public class DashBoardController : BaseController
|
public class DashBoardController : BaseController
|
||||||
{
|
{
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public void Index([FromBody] string value)
|
public void Index([FromBody] string value)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PUT api/values/5
|
// PUT api/values/5
|
||||||
public void Put(int id, [FromBody] string value)
|
public void Put(int id, [FromBody] string value)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// DELETE api/values/5
|
// DELETE api/values/5
|
||||||
public void Delete(int id)
|
public void Delete(int id)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public string TodayCountH()
|
public string TodayCountH()
|
||||||
{
|
{
|
||||||
|
|
||||||
var sql = "select count(*) from EETGW_HolydayRequest " +
|
var sql = "select count(*) from EETGW_HolydayRequest " +
|
||||||
"where gcode = 'EET1P' and conf = 1 and HolyDays > 0 and " +
|
"where gcode = 'EET1P' and conf = 1 and HolyDays > 0 and " +
|
||||||
"sdate <= GETDATE() and edate >= GETDATE()";
|
"sdate <= GETDATE() and edate >= GETDATE()";
|
||||||
var cnt = DBM.ExecuteScalar(sql);
|
var cnt = DBM.ExecuteScalar(sql);
|
||||||
return cnt.ToString();
|
return cnt.ToString();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage GetholyUser()
|
public HttpResponseMessage GetholyUser()
|
||||||
{
|
{
|
||||||
var sql = string.Empty;
|
var sql = string.Empty;
|
||||||
sql = $"select uid,cate,sdate,edate,HolyReason " +
|
sql = $"select uid,cate,sdate,edate,HolyReason " +
|
||||||
$"from EETGW_HolydayRequest " +
|
$"from EETGW_HolydayRequest " +
|
||||||
$"where gcode = '{FCOMMON.info.Login.gcode}'" +
|
$"where gcode = '{FCOMMON.info.Login.gcode}'" +
|
||||||
$"and conf = 1 and HolyDays > 0 and sdate <= GETDATE() and edate >= GETDATE()";
|
$"and conf = 1 and HolyDays > 0 and sdate <= GETDATE() and edate >= GETDATE()";
|
||||||
|
|
||||||
if (info.Login.gcode == null)
|
if (info.Login.gcode == null)
|
||||||
info.Login.gcode = "EET1P";
|
info.Login.gcode = "EET1P";
|
||||||
|
|
||||||
sql = sql.Replace("{gcode}", FCOMMON.info.Login.gcode);
|
sql = sql.Replace("{gcode}", FCOMMON.info.Login.gcode);
|
||||||
|
|
||||||
var cs = Properties.Settings.Default.gwcs;// "Data Source=K4FASQL.kr.ds.amkor.com,50150;Initial Catalog=EE;Persist Security Info=True;User ID=eeadm;Password=uJnU8a8q&DJ+ug-D!";
|
var cs = Properties.Settings.Default.gwcs;// "Data Source=K4FASQL.kr.ds.amkor.com,50150;Initial Catalog=EE;Persist Security Info=True;User ID=eeadm;Password=uJnU8a8q&DJ+ug-D!";
|
||||||
var cn = new System.Data.SqlClient.SqlConnection(cs);
|
var cn = new System.Data.SqlClient.SqlConnection(cs);
|
||||||
var cmd = new System.Data.SqlClient.SqlCommand(sql, cn);
|
var cmd = new System.Data.SqlClient.SqlCommand(sql, cn);
|
||||||
var da = new System.Data.SqlClient.SqlDataAdapter(cmd);
|
var da = new System.Data.SqlClient.SqlDataAdapter(cmd);
|
||||||
var dt = new System.Data.DataTable();
|
var dt = new System.Data.DataTable();
|
||||||
da.Fill(dt);
|
da.Fill(dt);
|
||||||
da.Dispose();
|
da.Dispose();
|
||||||
cmd.Dispose();
|
cmd.Dispose();
|
||||||
cn.Dispose();
|
cn.Dispose();
|
||||||
|
|
||||||
var txtjson = JsonConvert.SerializeObject(dt, new JsonSerializerSettings
|
var txtjson = JsonConvert.SerializeObject(dt, new JsonSerializerSettings
|
||||||
{
|
{
|
||||||
NullValueHandling = NullValueHandling.Ignore
|
NullValueHandling = NullValueHandling.Ignore
|
||||||
});
|
});
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
var resp = new HttpResponseMessage()
|
||||||
{
|
{
|
||||||
Content = new StringContent(
|
Content = new StringContent(
|
||||||
txtjson,
|
txtjson,
|
||||||
System.Text.Encoding.UTF8,
|
System.Text.Encoding.UTF8,
|
||||||
"application/json")
|
"application/json")
|
||||||
};
|
};
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage Index()
|
public HttpResponseMessage Index()
|
||||||
{
|
{
|
||||||
//로그인이 되어있지않다면 로그인을 가져온다
|
// 직접 파일을 읽어서 반환
|
||||||
MethodResult result;
|
var filePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Web", "wwwroot", "DashBoard", "index.html");
|
||||||
result = View();
|
var contents = string.Empty;
|
||||||
|
|
||||||
var model = GetGlobalModel();
|
if (System.IO.File.Exists(filePath))
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
{
|
||||||
|
contents = System.IO.File.ReadAllText(filePath, System.Text.Encoding.UTF8);
|
||||||
//기본값을 찾아서 없애줘야한다
|
}
|
||||||
var contents = result.Content;
|
else
|
||||||
|
{
|
||||||
//공용값 적용
|
// 파일이 없으면 404 에러 페이지 또는 기본 메시지
|
||||||
ApplyCommonValue(ref contents);
|
contents = "<html><body><h1>404 - File Not Found</h1><p>The requested file was not found: " + filePath + "</p></body></html>";
|
||||||
|
}
|
||||||
//최종문자 적용
|
|
||||||
result.Content = contents;
|
//공용값 적용
|
||||||
|
ApplyCommonValue(ref contents);
|
||||||
var resp = new HttpResponseMessage()
|
|
||||||
{
|
var resp = new HttpResponseMessage()
|
||||||
Content = new StringContent(
|
{
|
||||||
result.Content,
|
Content = new StringContent(
|
||||||
System.Text.Encoding.UTF8,
|
contents,
|
||||||
"text/html")
|
System.Text.Encoding.UTF8,
|
||||||
};
|
"text/html")
|
||||||
|
};
|
||||||
return resp;
|
|
||||||
}
|
return resp;
|
||||||
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
299
Project/Web/Controller/HomeController.cs
Normal file
299
Project/Web/Controller/HomeController.cs
Normal file
@@ -0,0 +1,299 @@
|
|||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Web.Http;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Project.Web.Controllers
|
||||||
|
{
|
||||||
|
// 로그인 요청 모델
|
||||||
|
public class LoginRequest
|
||||||
|
{
|
||||||
|
public string UserId { get; set; }
|
||||||
|
public string Password { get; set; }
|
||||||
|
public bool RememberMe { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// 로그인 응답 모델
|
||||||
|
public class LoginResponse
|
||||||
|
{
|
||||||
|
public bool Success { get; set; }
|
||||||
|
public string Message { get; set; }
|
||||||
|
public string RedirectUrl { get; set; }
|
||||||
|
public object UserData { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class HomeController : BaseController
|
||||||
|
{
|
||||||
|
[HttpPost]
|
||||||
|
public void Index([FromBody]string value)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// PUT api/values/5
|
||||||
|
public void Put(int id, [FromBody]string value)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// DELETE api/values/5
|
||||||
|
public void Delete(int id)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public string Test()
|
||||||
|
{
|
||||||
|
return "test";
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public HttpResponseMessage Login([FromBody] LoginRequest request)
|
||||||
|
{
|
||||||
|
var response = new LoginResponse();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 입력값 검증
|
||||||
|
if (string.IsNullOrEmpty(request?.UserId) || string.IsNullOrEmpty(request?.Password))
|
||||||
|
{
|
||||||
|
response.Success = false;
|
||||||
|
response.Message = "사용자 ID와 비밀번호를 입력해주세요.";
|
||||||
|
return CreateJsonResponse(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: 여기에 실제 데이터베이스 로그인 로직을 구현하세요
|
||||||
|
// 예시: 데이터베이스에서 사용자 정보 확인
|
||||||
|
bool isValidUser = ValidateUser(request.UserId, request.Password);
|
||||||
|
|
||||||
|
if (isValidUser)
|
||||||
|
{
|
||||||
|
// 로그인 성공
|
||||||
|
response.Success = true;
|
||||||
|
response.Message = "로그인에 성공했습니다.";
|
||||||
|
response.RedirectUrl = "/DashBoard";
|
||||||
|
|
||||||
|
// 사용자 정보 설정 (세션 또는 쿠키)
|
||||||
|
SetUserSession(request.UserId, request.RememberMe);
|
||||||
|
|
||||||
|
// 사용자 데이터 반환
|
||||||
|
response.UserData = new
|
||||||
|
{
|
||||||
|
UserId = request.UserId,
|
||||||
|
LoginTime = DateTime.Now,
|
||||||
|
RememberMe = request.RememberMe
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 로그인 실패
|
||||||
|
response.Success = false;
|
||||||
|
response.Message = "사용자 ID 또는 비밀번호가 올바르지 않습니다.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
response.Success = false;
|
||||||
|
response.Message = "로그인 처리 중 오류가 발생했습니다: " + ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
return CreateJsonResponse(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public HttpResponseMessage Logout()
|
||||||
|
{
|
||||||
|
var response = new LoginResponse();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// TODO: 여기에 로그아웃 로직을 구현하세요
|
||||||
|
// 예시: 세션 정리, 쿠키 삭제 등
|
||||||
|
ClearUserSession();
|
||||||
|
|
||||||
|
response.Success = true;
|
||||||
|
response.Message = "로그아웃되었습니다.";
|
||||||
|
response.RedirectUrl = "/Login";
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
response.Success = false;
|
||||||
|
response.Message = "로그아웃 처리 중 오류가 발생했습니다: " + ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
return CreateJsonResponse(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public HttpResponseMessage CheckLoginStatus()
|
||||||
|
{
|
||||||
|
var response = new LoginResponse();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// TODO: 여기에 로그인 상태 확인 로직을 구현하세요
|
||||||
|
// 예시: 세션 또는 쿠키에서 사용자 정보 확인
|
||||||
|
var currentUser = GetCurrentUser();
|
||||||
|
|
||||||
|
if (currentUser != null)
|
||||||
|
{
|
||||||
|
response.Success = true;
|
||||||
|
response.Message = "로그인된 상태입니다.";
|
||||||
|
response.UserData = currentUser;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
response.Success = false;
|
||||||
|
response.Message = "로그인되지 않은 상태입니다.";
|
||||||
|
response.RedirectUrl = "/Login";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
response.Success = false;
|
||||||
|
response.Message = "로그인 상태 확인 중 오류가 발생했습니다: " + ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
return CreateJsonResponse(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 헬퍼 메서드들
|
||||||
|
private bool ValidateUser(string userId, string password)
|
||||||
|
{
|
||||||
|
// TODO: 실제 데이터베이스 검증 로직을 여기에 구현하세요
|
||||||
|
// 예시: 데이터베이스에서 사용자 정보 조회 및 비밀번호 검증
|
||||||
|
var encpass = Pub.MakePasswordEnc(password.Trim());
|
||||||
|
|
||||||
|
|
||||||
|
// 임시 테스트용 (실제로는 데이터베이스에서 확인)
|
||||||
|
return userId == "admin" && password == "admin";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetUserSession(string userId, bool rememberMe)
|
||||||
|
{
|
||||||
|
// TODO: 세션 또는 쿠키에 사용자 정보 저장
|
||||||
|
// 예시: HttpContext.Session["UserId"] = userId;
|
||||||
|
// 예시: 쿠키 설정 (rememberMe가 true인 경우)
|
||||||
|
//데이터베이스에서 해당 정보를 찾아와서 처리해야한다
|
||||||
|
|
||||||
|
FCOMMON.info.Login.no = userId;
|
||||||
|
FCOMMON.info.Login.nameK = drUser.name;
|
||||||
|
FCOMMON.info.Login.dept = cmbDept.Text;// userdr.dept;// cmbDept.Text;
|
||||||
|
FCOMMON.info.Login.level = drGrpUser.level;
|
||||||
|
FCOMMON.info.Login.email = drUser.email;
|
||||||
|
FCOMMON.info.Login.nameE = drUser.nameE;
|
||||||
|
FCOMMON.info.Login.hp = drUser.hp;
|
||||||
|
FCOMMON.info.Login.tel = drUser.tel;
|
||||||
|
FCOMMON.info.Login.title = drUser.dept + "(" + drUser.grade + ")";
|
||||||
|
FCOMMON.info.NotShowJobReportview = Pub.setting.NotShowJobreportPRewView;
|
||||||
|
//var gcode = FCOMMON.DBM.ExecuteScalar("select isnull(gcode,'NOGCODE') from UserGroup where dept ='" + cmbDept.Text + "'");
|
||||||
|
var gperm = FCOMMON.DBM.ExecuteScalar("select isnull(permission,0) from UserGroup where dept ='" + cmbDept.Text + "'");
|
||||||
|
FCOMMON.info.Login.gcode = gCode;// gcode;
|
||||||
|
FCOMMON.info.Login.process = drUser.id == "dev" ? "개발자" : drGrpUser.Process;
|
||||||
|
FCOMMON.info.Login.permission = 0;
|
||||||
|
FCOMMON.info.Login.gpermission = int.Parse(gperm);
|
||||||
|
//FCOMMON.info.datapath = Pub.setting.SharedDataPath;
|
||||||
|
FCOMMON.info.ShowBuyerror = Pub.setting.Showbuyerror; //210625
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ClearUserSession()
|
||||||
|
{
|
||||||
|
// TODO: 세션 또는 쿠키에서 사용자 정보 삭제
|
||||||
|
FCOMMON.info.Login.no = string.Empty;
|
||||||
|
FCOMMON.info.Login.level = 0;
|
||||||
|
FCOMMON.info.Login.gcode = string.Empty;
|
||||||
|
FCOMMON.info.Login.permission = 0;
|
||||||
|
FCOMMON.info.Login.gpermission = 0;
|
||||||
|
Console.WriteLine("logout");
|
||||||
|
}
|
||||||
|
|
||||||
|
private object GetCurrentUser()
|
||||||
|
{
|
||||||
|
// TODO: 현재 로그인된 사용자 정보 반환
|
||||||
|
// 예시: HttpContext.Session["UserId"]에서 사용자 정보 조회
|
||||||
|
return null; // 임시로 null 반환
|
||||||
|
}
|
||||||
|
|
||||||
|
private HttpResponseMessage CreateJsonResponse(object data)
|
||||||
|
{
|
||||||
|
var json = JsonConvert.SerializeObject(data, new JsonSerializerSettings
|
||||||
|
{
|
||||||
|
NullValueHandling = NullValueHandling.Ignore
|
||||||
|
});
|
||||||
|
|
||||||
|
return new HttpResponseMessage()
|
||||||
|
{
|
||||||
|
Content = new StringContent(
|
||||||
|
json,
|
||||||
|
System.Text.Encoding.UTF8,
|
||||||
|
"application/json")
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public HttpResponseMessage Login()
|
||||||
|
{
|
||||||
|
// 직접 파일을 읽어서 반환
|
||||||
|
var filePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Web", "wwwroot", "login.html");
|
||||||
|
var contents = string.Empty;
|
||||||
|
|
||||||
|
if (System.IO.File.Exists(filePath))
|
||||||
|
{
|
||||||
|
contents = System.IO.File.ReadAllText(filePath, System.Text.Encoding.UTF8);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 파일이 없으면 404 에러 페이지 또는 기본 메시지
|
||||||
|
contents = "<html><body><h1>404 - File Not Found</h1><p>The requested file was not found: " + filePath + "</p></body></html>";
|
||||||
|
}
|
||||||
|
|
||||||
|
//공용값 적용
|
||||||
|
ApplyCommonValue(ref contents);
|
||||||
|
|
||||||
|
var resp = new HttpResponseMessage()
|
||||||
|
{
|
||||||
|
Content = new StringContent(
|
||||||
|
contents,
|
||||||
|
System.Text.Encoding.UTF8,
|
||||||
|
"text/html")
|
||||||
|
};
|
||||||
|
|
||||||
|
return resp;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public HttpResponseMessage Index()
|
||||||
|
{
|
||||||
|
// 직접 파일을 읽어서 반환
|
||||||
|
var filePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Web", "wwwroot", "index.html");
|
||||||
|
var contents = string.Empty;
|
||||||
|
|
||||||
|
if (System.IO.File.Exists(filePath))
|
||||||
|
{
|
||||||
|
contents = System.IO.File.ReadAllText(filePath, System.Text.Encoding.UTF8);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 파일이 없으면 404 에러 페이지 또는 기본 메시지
|
||||||
|
contents = "<html><body><h1>404 - File Not Found</h1><p>The requested file was not found: " + filePath + "</p></body></html>";
|
||||||
|
}
|
||||||
|
|
||||||
|
//공용값 적용
|
||||||
|
ApplyCommonValue(ref contents);
|
||||||
|
|
||||||
|
var resp = new HttpResponseMessage()
|
||||||
|
{
|
||||||
|
Content = new StringContent(
|
||||||
|
contents,
|
||||||
|
System.Text.Encoding.UTF8,
|
||||||
|
"text/html")
|
||||||
|
};
|
||||||
|
|
||||||
|
return resp;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,153 +1,153 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Web.Http;
|
using System.Web.Http;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace Project
|
namespace Project.Web.Controllers
|
||||||
{
|
{
|
||||||
public class ItemController : BaseController
|
public class ItemController : BaseController
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
// PUT api/values/5
|
// PUT api/values/5
|
||||||
public void Put(int id, [FromBody] string value)
|
public void Put(int id, [FromBody] string value)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// DELETE api/values/5
|
// DELETE api/values/5
|
||||||
public void Delete(int id)
|
public void Delete(int id)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public string Test()
|
public string Test()
|
||||||
{
|
{
|
||||||
return "test";
|
return "test";
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage Find()
|
public HttpResponseMessage Find()
|
||||||
{
|
{
|
||||||
//로그인이 되어있지않다면 로그인을 가져온다
|
//로그인이 되어있지않다면 로그인을 가져온다
|
||||||
MethodResult result;
|
MethodResult result;
|
||||||
result = View();
|
result = View();
|
||||||
|
|
||||||
|
|
||||||
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
|
|
||||||
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
||||||
var model = GetGlobalModel();
|
var model = GetGlobalModel();
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
//기본값을 찾아서 없애줘야한다
|
//기본값을 찾아서 없애줘야한다
|
||||||
var searchkey = string.Empty;
|
var searchkey = string.Empty;
|
||||||
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
||||||
if (searchkey.isEmpty() == false && searchkey != "%")
|
if (searchkey.isEmpty() == false && searchkey != "%")
|
||||||
{
|
{
|
||||||
if (searchkey.StartsWith("%") == false) searchkey = "%" + searchkey;
|
if (searchkey.StartsWith("%") == false) searchkey = "%" + searchkey;
|
||||||
if (searchkey.EndsWith("%") == false) searchkey = searchkey + "%";
|
if (searchkey.EndsWith("%") == false) searchkey = searchkey + "%";
|
||||||
}
|
}
|
||||||
|
|
||||||
var tbody = new System.Text.StringBuilder();
|
var tbody = new System.Text.StringBuilder();
|
||||||
|
|
||||||
//테이블데이터생성
|
//테이블데이터생성
|
||||||
var itemcnt = 0;
|
var itemcnt = 0;
|
||||||
if (searchkey.isEmpty() == false)
|
if (searchkey.isEmpty() == false)
|
||||||
{
|
{
|
||||||
var db = new dsMSSQLTableAdapters.vFindSIDTableAdapter();// EEEntitiesMain();
|
var db = new dsMSSQLTableAdapters.vFindSIDTableAdapter();// EEEntitiesMain();
|
||||||
var rows = db.GetData(searchkey);// .vFindSID.Where(t => t.sid.Contains(searchkey) || t.name.Contains(searchkey) || t.model.Contains(searchkey));
|
var rows = db.GetData(searchkey);// .vFindSID.Where(t => t.sid.Contains(searchkey) || t.name.Contains(searchkey) || t.model.Contains(searchkey));
|
||||||
itemcnt = rows.Count();
|
itemcnt = rows.Count();
|
||||||
foreach (var item in rows)
|
foreach (var item in rows)
|
||||||
{
|
{
|
||||||
tbody.AppendLine("<tr>");
|
tbody.AppendLine("<tr>");
|
||||||
tbody.AppendLine($"<th scope='row'>{item.Location}</th>");
|
tbody.AppendLine($"<th scope='row'>{item.Location}</th>");
|
||||||
tbody.AppendLine($"<td>{item.sid}</td>");
|
tbody.AppendLine($"<td>{item.sid}</td>");
|
||||||
tbody.AppendLine($"<td>{item.name}</td>");
|
tbody.AppendLine($"<td>{item.name}</td>");
|
||||||
tbody.AppendLine($"<td>{item.model}</td>");
|
tbody.AppendLine($"<td>{item.model}</td>");
|
||||||
|
|
||||||
if (item.IspriceNull())
|
if (item.IspriceNull())
|
||||||
tbody.AppendLine($"<td>--</td>");
|
tbody.AppendLine($"<td>--</td>");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var price = (double)item.price / 1000.0;
|
var price = (double)item.price / 1000.0;
|
||||||
|
|
||||||
tbody.AppendLine($"<td>{price.ToString("N0")}</td>");
|
tbody.AppendLine($"<td>{price.ToString("N0")}</td>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tbody.AppendLine($"<td>{item.manu}</td>");
|
tbody.AppendLine($"<td>{item.manu}</td>");
|
||||||
tbody.AppendLine($"<td>{item.supply}</td>");
|
tbody.AppendLine($"<td>{item.supply}</td>");
|
||||||
|
|
||||||
if (item.remark.Length > 10)
|
if (item.remark.Length > 10)
|
||||||
tbody.AppendLine($"<td>{item.remark.Substring(0, 10)}...</td>");
|
tbody.AppendLine($"<td>{item.remark.Substring(0, 10)}...</td>");
|
||||||
else
|
else
|
||||||
tbody.AppendLine($"<td>{item.remark}</td>");
|
tbody.AppendLine($"<td>{item.remark}</td>");
|
||||||
tbody.AppendLine("</tr>");
|
tbody.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//아잍쳄이 없는경우
|
//아잍쳄이 없는경우
|
||||||
if (itemcnt == 0)
|
if (itemcnt == 0)
|
||||||
{
|
{
|
||||||
tbody.AppendLine("<tr>");
|
tbody.AppendLine("<tr>");
|
||||||
tbody.AppendLine("<td colspan='8'>자료가 없습니다</td>");
|
tbody.AppendLine("<td colspan='8'>자료가 없습니다</td>");
|
||||||
tbody.AppendLine("</tr>");
|
tbody.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var contents = result.Content.Replace("{search}", searchkey);
|
var contents = result.Content.Replace("{search}", searchkey);
|
||||||
contents = contents.Replace("{tabledata}", tbody.ToString());
|
contents = contents.Replace("{tabledata}", tbody.ToString());
|
||||||
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
||||||
|
|
||||||
|
|
||||||
//공용값 적용
|
//공용값 적용
|
||||||
ApplyCommonValue(ref contents);
|
ApplyCommonValue(ref contents);
|
||||||
|
|
||||||
//최종문자 적용
|
//최종문자 적용
|
||||||
result.Content = contents;
|
result.Content = contents;
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
var resp = new HttpResponseMessage()
|
||||||
{
|
{
|
||||||
Content = new StringContent(
|
Content = new StringContent(
|
||||||
result.Content,
|
result.Content,
|
||||||
System.Text.Encoding.UTF8,
|
System.Text.Encoding.UTF8,
|
||||||
"text/html")
|
"text/html")
|
||||||
};
|
};
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage Index()
|
public HttpResponseMessage Index()
|
||||||
{
|
{
|
||||||
//로그인이 되어있지않다면 로그인을 가져온다
|
//로그인이 되어있지않다면 로그인을 가져온다
|
||||||
MethodResult result;
|
MethodResult result;
|
||||||
result = View();
|
result = View();
|
||||||
|
|
||||||
var model = GetGlobalModel();
|
var model = GetGlobalModel();
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
//기본값을 찾아서 없애줘야한다
|
//기본값을 찾아서 없애줘야한다
|
||||||
var contents = result.Content;
|
var contents = result.Content;
|
||||||
|
|
||||||
//공용값 적용
|
//공용값 적용
|
||||||
ApplyCommonValue(ref contents);
|
ApplyCommonValue(ref contents);
|
||||||
|
|
||||||
//최종문자 적용
|
//최종문자 적용
|
||||||
result.Content = contents;
|
result.Content = contents;
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
var resp = new HttpResponseMessage()
|
||||||
{
|
{
|
||||||
Content = new StringContent(
|
Content = new StringContent(
|
||||||
result.Content,
|
result.Content,
|
||||||
System.Text.Encoding.UTF8,
|
System.Text.Encoding.UTF8,
|
||||||
"text/html")
|
"text/html")
|
||||||
};
|
};
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,380 +1,380 @@
|
|||||||
using Microsoft.Owin;
|
using Microsoft.Owin;
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.Http;
|
using System.Web.Http;
|
||||||
|
|
||||||
namespace Project
|
namespace Project.Web.Controllers
|
||||||
{
|
{
|
||||||
public class JobreportController : BaseController
|
public class JobreportController : BaseController
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
// PUT api/values/5
|
// PUT api/values/5
|
||||||
public void Put(int id, [FromBody] string value)
|
public void Put(int id, [FromBody] string value)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// DELETE api/values/5
|
// DELETE api/values/5
|
||||||
public void Delete(int id)
|
public void Delete(int id)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public string Add(FormCollection tbpdate)
|
public string Add(FormCollection tbpdate)
|
||||||
{
|
{
|
||||||
var vals = Request.GetQueryNameValuePairs();
|
var vals = Request.GetQueryNameValuePairs();
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
//[HttpPost]
|
//[HttpPost]
|
||||||
//public string Edit([FromBody] string value)
|
//public string Edit([FromBody] string value)
|
||||||
//{
|
//{
|
||||||
// var vals = Request.GetQueryNameValuePairs();
|
// var vals = Request.GetQueryNameValuePairs();
|
||||||
|
|
||||||
// var req = Request.GetRequestContext();
|
// var req = Request.GetRequestContext();
|
||||||
|
|
||||||
// return string.Empty;
|
// return string.Empty;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public string Edit(FormCollection value)
|
public string Edit(FormCollection value)
|
||||||
{
|
{
|
||||||
var vals = Request.GetQueryNameValuePairs();
|
var vals = Request.GetQueryNameValuePairs();
|
||||||
|
|
||||||
var req = Request.GetRequestContext();
|
var req = Request.GetRequestContext();
|
||||||
|
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage Edit(int id)
|
public HttpResponseMessage Edit(int id)
|
||||||
{
|
{
|
||||||
//로그인이 되어있지않다면 로그인을 가져온다
|
//로그인이 되어있지않다면 로그인을 가져온다
|
||||||
MethodResult result;
|
MethodResult result;
|
||||||
result = View("/jobreport/edit");
|
result = View("/jobreport/edit");
|
||||||
|
|
||||||
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
||||||
var model = GetGlobalModel();
|
var model = GetGlobalModel();
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
//기본값을 찾아서 없애줘야한다
|
//기본값을 찾아서 없애줘야한다
|
||||||
var searchkey = string.Empty;
|
var searchkey = string.Empty;
|
||||||
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
||||||
|
|
||||||
var tbody = new System.Text.StringBuilder();
|
var tbody = new System.Text.StringBuilder();
|
||||||
|
|
||||||
//테이블데이터생성
|
//테이블데이터생성
|
||||||
var db = new dsMSSQLTableAdapters.vJobReportForUserTableAdapter();//. EEEntitiesJobreport();
|
var db = new dsMSSQLTableAdapters.vJobReportForUserTableAdapter();//. EEEntitiesJobreport();
|
||||||
var sd = DateTime.Now.ToString("yyyy-MM-01");
|
var sd = DateTime.Now.ToString("yyyy-MM-01");
|
||||||
var ed = DateTime.Now.ToShortDateString();
|
var ed = DateTime.Now.ToShortDateString();
|
||||||
var rows = db.GetData(FCOMMON.info.Login.gcode, id).FirstOrDefault();//.vJobReportForUser.AsNoTracking().Where(t => t.gcode == FCOMMON.info.Login.gcode && t.idx == id).FirstOrDefault();
|
var rows = db.GetData(FCOMMON.info.Login.gcode, id).FirstOrDefault();//.vJobReportForUser.AsNoTracking().Where(t => t.gcode == FCOMMON.info.Login.gcode && t.idx == id).FirstOrDefault();
|
||||||
|
|
||||||
var contents = result.Content;
|
var contents = result.Content;
|
||||||
if (rows == null)
|
if (rows == null)
|
||||||
{
|
{
|
||||||
//아이템이 없는 메시지를 표시한다
|
//아이템이 없는 메시지를 표시한다
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//치환작업을 진행한다
|
//치환작업을 진행한다
|
||||||
contents = contents.Replace("{pdate}", rows.pdate);
|
contents = contents.Replace("{pdate}", rows.pdate);
|
||||||
contents = contents.Replace("{status}", rows.status);
|
contents = contents.Replace("{status}", rows.status);
|
||||||
contents = contents.Replace("{name}", rows.name);
|
contents = contents.Replace("{name}", rows.name);
|
||||||
contents = contents.Replace("{package}", rows.package);
|
contents = contents.Replace("{package}", rows.package);
|
||||||
contents = contents.Replace("{process}", rows.process);
|
contents = contents.Replace("{process}", rows.process);
|
||||||
contents = contents.Replace("{type}", rows.type);
|
contents = contents.Replace("{type}", rows.type);
|
||||||
contents = contents.Replace("{userProcess}", rows.userProcess);
|
contents = contents.Replace("{userProcess}", rows.userProcess);
|
||||||
contents = contents.Replace("{projectName}", rows.projectName);
|
contents = contents.Replace("{projectName}", rows.projectName);
|
||||||
contents = contents.Replace("{hrs}", rows.hrs.ToString());
|
contents = contents.Replace("{hrs}", rows.hrs.ToString());
|
||||||
contents = contents.Replace("{ot}", rows.ot.ToString());
|
contents = contents.Replace("{ot}", rows.ot.ToString());
|
||||||
contents = contents.Replace("{requestpart}", rows.requestpart);
|
contents = contents.Replace("{requestpart}", rows.requestpart);
|
||||||
contents = contents.Replace("{description}", rows.description);
|
contents = contents.Replace("{description}", rows.description);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//공용값 적용
|
//공용값 적용
|
||||||
ApplyCommonValue(ref contents);
|
ApplyCommonValue(ref contents);
|
||||||
|
|
||||||
//최종문자 적용
|
//최종문자 적용
|
||||||
result.Content = contents;
|
result.Content = contents;
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
var resp = new HttpResponseMessage()
|
||||||
{
|
{
|
||||||
Content = new StringContent(
|
Content = new StringContent(
|
||||||
result.Content,
|
result.Content,
|
||||||
System.Text.Encoding.UTF8,
|
System.Text.Encoding.UTF8,
|
||||||
"text/html")
|
"text/html")
|
||||||
};
|
};
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage Add()
|
public HttpResponseMessage Add()
|
||||||
{
|
{
|
||||||
//로그인이 되어있지않다면 로그인을 가져온다
|
//로그인이 되어있지않다면 로그인을 가져온다
|
||||||
MethodResult result;
|
MethodResult result;
|
||||||
result = View("/jobreport/add");
|
result = View("/jobreport/add");
|
||||||
|
|
||||||
|
|
||||||
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
|
|
||||||
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
||||||
var model = GetGlobalModel();
|
var model = GetGlobalModel();
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
//기본값을 찾아서 없애줘야한다
|
//기본값을 찾아서 없애줘야한다
|
||||||
var searchkey = string.Empty;
|
var searchkey = string.Empty;
|
||||||
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
||||||
|
|
||||||
var tbody = new System.Text.StringBuilder();
|
var tbody = new System.Text.StringBuilder();
|
||||||
|
|
||||||
//테이블데이터생성
|
//테이블데이터생성
|
||||||
var itemcnt = 0;
|
var itemcnt = 0;
|
||||||
//if (searchkey.isEmpty() == false)
|
//if (searchkey.isEmpty() == false)
|
||||||
{
|
{
|
||||||
var db = new dsMSSQLTableAdapters.vJobReportForUserTableAdapter();// EEEntitiesJobreport();
|
var db = new dsMSSQLTableAdapters.vJobReportForUserTableAdapter();// EEEntitiesJobreport();
|
||||||
var sd = DateTime.Now.ToString("yyyy-MM-01");
|
var sd = DateTime.Now.ToString("yyyy-MM-01");
|
||||||
var ed = DateTime.Now.ToShortDateString();
|
var ed = DateTime.Now.ToShortDateString();
|
||||||
var rows = db.GetByDate(FCOMMON.info.Login.gcode, FCOMMON.info.Login.no, sd, ed);
|
var rows = db.GetByDate(FCOMMON.info.Login.gcode, FCOMMON.info.Login.no, sd, ed);
|
||||||
//vJobReportForUser.AsNoTracking().Where(t => t.gcode == FCOMMON.info.Login.gcode && t.id == FCOMMON.info.Login.no && t.pdate.CompareTo(sd) >= 0 && t.pdate.CompareTo(ed) <= 1).OrderByDescending(t => t.pdate);
|
//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();
|
itemcnt = rows.Count();
|
||||||
foreach (var item in rows)
|
foreach (var item in rows)
|
||||||
{
|
{
|
||||||
tbody.AppendLine("<tr>");
|
tbody.AppendLine("<tr>");
|
||||||
|
|
||||||
tbody.AppendLine($"<th scope='row'>{item.pdate.Substring(5)}</th>");
|
tbody.AppendLine($"<th scope='row'>{item.pdate.Substring(5)}</th>");
|
||||||
tbody.AppendLine($"<td>{item.ww}</td>");
|
tbody.AppendLine($"<td>{item.ww}</td>");
|
||||||
tbody.AppendLine($"<td>{item.name}</td>");
|
tbody.AppendLine($"<td>{item.name}</td>");
|
||||||
|
|
||||||
if (item.status == "진행 중" || item.status.EndsWith("%"))
|
if (item.status == "진행 중" || item.status.EndsWith("%"))
|
||||||
tbody.AppendLine($"<td class='table-info text-center'>{item.status}</td>");
|
tbody.AppendLine($"<td class='table-info text-center'>{item.status}</td>");
|
||||||
else
|
else
|
||||||
tbody.AppendLine($"<td class='text-center'>{item.status}</td>");
|
tbody.AppendLine($"<td class='text-center'>{item.status}</td>");
|
||||||
|
|
||||||
tbody.AppendLine($"<td>{item.type}</td>");
|
tbody.AppendLine($"<td>{item.type}</td>");
|
||||||
tbody.AppendLine($"<td>{item.projectName}</td>");
|
tbody.AppendLine($"<td>{item.projectName}</td>");
|
||||||
tbody.AppendLine($"<td>{item.hrs}</td>");
|
tbody.AppendLine($"<td>{item.hrs}</td>");
|
||||||
tbody.AppendLine($"<td>{item.ot}</td>");
|
tbody.AppendLine($"<td>{item.ot}</td>");
|
||||||
|
|
||||||
tbody.AppendLine("<td><span class='d-inline-block text-truncate' style='max-width: 150px;'>");
|
tbody.AppendLine("<td><span class='d-inline-block text-truncate' style='max-width: 150px;'>");
|
||||||
tbody.AppendLine(item.description);
|
tbody.AppendLine(item.description);
|
||||||
tbody.AppendLine("</span></td>");
|
tbody.AppendLine("</span></td>");
|
||||||
|
|
||||||
tbody.AppendLine("</tr>");
|
tbody.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//아잍쳄이 없는경우
|
//아잍쳄이 없는경우
|
||||||
if (itemcnt == 0)
|
if (itemcnt == 0)
|
||||||
{
|
{
|
||||||
tbody.AppendLine("<tr>");
|
tbody.AppendLine("<tr>");
|
||||||
tbody.AppendLine("<th scope='row'>1</th>");
|
tbody.AppendLine("<th scope='row'>1</th>");
|
||||||
tbody.AppendLine("<td colspan='6'>자료가 없습니다</td>");
|
tbody.AppendLine("<td colspan='6'>자료가 없습니다</td>");
|
||||||
tbody.AppendLine("</tr>");
|
tbody.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var contents = result.Content.Replace("{search}", searchkey);
|
var contents = result.Content.Replace("{search}", searchkey);
|
||||||
contents = contents.Replace("{tabledata}", tbody.ToString());
|
contents = contents.Replace("{tabledata}", tbody.ToString());
|
||||||
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
||||||
|
|
||||||
|
|
||||||
//공용값 적용
|
//공용값 적용
|
||||||
ApplyCommonValue(ref contents);
|
ApplyCommonValue(ref contents);
|
||||||
|
|
||||||
//최종문자 적용
|
//최종문자 적용
|
||||||
result.Content = contents;
|
result.Content = contents;
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
var resp = new HttpResponseMessage()
|
||||||
{
|
{
|
||||||
Content = new StringContent(
|
Content = new StringContent(
|
||||||
result.Content,
|
result.Content,
|
||||||
System.Text.Encoding.UTF8,
|
System.Text.Encoding.UTF8,
|
||||||
"text/html")
|
"text/html")
|
||||||
};
|
};
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage Find()
|
public HttpResponseMessage Find()
|
||||||
{
|
{
|
||||||
//로그인이 되어있지않다면 로그인을 가져온다
|
//로그인이 되어있지않다면 로그인을 가져온다
|
||||||
MethodResult result;
|
MethodResult result;
|
||||||
result = View();
|
result = View();
|
||||||
|
|
||||||
|
|
||||||
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
|
|
||||||
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
||||||
var model = GetGlobalModel();
|
var model = GetGlobalModel();
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
//기본값을 찾아서 없애줘야한다
|
//기본값을 찾아서 없애줘야한다
|
||||||
var searchkey = string.Empty;
|
var searchkey = string.Empty;
|
||||||
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
||||||
|
|
||||||
var tbody = new System.Text.StringBuilder();
|
var tbody = new System.Text.StringBuilder();
|
||||||
|
|
||||||
//테이블데이터생성
|
//테이블데이터생성
|
||||||
var itemcnt = 0;
|
var itemcnt = 0;
|
||||||
if (searchkey.isEmpty() == false)
|
if (searchkey.isEmpty() == false)
|
||||||
{
|
{
|
||||||
var db = new dsMSSQLTableAdapters.vJobReportForUserTableAdapter();// EEEntitiesJobreport();
|
var db = new dsMSSQLTableAdapters.vJobReportForUserTableAdapter();// EEEntitiesJobreport();
|
||||||
var sd = DateTime.Now.ToShortDateString();
|
var sd = DateTime.Now.ToShortDateString();
|
||||||
var rows = db.GetByToday(FCOMMON.info.Login.gcode, sd);//.vJobReportForUser.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.pdate.CompareTo(sd) == 0).OrderBy(t => t.name);
|
var rows = db.GetByToday(FCOMMON.info.Login.gcode, sd);//.vJobReportForUser.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.pdate.CompareTo(sd) == 0).OrderBy(t => t.name);
|
||||||
itemcnt = rows.Count();
|
itemcnt = rows.Count();
|
||||||
foreach (var item in rows)
|
foreach (var item in rows)
|
||||||
{
|
{
|
||||||
tbody.AppendLine("<tr>");
|
tbody.AppendLine("<tr>");
|
||||||
tbody.AppendLine($"<th scope='row'>{item.pdate}</th>");
|
tbody.AppendLine($"<th scope='row'>{item.pdate}</th>");
|
||||||
tbody.AppendLine($"<td>{item.status}</td>");
|
tbody.AppendLine($"<td>{item.status}</td>");
|
||||||
tbody.AppendLine($"<td>{item.name}</td>");
|
tbody.AppendLine($"<td>{item.name}</td>");
|
||||||
tbody.AppendLine($"<td>{item.projectName}</td>");
|
tbody.AppendLine($"<td>{item.projectName}</td>");
|
||||||
tbody.AppendLine($"<td>{item.hrs}</td>");
|
tbody.AppendLine($"<td>{item.hrs}</td>");
|
||||||
tbody.AppendLine($"<td>{item.ot}</td>");
|
tbody.AppendLine($"<td>{item.ot}</td>");
|
||||||
tbody.AppendLine($"<td>{item.description}</td>");
|
tbody.AppendLine($"<td>{item.description}</td>");
|
||||||
|
|
||||||
|
|
||||||
if (item.description.Length > 10)
|
if (item.description.Length > 10)
|
||||||
tbody.AppendLine($"<td>{item.description.Substring(0, 10)}...</td>");
|
tbody.AppendLine($"<td>{item.description.Substring(0, 10)}...</td>");
|
||||||
else
|
else
|
||||||
tbody.AppendLine($"<td>{item.description}</td>");
|
tbody.AppendLine($"<td>{item.description}</td>");
|
||||||
tbody.AppendLine("</tr>");
|
tbody.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//아잍쳄이 없는경우
|
//아잍쳄이 없는경우
|
||||||
if (itemcnt == 0)
|
if (itemcnt == 0)
|
||||||
{
|
{
|
||||||
tbody.AppendLine("<tr>");
|
tbody.AppendLine("<tr>");
|
||||||
tbody.AppendLine("<th scope='row'>1</th>");
|
tbody.AppendLine("<th scope='row'>1</th>");
|
||||||
tbody.AppendLine("<td colspan='6'>자료가 없습니다</td>");
|
tbody.AppendLine("<td colspan='6'>자료가 없습니다</td>");
|
||||||
tbody.AppendLine("</tr>");
|
tbody.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var contents = result.Content.Replace("{search}", searchkey);
|
var contents = result.Content.Replace("{search}", searchkey);
|
||||||
contents = contents.Replace("{tabledata}", tbody.ToString());
|
contents = contents.Replace("{tabledata}", tbody.ToString());
|
||||||
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
||||||
|
|
||||||
|
|
||||||
//공용값 적용
|
//공용값 적용
|
||||||
ApplyCommonValue(ref contents);
|
ApplyCommonValue(ref contents);
|
||||||
|
|
||||||
//최종문자 적용
|
//최종문자 적용
|
||||||
result.Content = contents;
|
result.Content = contents;
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
var resp = new HttpResponseMessage()
|
||||||
{
|
{
|
||||||
Content = new StringContent(
|
Content = new StringContent(
|
||||||
result.Content,
|
result.Content,
|
||||||
System.Text.Encoding.UTF8,
|
System.Text.Encoding.UTF8,
|
||||||
"text/html")
|
"text/html")
|
||||||
};
|
};
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage Index()
|
public HttpResponseMessage Index()
|
||||||
{
|
{
|
||||||
//로그인이 되어있지않다면 로그인을 가져온다
|
//로그인이 되어있지않다면 로그인을 가져온다
|
||||||
MethodResult result;
|
MethodResult result;
|
||||||
result = View();
|
result = View();
|
||||||
|
|
||||||
|
|
||||||
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
|
|
||||||
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
||||||
var model = GetGlobalModel();
|
var model = GetGlobalModel();
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
//기본값을 찾아서 없애줘야한다
|
//기본값을 찾아서 없애줘야한다
|
||||||
var searchkey = string.Empty;
|
var searchkey = string.Empty;
|
||||||
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
||||||
|
|
||||||
var tbody = new System.Text.StringBuilder();
|
var tbody = new System.Text.StringBuilder();
|
||||||
|
|
||||||
//테이블데이터생성
|
//테이블데이터생성
|
||||||
var itemcnt = 0;
|
var itemcnt = 0;
|
||||||
//if (searchkey.isEmpty() == false)
|
//if (searchkey.isEmpty() == false)
|
||||||
{
|
{
|
||||||
var db = new dsMSSQLTableAdapters.vJobReportForUserTableAdapter();// EEEntitiesJobreport();
|
var db = new dsMSSQLTableAdapters.vJobReportForUserTableAdapter();// EEEntitiesJobreport();
|
||||||
var sd = DateTime.Now.ToShortDateString();
|
var sd = DateTime.Now.ToShortDateString();
|
||||||
var ed = DateTime.Now.ToShortDateString();
|
var ed = DateTime.Now.ToShortDateString();
|
||||||
var rows = db.GetByDate(FCOMMON.info.Login.gcode, FCOMMON.info.Login.no, sd, ed);
|
var rows = db.GetByDate(FCOMMON.info.Login.gcode, FCOMMON.info.Login.no, sd, ed);
|
||||||
//.vJobReportForUser.AsNoTracking().Where(t => t.gcode == FCOMMON.info.Login.gcode && t.id == FCOMMON.info.Login.no && t.pdate.CompareTo(sd) >= 0 && t.pdate.CompareTo(ed) <= 1).OrderByDescending(t => t.pdate);
|
//.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();
|
itemcnt = rows.Count();
|
||||||
foreach (var item in rows)
|
foreach (var item in rows)
|
||||||
{
|
{
|
||||||
tbody.AppendLine("<tr>");
|
tbody.AppendLine("<tr>");
|
||||||
|
|
||||||
tbody.AppendLine($"<th scope='row'>{item.pdate.Substring(5)}</th>");
|
tbody.AppendLine($"<th scope='row'>{item.pdate.Substring(5)}</th>");
|
||||||
tbody.AppendLine($"<td>{item.ww}</td>");
|
tbody.AppendLine($"<td>{item.ww}</td>");
|
||||||
tbody.AppendLine($"<td>{item.name}</td>");
|
tbody.AppendLine($"<td>{item.name}</td>");
|
||||||
|
|
||||||
if (item.status == "진행 중" || item.status.EndsWith("%"))
|
if (item.status == "진행 중" || item.status.EndsWith("%"))
|
||||||
tbody.AppendLine($"<td class='table-info text-center'>{item.status}</td>");
|
tbody.AppendLine($"<td class='table-info text-center'>{item.status}</td>");
|
||||||
else
|
else
|
||||||
tbody.AppendLine($"<td class='text-center'>{item.status}</td>");
|
tbody.AppendLine($"<td class='text-center'>{item.status}</td>");
|
||||||
|
|
||||||
tbody.AppendLine($"<td>{item.type}</td>");
|
tbody.AppendLine($"<td>{item.type}</td>");
|
||||||
tbody.AppendLine($"<td><a href='/jobreport/edit/{item.idx}'>{item.projectName}</a></td>");
|
tbody.AppendLine($"<td><a href='/jobreport/edit/{item.idx}'>{item.projectName}</a></td>");
|
||||||
tbody.AppendLine($"<td>{item.hrs}</td>");
|
tbody.AppendLine($"<td>{item.hrs}</td>");
|
||||||
tbody.AppendLine($"<td>{item.ot}</td>");
|
tbody.AppendLine($"<td>{item.ot}</td>");
|
||||||
|
|
||||||
tbody.AppendLine("<td><span class='d-inline-block text-truncate' style='max-width: 150px;'>");
|
tbody.AppendLine("<td><span class='d-inline-block text-truncate' style='max-width: 150px;'>");
|
||||||
tbody.AppendLine(item.description);
|
tbody.AppendLine(item.description);
|
||||||
tbody.AppendLine("</span></td>");
|
tbody.AppendLine("</span></td>");
|
||||||
|
|
||||||
tbody.AppendLine("</tr>");
|
tbody.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//아잍쳄이 없는경우
|
//아잍쳄이 없는경우
|
||||||
if (itemcnt == 0)
|
if (itemcnt == 0)
|
||||||
{
|
{
|
||||||
tbody.AppendLine("<tr>");
|
tbody.AppendLine("<tr>");
|
||||||
tbody.AppendLine("<th scope='row'>1</th>");
|
tbody.AppendLine("<th scope='row'>1</th>");
|
||||||
tbody.AppendLine("<td colspan='6'>자료가 없습니다</td>");
|
tbody.AppendLine("<td colspan='6'>자료가 없습니다</td>");
|
||||||
tbody.AppendLine("</tr>");
|
tbody.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var contents = result.Content.Replace("{search}", searchkey);
|
var contents = result.Content.Replace("{search}", searchkey);
|
||||||
contents = contents.Replace("{tabledata}", tbody.ToString());
|
contents = contents.Replace("{tabledata}", tbody.ToString());
|
||||||
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
||||||
|
|
||||||
|
|
||||||
//공용값 적용
|
//공용값 적용
|
||||||
ApplyCommonValue(ref contents);
|
ApplyCommonValue(ref contents);
|
||||||
|
|
||||||
//최종문자 적용
|
//최종문자 적용
|
||||||
result.Content = contents;
|
result.Content = contents;
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
var resp = new HttpResponseMessage()
|
||||||
{
|
{
|
||||||
Content = new StringContent(
|
Content = new StringContent(
|
||||||
result.Content,
|
result.Content,
|
||||||
System.Text.Encoding.UTF8,
|
System.Text.Encoding.UTF8,
|
||||||
"text/html")
|
"text/html")
|
||||||
};
|
};
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,88 +1,88 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Web.Http;
|
using System.Web.Http;
|
||||||
|
|
||||||
namespace Project
|
namespace Project.Web.Controllers
|
||||||
{
|
{
|
||||||
public class ManualController : BaseController
|
public class ManualController : BaseController
|
||||||
{
|
{
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public void Index([FromBody]string value)
|
public void Index([FromBody]string value)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PUT api/values/5
|
// PUT api/values/5
|
||||||
public void Put(int id, [FromBody]string value)
|
public void Put(int id, [FromBody]string value)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// DELETE api/values/5
|
// DELETE api/values/5
|
||||||
public void Delete(int id)
|
public void Delete(int id)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage Page(string id)
|
public HttpResponseMessage Page(string id)
|
||||||
{
|
{
|
||||||
//로그인이 되어있지않다면 로그인을 가져온다
|
//로그인이 되어있지않다면 로그인을 가져온다
|
||||||
MethodResult result;
|
MethodResult result;
|
||||||
result = View($"\\Manual\\{id}");
|
result = View($"\\Manual\\{id}");
|
||||||
|
|
||||||
var model = GetGlobalModel();
|
var model = GetGlobalModel();
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
//기본값을 찾아서 없애줘야한다
|
//기본값을 찾아서 없애줘야한다
|
||||||
var contents = result.Content;
|
var contents = result.Content;
|
||||||
|
|
||||||
//공용값 적용
|
//공용값 적용
|
||||||
ApplyCommonValue(ref contents);
|
ApplyCommonValue(ref contents);
|
||||||
|
|
||||||
//최종문자 적용
|
//최종문자 적용
|
||||||
result.Content = contents;
|
result.Content = contents;
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
var resp = new HttpResponseMessage()
|
||||||
{
|
{
|
||||||
Content = new StringContent(
|
Content = new StringContent(
|
||||||
result.Content,
|
result.Content,
|
||||||
System.Text.Encoding.UTF8,
|
System.Text.Encoding.UTF8,
|
||||||
"text/html")
|
"text/html")
|
||||||
};
|
};
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage Index()
|
public HttpResponseMessage Index()
|
||||||
{
|
{
|
||||||
//로그인이 되어있지않다면 로그인을 가져온다
|
//로그인이 되어있지않다면 로그인을 가져온다
|
||||||
MethodResult result;
|
MethodResult result;
|
||||||
result = View();
|
result = View();
|
||||||
|
|
||||||
var model = GetGlobalModel();
|
var model = GetGlobalModel();
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
//기본값을 찾아서 없애줘야한다
|
//기본값을 찾아서 없애줘야한다
|
||||||
var contents = result.Content;
|
var contents = result.Content;
|
||||||
|
|
||||||
//공용값 적용
|
//공용값 적용
|
||||||
ApplyCommonValue(ref contents);
|
ApplyCommonValue(ref contents);
|
||||||
|
|
||||||
//최종문자 적용
|
//최종문자 적용
|
||||||
result.Content = contents;
|
result.Content = contents;
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
var resp = new HttpResponseMessage()
|
||||||
{
|
{
|
||||||
Content = new StringContent(
|
Content = new StringContent(
|
||||||
result.Content,
|
result.Content,
|
||||||
System.Text.Encoding.UTF8,
|
System.Text.Encoding.UTF8,
|
||||||
"text/html")
|
"text/html")
|
||||||
};
|
};
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,471 +1,471 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Web.Http;
|
using System.Web.Http;
|
||||||
|
|
||||||
namespace Project
|
namespace Project.Web.Controllers
|
||||||
{
|
{
|
||||||
public class ProjectController : BaseController
|
public class ProjectController : BaseController
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
// PUT api/values/5
|
// PUT api/values/5
|
||||||
public void Put(int id, [FromBody] string value)
|
public void Put(int id, [FromBody] string value)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// DELETE api/values/5
|
// DELETE api/values/5
|
||||||
public void Delete(int id)
|
public void Delete(int id)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public string Test()
|
public string Test()
|
||||||
{
|
{
|
||||||
return "test";
|
return "test";
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage Find()
|
public HttpResponseMessage Find()
|
||||||
{
|
{
|
||||||
//로그인이 되어있지않다면 로그인을 가져온다
|
//로그인이 되어있지않다면 로그인을 가져온다
|
||||||
MethodResult result;
|
MethodResult result;
|
||||||
result = View();
|
result = View();
|
||||||
|
|
||||||
|
|
||||||
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
|
|
||||||
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
||||||
var model = GetGlobalModel();
|
var model = GetGlobalModel();
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
//기본값을 찾아서 없애줘야한다
|
//기본값을 찾아서 없애줘야한다
|
||||||
var searchkey = string.Empty;
|
var searchkey = string.Empty;
|
||||||
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
||||||
|
|
||||||
var tbody = new System.Text.StringBuilder();
|
var tbody = new System.Text.StringBuilder();
|
||||||
|
|
||||||
//테이블데이터생성
|
//테이블데이터생성
|
||||||
var itemcnt = 0;
|
var itemcnt = 0;
|
||||||
if (searchkey.isEmpty() == false)
|
if (searchkey.isEmpty() == false)
|
||||||
{
|
{
|
||||||
//var db = new EEEntitiesProject();
|
//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);
|
//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();
|
//itemcnt = rows.Count();
|
||||||
//foreach (var item in rows)
|
//foreach (var item in rows)
|
||||||
//{
|
//{
|
||||||
// tbody.AppendLine("<tr>");
|
// tbody.AppendLine("<tr>");
|
||||||
// tbody.AppendLine($"<th scope='row'>{item.pdate}</th>");
|
// tbody.AppendLine($"<th scope='row'>{item.pdate}</th>");
|
||||||
// tbody.AppendLine($"<td>{item.name}</td>");
|
// tbody.AppendLine($"<td>{item.name}</td>");
|
||||||
|
|
||||||
|
|
||||||
// //if (item.description.Length > 10)
|
// //if (item.description.Length > 10)
|
||||||
// // tbody.AppendLine($"<td>{item.description.Substring(0, 10)}...</td>");
|
// // tbody.AppendLine($"<td>{item.description.Substring(0, 10)}...</td>");
|
||||||
// //else
|
// //else
|
||||||
// // tbody.AppendLine($"<td>{item.description}</td>");
|
// // tbody.AppendLine($"<td>{item.description}</td>");
|
||||||
// tbody.AppendLine("</tr>");
|
// tbody.AppendLine("</tr>");
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
//아잍쳄이 없는경우
|
//아잍쳄이 없는경우
|
||||||
if (itemcnt == 0)
|
if (itemcnt == 0)
|
||||||
{
|
{
|
||||||
tbody.AppendLine("<tr>");
|
tbody.AppendLine("<tr>");
|
||||||
tbody.AppendLine("<th scope='row'>1</th>");
|
tbody.AppendLine("<th scope='row'>1</th>");
|
||||||
tbody.AppendLine("<td colspan='6'>자료가 없습니다</td>");
|
tbody.AppendLine("<td colspan='6'>자료가 없습니다</td>");
|
||||||
tbody.AppendLine("</tr>");
|
tbody.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var contents = result.Content.Replace("{search}", searchkey);
|
var contents = result.Content.Replace("{search}", searchkey);
|
||||||
contents = contents.Replace("{tabledata}", tbody.ToString());
|
contents = contents.Replace("{tabledata}", tbody.ToString());
|
||||||
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
||||||
|
|
||||||
|
|
||||||
//공용값 적용
|
//공용값 적용
|
||||||
ApplyCommonValue(ref contents);
|
ApplyCommonValue(ref contents);
|
||||||
|
|
||||||
//최종문자 적용
|
//최종문자 적용
|
||||||
result.Content = contents;
|
result.Content = contents;
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
var resp = new HttpResponseMessage()
|
||||||
{
|
{
|
||||||
Content = new StringContent(
|
Content = new StringContent(
|
||||||
result.Content,
|
result.Content,
|
||||||
System.Text.Encoding.UTF8,
|
System.Text.Encoding.UTF8,
|
||||||
"text/html")
|
"text/html")
|
||||||
};
|
};
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage ScheduleConfirm(int? id)
|
public HttpResponseMessage ScheduleConfirm(int? id)
|
||||||
{
|
{
|
||||||
//로그인이 되어있지않다면 로그인을 가져온다
|
//로그인이 되어있지않다면 로그인을 가져온다
|
||||||
MethodResult result;
|
MethodResult result;
|
||||||
result = View();
|
result = View();
|
||||||
var project = (int)id;
|
var project = (int)id;
|
||||||
|
|
||||||
//데이터를 조회해서 표시를 해준다.
|
//데이터를 조회해서 표시를 해준다.
|
||||||
var db = new dsProjectsTableAdapters.ProjectsTableAdapter();// EEEntitiesProject();
|
var db = new dsProjectsTableAdapters.ProjectsTableAdapter();// EEEntitiesProject();
|
||||||
var prjinfo = db.GetData(FCOMMON.info.Login.gcode, project).FirstOrDefault();// db.Projects.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.idx == project).FirstOrDefault();
|
var prjinfo = db.GetData(FCOMMON.info.Login.gcode, project).FirstOrDefault();// db.Projects.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.idx == project).FirstOrDefault();
|
||||||
|
|
||||||
var taSch = new dsProjectsTableAdapters.EETGW_ProjectsScheduleTableAdapter();
|
var taSch = new dsProjectsTableAdapters.EETGW_ProjectsScheduleTableAdapter();
|
||||||
var schrows = taSch.GetData(FCOMMON.info.Login.gcode, project);//. db.EETGW_ProjectsSchedule.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.project == project).OrderByDescending(t => t.project).OrderByDescending(t => t.no).OrderBy(t => t.seq);
|
var schrows = taSch.GetData(FCOMMON.info.Login.gcode, project);//. db.EETGW_ProjectsSchedule.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.project == project).OrderByDescending(t => t.project).OrderByDescending(t => t.no).OrderBy(t => t.seq);
|
||||||
|
|
||||||
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
|
|
||||||
System.Text.StringBuilder tinfo = new System.Text.StringBuilder();
|
System.Text.StringBuilder tinfo = new System.Text.StringBuilder();
|
||||||
//프로젝트정보를 표시합니다.
|
//프로젝트정보를 표시합니다.
|
||||||
tinfo.AppendLine("<tr>");
|
tinfo.AppendLine("<tr>");
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.idx));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.idx));
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.status));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.status));
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.progress));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.progress));
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.name));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.name));
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.reqstaff));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.reqstaff));
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.userManager));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.userManager));
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.orderno));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.orderno));
|
||||||
tinfo.AppendLine("</tr>");
|
tinfo.AppendLine("</tr>");
|
||||||
|
|
||||||
|
|
||||||
var contents = result.Content.Replace("{search}", "");
|
var contents = result.Content.Replace("{search}", "");
|
||||||
contents = contents.Replace("{tableinfo}", tinfo.ToString());
|
contents = contents.Replace("{tableinfo}", tinfo.ToString());
|
||||||
|
|
||||||
tinfo.Clear();
|
tinfo.Clear();
|
||||||
foreach (var item in schrows)
|
foreach (var item in schrows)
|
||||||
{
|
{
|
||||||
tinfo.AppendLine("<tr>");
|
tinfo.AppendLine("<tr>");
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", item.no));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", item.no));
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", item.seq));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", item.seq));
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", item.title));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", item.title));
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", item.sw));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", item.sw));
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", item.ew));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", item.ew));
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", item.swa));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", item.swa));
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", item.ewa));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", item.ewa));
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", item.progress));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", item.progress));
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", item.uid));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", item.uid));
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", item.memo));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", item.memo));
|
||||||
tinfo.AppendLine("</tr>");
|
tinfo.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
contents = contents.Replace("{scheinfo}", tinfo.ToString());
|
contents = contents.Replace("{scheinfo}", tinfo.ToString());
|
||||||
//공용값 적용
|
//공용값 적용
|
||||||
ApplyCommonValue(ref contents);
|
ApplyCommonValue(ref contents);
|
||||||
|
|
||||||
//최종문자 적용
|
//최종문자 적용
|
||||||
result.Content = contents;
|
result.Content = contents;
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
var resp = new HttpResponseMessage()
|
||||||
{
|
{
|
||||||
Content = new StringContent(
|
Content = new StringContent(
|
||||||
result.Content,
|
result.Content,
|
||||||
System.Text.Encoding.UTF8,
|
System.Text.Encoding.UTF8,
|
||||||
"text/html")
|
"text/html")
|
||||||
};
|
};
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage Index()
|
public HttpResponseMessage Index()
|
||||||
{
|
{
|
||||||
//로그인이 되어있지않다면 로그인을 가져온다
|
//로그인이 되어있지않다면 로그인을 가져온다
|
||||||
MethodResult result;
|
MethodResult result;
|
||||||
result = View();
|
result = View();
|
||||||
|
|
||||||
|
|
||||||
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
|
|
||||||
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
||||||
var model = GetGlobalModel();
|
var model = GetGlobalModel();
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
//기본값을 찾아서 없애줘야한다
|
//기본값을 찾아서 없애줘야한다
|
||||||
var searchkey = string.Empty;
|
var searchkey = string.Empty;
|
||||||
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
||||||
|
|
||||||
var tbody = new System.Text.StringBuilder();
|
var tbody = new System.Text.StringBuilder();
|
||||||
|
|
||||||
//테이블데이터생성
|
//테이블데이터생성
|
||||||
var itemcnt = 0;
|
var itemcnt = 0;
|
||||||
//if (searchkey.isEmpty() == false)
|
//if (searchkey.isEmpty() == false)
|
||||||
{
|
{
|
||||||
|
|
||||||
var db = new dsProjectsTableAdapters.ProjectsTableAdapter();// EEEntitiesProject();
|
var db = new dsProjectsTableAdapters.ProjectsTableAdapter();// EEEntitiesProject();
|
||||||
|
|
||||||
|
|
||||||
var rows = db.GetNotCompleteTop50(FCOMMON.info.Login.gcode);//.Projects.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.status.Contains("완료") == false).OrderByDescending(t => t.pdate).Take(50);
|
var rows = db.GetNotCompleteTop50(FCOMMON.info.Login.gcode);//.Projects.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.status.Contains("완료") == false).OrderByDescending(t => t.pdate).Take(50);
|
||||||
|
|
||||||
itemcnt = rows.Count();
|
itemcnt = rows.Count();
|
||||||
foreach (var item in rows)
|
foreach (var item in rows)
|
||||||
{
|
{
|
||||||
tbody.AppendLine("<tr>");
|
tbody.AppendLine("<tr>");
|
||||||
tbody.AppendLine($"<th scope='row'>{item.idx}</th>");
|
tbody.AppendLine($"<th scope='row'>{item.idx}</th>");
|
||||||
tbody.AppendLine($"<td>{item.status}</td>");
|
tbody.AppendLine($"<td>{item.status}</td>");
|
||||||
tbody.AppendLine($"<td>{item.progress}</td>");
|
tbody.AppendLine($"<td>{item.progress}</td>");
|
||||||
tbody.AppendLine($"<td>{item.name}</td>");
|
tbody.AppendLine($"<td>{item.name}</td>");
|
||||||
tbody.AppendLine($"<td>{item.reqstaff}</td>");
|
tbody.AppendLine($"<td>{item.reqstaff}</td>");
|
||||||
tbody.AppendLine($"<td>{item.userManager}</td>");
|
tbody.AppendLine($"<td>{item.userManager}</td>");
|
||||||
tbody.AppendLine($"<td>{item.cnt}</td>");
|
tbody.AppendLine($"<td>{item.cnt}</td>");
|
||||||
tbody.AppendLine($"<td>{item.costo}</td>");
|
tbody.AppendLine($"<td>{item.costo}</td>");
|
||||||
tbody.AppendLine($"<td>{item.costn}</td>");
|
tbody.AppendLine($"<td>{item.costn}</td>");
|
||||||
tbody.AppendLine($"<td>{item.costo - item.costn}</td>");
|
tbody.AppendLine($"<td>{item.costo - item.costn}</td>");
|
||||||
tbody.AppendLine($"<td>{item.orderno}</td>");
|
tbody.AppendLine($"<td>{item.orderno}</td>");
|
||||||
if (item.memo != null)
|
if (item.memo != null)
|
||||||
tbody.AppendLine($"<td>{item.memo}</td>");
|
tbody.AppendLine($"<td>{item.memo}</td>");
|
||||||
else
|
else
|
||||||
tbody.AppendLine($"<td> </td>");
|
tbody.AppendLine($"<td> </td>");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//if (item.description.Length > 10)
|
//if (item.description.Length > 10)
|
||||||
// tbody.AppendLine($"<td>{item.description.Substring(0, 10)}...</td>");
|
// tbody.AppendLine($"<td>{item.description.Substring(0, 10)}...</td>");
|
||||||
//else
|
//else
|
||||||
// tbody.AppendLine($"<td>{item.description}</td>");
|
// tbody.AppendLine($"<td>{item.description}</td>");
|
||||||
tbody.AppendLine("</tr>");
|
tbody.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//아잍쳄이 없는경우
|
//아잍쳄이 없는경우
|
||||||
if (itemcnt == 0)
|
if (itemcnt == 0)
|
||||||
{
|
{
|
||||||
tbody.AppendLine("<tr>");
|
tbody.AppendLine("<tr>");
|
||||||
tbody.AppendLine("<th scope='row'>1</th>");
|
tbody.AppendLine("<th scope='row'>1</th>");
|
||||||
tbody.AppendLine("<td colspan='6'>자료가 없습니다</td>");
|
tbody.AppendLine("<td colspan='6'>자료가 없습니다</td>");
|
||||||
tbody.AppendLine("</tr>");
|
tbody.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var contents = result.Content.Replace("{search}", searchkey);
|
var contents = result.Content.Replace("{search}", searchkey);
|
||||||
contents = contents.Replace("{tabledata}", tbody.ToString());
|
contents = contents.Replace("{tabledata}", tbody.ToString());
|
||||||
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
||||||
|
|
||||||
|
|
||||||
//공용값 적용
|
//공용값 적용
|
||||||
ApplyCommonValue(ref contents);
|
ApplyCommonValue(ref contents);
|
||||||
|
|
||||||
//최종문자 적용
|
//최종문자 적용
|
||||||
result.Content = contents;
|
result.Content = contents;
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
var resp = new HttpResponseMessage()
|
||||||
{
|
{
|
||||||
Content = new StringContent(
|
Content = new StringContent(
|
||||||
result.Content,
|
result.Content,
|
||||||
System.Text.Encoding.UTF8,
|
System.Text.Encoding.UTF8,
|
||||||
"text/html")
|
"text/html")
|
||||||
};
|
};
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage detail(int id)
|
public HttpResponseMessage detail(int id)
|
||||||
{
|
{
|
||||||
//로그인이 되어있지않다면 로그인을 가져온다
|
//로그인이 되어있지않다면 로그인을 가져온다
|
||||||
MethodResult result;
|
MethodResult result;
|
||||||
result = View();
|
result = View();
|
||||||
|
|
||||||
|
|
||||||
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
|
|
||||||
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
||||||
var model = GetGlobalModel();
|
var model = GetGlobalModel();
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
//기본값을 찾아서 없애줘야한다
|
//기본값을 찾아서 없애줘야한다
|
||||||
var searchkey = string.Empty;
|
var searchkey = string.Empty;
|
||||||
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
||||||
|
|
||||||
var tbody = new System.Text.StringBuilder();
|
var tbody = new System.Text.StringBuilder();
|
||||||
|
|
||||||
//테이블데이터생성
|
//테이블데이터생성
|
||||||
var itemcnt = 0;
|
var itemcnt = 0;
|
||||||
//if (searchkey.isEmpty() == false)
|
//if (searchkey.isEmpty() == false)
|
||||||
{
|
{
|
||||||
|
|
||||||
var db = new dsProjectsTableAdapters.ProjectsTableAdapter();// EEEntitiesProject();
|
var db = new dsProjectsTableAdapters.ProjectsTableAdapter();// EEEntitiesProject();
|
||||||
|
|
||||||
|
|
||||||
var rows = db.GetNotCompleteTop50(FCOMMON.info.Login.gcode);// db.Projects.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.status.Contains("완료") == false).OrderByDescending(t => t.pdate).Take(50);
|
var rows = db.GetNotCompleteTop50(FCOMMON.info.Login.gcode);// db.Projects.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.status.Contains("완료") == false).OrderByDescending(t => t.pdate).Take(50);
|
||||||
|
|
||||||
itemcnt = rows.Count();
|
itemcnt = rows.Count();
|
||||||
foreach (var item in rows)
|
foreach (var item in rows)
|
||||||
{
|
{
|
||||||
tbody.AppendLine("<tr>");
|
tbody.AppendLine("<tr>");
|
||||||
tbody.AppendLine($"<th scope='row'>{item.idx}</th>");
|
tbody.AppendLine($"<th scope='row'>{item.idx}</th>");
|
||||||
tbody.AppendLine($"<td>{item.status}</td>");
|
tbody.AppendLine($"<td>{item.status}</td>");
|
||||||
tbody.AppendLine($"<td>{item.progress}</td>");
|
tbody.AppendLine($"<td>{item.progress}</td>");
|
||||||
tbody.AppendLine($"<td>{item.name}</td>");
|
tbody.AppendLine($"<td>{item.name}</td>");
|
||||||
tbody.AppendLine($"<td>{item.reqstaff}</td>");
|
tbody.AppendLine($"<td>{item.reqstaff}</td>");
|
||||||
tbody.AppendLine($"<td>{item.userManager}</td>");
|
tbody.AppendLine($"<td>{item.userManager}</td>");
|
||||||
tbody.AppendLine($"<td>{item.cnt}</td>");
|
tbody.AppendLine($"<td>{item.cnt}</td>");
|
||||||
tbody.AppendLine($"<td>{item.costo}</td>");
|
tbody.AppendLine($"<td>{item.costo}</td>");
|
||||||
tbody.AppendLine($"<td>{item.costn}</td>");
|
tbody.AppendLine($"<td>{item.costn}</td>");
|
||||||
tbody.AppendLine($"<td>{item.costo - item.costn}</td>");
|
tbody.AppendLine($"<td>{item.costo - item.costn}</td>");
|
||||||
tbody.AppendLine($"<td>{item.orderno}</td>");
|
tbody.AppendLine($"<td>{item.orderno}</td>");
|
||||||
if (item.memo != null)
|
if (item.memo != null)
|
||||||
tbody.AppendLine($"<td>{item.memo}</td>");
|
tbody.AppendLine($"<td>{item.memo}</td>");
|
||||||
else
|
else
|
||||||
tbody.AppendLine($"<td> </td>");
|
tbody.AppendLine($"<td> </td>");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//if (item.description.Length > 10)
|
//if (item.description.Length > 10)
|
||||||
// tbody.AppendLine($"<td>{item.description.Substring(0, 10)}...</td>");
|
// tbody.AppendLine($"<td>{item.description.Substring(0, 10)}...</td>");
|
||||||
//else
|
//else
|
||||||
// tbody.AppendLine($"<td>{item.description}</td>");
|
// tbody.AppendLine($"<td>{item.description}</td>");
|
||||||
tbody.AppendLine("</tr>");
|
tbody.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//아잍쳄이 없는경우
|
//아잍쳄이 없는경우
|
||||||
if (itemcnt == 0)
|
if (itemcnt == 0)
|
||||||
{
|
{
|
||||||
tbody.AppendLine("<tr>");
|
tbody.AppendLine("<tr>");
|
||||||
tbody.AppendLine("<th scope='row'>1</th>");
|
tbody.AppendLine("<th scope='row'>1</th>");
|
||||||
tbody.AppendLine("<td colspan='6'>자료가 없습니다</td>");
|
tbody.AppendLine("<td colspan='6'>자료가 없습니다</td>");
|
||||||
tbody.AppendLine("</tr>");
|
tbody.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var contents = result.Content.Replace("{search}", searchkey);
|
var contents = result.Content.Replace("{search}", searchkey);
|
||||||
contents = contents.Replace("{tabledata}", tbody.ToString());
|
contents = contents.Replace("{tabledata}", tbody.ToString());
|
||||||
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
||||||
contents = contents.Replace("{pidx}", id.ToString());
|
contents = contents.Replace("{pidx}", id.ToString());
|
||||||
|
|
||||||
|
|
||||||
//공용값 적용
|
//공용값 적용
|
||||||
ApplyCommonValue(ref contents);
|
ApplyCommonValue(ref contents);
|
||||||
|
|
||||||
//최종문자 적용
|
//최종문자 적용
|
||||||
result.Content = contents;
|
result.Content = contents;
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
var resp = new HttpResponseMessage()
|
||||||
{
|
{
|
||||||
Content = new StringContent(
|
Content = new StringContent(
|
||||||
result.Content,
|
result.Content,
|
||||||
System.Text.Encoding.UTF8,
|
System.Text.Encoding.UTF8,
|
||||||
"text/html")
|
"text/html")
|
||||||
};
|
};
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage partlist(int id)
|
public HttpResponseMessage partlist(int id)
|
||||||
{
|
{
|
||||||
//로그인이 되어있지않다면 로그인을 가져온다
|
//로그인이 되어있지않다면 로그인을 가져온다
|
||||||
MethodResult result;
|
MethodResult result;
|
||||||
result = View();
|
result = View();
|
||||||
|
|
||||||
|
|
||||||
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
|
|
||||||
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
||||||
var model = GetGlobalModel();
|
var model = GetGlobalModel();
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
//기본값을 찾아서 없애줘야한다
|
//기본값을 찾아서 없애줘야한다
|
||||||
var searchkey = string.Empty;
|
var searchkey = string.Empty;
|
||||||
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
||||||
|
|
||||||
var tbody = new System.Text.StringBuilder();
|
var tbody = new System.Text.StringBuilder();
|
||||||
|
|
||||||
|
|
||||||
var contents = result.Content.Replace("{search}", searchkey);
|
var contents = result.Content.Replace("{search}", searchkey);
|
||||||
|
|
||||||
|
|
||||||
//테이블데이터생성
|
//테이블데이터생성
|
||||||
var itemcnt = 0;
|
var itemcnt = 0;
|
||||||
//if (searchkey.isEmpty() == false)
|
//if (searchkey.isEmpty() == false)
|
||||||
{
|
{
|
||||||
|
|
||||||
var db = new dsProjectsTableAdapters.ProjectsTableAdapter();// EEEntitiesProject();
|
var db = new dsProjectsTableAdapters.ProjectsTableAdapter();// EEEntitiesProject();
|
||||||
|
|
||||||
var prjinfo = db.GetData(FCOMMON.info.Login.gcode, id).FirstOrDefault();// db.Projects.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.idx == id).FirstOrDefault();
|
var prjinfo = db.GetData(FCOMMON.info.Login.gcode, id).FirstOrDefault();// db.Projects.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.idx == id).FirstOrDefault();
|
||||||
System.Text.StringBuilder tinfo = new System.Text.StringBuilder();
|
System.Text.StringBuilder tinfo = new System.Text.StringBuilder();
|
||||||
//프로젝트정보를 표시합니다.
|
//프로젝트정보를 표시합니다.
|
||||||
tinfo.AppendLine("<tr>");
|
tinfo.AppendLine("<tr>");
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.idx));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.idx));
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.status));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.status));
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.progress));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.progress));
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.name));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.name));
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.reqstaff));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.reqstaff));
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.userManager));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.userManager));
|
||||||
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.orderno));
|
tinfo.AppendLine(string.Format("<td>{0}</td>", prjinfo.orderno));
|
||||||
tinfo.AppendLine("</tr>");
|
tinfo.AppendLine("</tr>");
|
||||||
|
|
||||||
contents = contents.Replace("{tableinfo}", tinfo.ToString());
|
contents = contents.Replace("{tableinfo}", tinfo.ToString());
|
||||||
|
|
||||||
var taPart = new dsProjectsTableAdapters.ProjectsPartTableAdapter();
|
var taPart = new dsProjectsTableAdapters.ProjectsPartTableAdapter();
|
||||||
var rows = taPart.GetData(id);// db.ProjectsPart.Where(t => t.Project == id).OrderBy(t=>t.no);
|
var rows = taPart.GetData(id);// db.ProjectsPart.Where(t => t.Project == id).OrderBy(t=>t.no);
|
||||||
|
|
||||||
itemcnt = rows.Count();
|
itemcnt = rows.Count();
|
||||||
foreach (var item in rows)
|
foreach (var item in rows)
|
||||||
{
|
{
|
||||||
tbody.AppendLine("<tr>");
|
tbody.AppendLine("<tr>");
|
||||||
tbody.AppendLine($"<th scope='row'>{item.no}</th>");
|
tbody.AppendLine($"<th scope='row'>{item.no}</th>");
|
||||||
tbody.AppendLine($"<td>{item.ItemGroup}</td>");
|
tbody.AppendLine($"<td>{item.ItemGroup}</td>");
|
||||||
tbody.AppendLine($"<td>{item.ItemModel}</td>");
|
tbody.AppendLine($"<td>{item.ItemModel}</td>");
|
||||||
tbody.AppendLine($"<td>{item.ItemUnit}</td>");
|
tbody.AppendLine($"<td>{item.ItemUnit}</td>");
|
||||||
tbody.AppendLine($"<td>{item.ItemName}</td>");
|
tbody.AppendLine($"<td>{item.ItemName}</td>");
|
||||||
tbody.AppendLine($"<td>{item.ItemSid}</td>");
|
tbody.AppendLine($"<td>{item.ItemSid}</td>");
|
||||||
tbody.AppendLine($"<td>{item.ItemManu}</td>");
|
tbody.AppendLine($"<td>{item.ItemManu}</td>");
|
||||||
tbody.AppendLine($"<td>{item.qty}</td>");
|
tbody.AppendLine($"<td>{item.qty}</td>");
|
||||||
tbody.AppendLine($"<td>{item.qtyn}</td>");
|
tbody.AppendLine($"<td>{item.qtyn}</td>");
|
||||||
tbody.AppendLine($"<td>{item.price}</td>");
|
tbody.AppendLine($"<td>{item.price}</td>");
|
||||||
tbody.AppendLine($"<td>{item.amt}</td>");
|
tbody.AppendLine($"<td>{item.amt}</td>");
|
||||||
tbody.AppendLine($"<td>{item.amtn}</td>");
|
tbody.AppendLine($"<td>{item.amtn}</td>");
|
||||||
tbody.AppendLine($"<td>{item.remark}</td>");
|
tbody.AppendLine($"<td>{item.remark}</td>");
|
||||||
tbody.AppendLine($"<td>{item.qtybuy}</td>");
|
tbody.AppendLine($"<td>{item.qtybuy}</td>");
|
||||||
tbody.AppendLine($"<td>{item.qtyin}</td>");
|
tbody.AppendLine($"<td>{item.qtyin}</td>");
|
||||||
tbody.AppendLine($"<td>{item.bbuy}</td>");
|
tbody.AppendLine($"<td>{item.bbuy}</td>");
|
||||||
tbody.AppendLine($"<td>{item.bconfirm}</td>");
|
tbody.AppendLine($"<td>{item.bconfirm}</td>");
|
||||||
tbody.AppendLine("</tr>");
|
tbody.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//아잍쳄이 없는경우
|
//아잍쳄이 없는경우
|
||||||
if (itemcnt == 0)
|
if (itemcnt == 0)
|
||||||
{
|
{
|
||||||
tbody.AppendLine("<tr>");
|
tbody.AppendLine("<tr>");
|
||||||
tbody.AppendLine("<th scope='row'>1</th>");
|
tbody.AppendLine("<th scope='row'>1</th>");
|
||||||
tbody.AppendLine("<td colspan='6'>자료가 없습니다</td>");
|
tbody.AppendLine("<td colspan='6'>자료가 없습니다</td>");
|
||||||
tbody.AppendLine("</tr>");
|
tbody.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
contents = contents.Replace("{tabledata}", tbody.ToString());
|
contents = contents.Replace("{tabledata}", tbody.ToString());
|
||||||
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
||||||
contents = contents.Replace("{pidx}", id.ToString());
|
contents = contents.Replace("{pidx}", id.ToString());
|
||||||
|
|
||||||
|
|
||||||
//공용값 적용
|
//공용값 적용
|
||||||
ApplyCommonValue(ref contents);
|
ApplyCommonValue(ref contents);
|
||||||
|
|
||||||
//최종문자 적용
|
//최종문자 적용
|
||||||
result.Content = contents;
|
result.Content = contents;
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
var resp = new HttpResponseMessage()
|
||||||
{
|
{
|
||||||
Content = new StringContent(
|
Content = new StringContent(
|
||||||
result.Content,
|
result.Content,
|
||||||
System.Text.Encoding.UTF8,
|
System.Text.Encoding.UTF8,
|
||||||
"text/html")
|
"text/html")
|
||||||
};
|
};
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,215 +1,215 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Web.Http;
|
using System.Web.Http;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace Project
|
namespace Project.Web.Controllers
|
||||||
{
|
{
|
||||||
public class PurchaseController : BaseController
|
public class PurchaseController : BaseController
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
// PUT api/values/5
|
// PUT api/values/5
|
||||||
public void Put(int id, [FromBody] string value)
|
public void Put(int id, [FromBody] string value)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// DELETE api/values/5
|
// DELETE api/values/5
|
||||||
public void Delete(int id)
|
public void Delete(int id)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public string Test()
|
public string Test()
|
||||||
{
|
{
|
||||||
return "test";
|
return "test";
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage Find()
|
public HttpResponseMessage Find()
|
||||||
{
|
{
|
||||||
//로그인이 되어있지않다면 로그인을 가져온다
|
//로그인이 되어있지않다면 로그인을 가져온다
|
||||||
MethodResult result;
|
MethodResult result;
|
||||||
result = View();
|
result = View();
|
||||||
|
|
||||||
|
|
||||||
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
|
|
||||||
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
||||||
var model = GetGlobalModel();
|
var model = GetGlobalModel();
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
//기본값을 찾아서 없애줘야한다
|
//기본값을 찾아서 없애줘야한다
|
||||||
var searchkey = string.Empty;
|
var searchkey = string.Empty;
|
||||||
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
||||||
|
|
||||||
if(searchkey.isEmpty()==false && searchkey != "%")
|
if(searchkey.isEmpty()==false && searchkey != "%")
|
||||||
{
|
{
|
||||||
if (searchkey.StartsWith("%") == false) searchkey = "%" + searchkey;
|
if (searchkey.StartsWith("%") == false) searchkey = "%" + searchkey;
|
||||||
if (searchkey.EndsWith("%") == false) searchkey += "%";
|
if (searchkey.EndsWith("%") == false) searchkey += "%";
|
||||||
}
|
}
|
||||||
|
|
||||||
var tbody = new System.Text.StringBuilder();
|
var tbody = new System.Text.StringBuilder();
|
||||||
|
|
||||||
//테이블데이터생성
|
//테이블데이터생성
|
||||||
var itemcnt = 0;
|
var itemcnt = 0;
|
||||||
if (searchkey.isEmpty() == false)
|
if (searchkey.isEmpty() == false)
|
||||||
{
|
{
|
||||||
var db = new dsMSSQLTableAdapters.vFindSIDTableAdapter();// EEEntitiesMain();
|
var db = new dsMSSQLTableAdapters.vFindSIDTableAdapter();// EEEntitiesMain();
|
||||||
var rows = db.GetData(searchkey);//.vFindSID.Where(t => t.sid.Contains(searchkey) || t.name.Contains(searchkey) || t.manu.Contains(searchkey) || t.model.Contains(searchkey));
|
var rows = db.GetData(searchkey);//.vFindSID.Where(t => t.sid.Contains(searchkey) || t.name.Contains(searchkey) || t.manu.Contains(searchkey) || t.model.Contains(searchkey));
|
||||||
itemcnt = rows.Count();
|
itemcnt = rows.Count();
|
||||||
foreach (var item in rows)
|
foreach (var item in rows)
|
||||||
{
|
{
|
||||||
tbody.AppendLine("<tr>");
|
tbody.AppendLine("<tr>");
|
||||||
tbody.AppendLine($"<th scope='row'>{item.Location}</th>");
|
tbody.AppendLine($"<th scope='row'>{item.Location}</th>");
|
||||||
tbody.AppendLine($"<td>{item.sid}</td>");
|
tbody.AppendLine($"<td>{item.sid}</td>");
|
||||||
tbody.AppendLine($"<td>{item.name}</td>");
|
tbody.AppendLine($"<td>{item.name}</td>");
|
||||||
tbody.AppendLine($"<td>{item.model}</td>");
|
tbody.AppendLine($"<td>{item.model}</td>");
|
||||||
|
|
||||||
if (item.IspriceNull())
|
if (item.IspriceNull())
|
||||||
tbody.AppendLine($"<td>--</td>");
|
tbody.AppendLine($"<td>--</td>");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var price = (double)item.price / 1000.0;
|
var price = (double)item.price / 1000.0;
|
||||||
|
|
||||||
tbody.AppendLine($"<td>{price.ToString("N0")}</td>");
|
tbody.AppendLine($"<td>{price.ToString("N0")}</td>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tbody.AppendLine($"<td>{item.manu}</td>");
|
tbody.AppendLine($"<td>{item.manu}</td>");
|
||||||
tbody.AppendLine($"<td>{item.supply}</td>");
|
tbody.AppendLine($"<td>{item.supply}</td>");
|
||||||
|
|
||||||
if (item.remark.Length > 10)
|
if (item.remark.Length > 10)
|
||||||
tbody.AppendLine($"<td>{item.remark.Substring(0, 10)}...</td>");
|
tbody.AppendLine($"<td>{item.remark.Substring(0, 10)}...</td>");
|
||||||
else
|
else
|
||||||
tbody.AppendLine($"<td>{item.remark}</td>");
|
tbody.AppendLine($"<td>{item.remark}</td>");
|
||||||
tbody.AppendLine("</tr>");
|
tbody.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//아잍쳄이 없는경우
|
//아잍쳄이 없는경우
|
||||||
if (itemcnt == 0)
|
if (itemcnt == 0)
|
||||||
{
|
{
|
||||||
tbody.AppendLine("<tr>");
|
tbody.AppendLine("<tr>");
|
||||||
tbody.AppendLine("<th scope='row'>1</th>");
|
tbody.AppendLine("<th scope='row'>1</th>");
|
||||||
tbody.AppendLine("<td colspan='6'>자료가 없습니다</td>");
|
tbody.AppendLine("<td colspan='6'>자료가 없습니다</td>");
|
||||||
tbody.AppendLine("</tr>");
|
tbody.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var contents = result.Content.Replace("{search}", searchkey);
|
var contents = result.Content.Replace("{search}", searchkey);
|
||||||
contents = contents.Replace("{tabledata}", tbody.ToString());
|
contents = contents.Replace("{tabledata}", tbody.ToString());
|
||||||
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
||||||
|
|
||||||
|
|
||||||
//공용값 적용
|
//공용값 적용
|
||||||
ApplyCommonValue(ref contents);
|
ApplyCommonValue(ref contents);
|
||||||
|
|
||||||
//최종문자 적용
|
//최종문자 적용
|
||||||
result.Content = contents;
|
result.Content = contents;
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
var resp = new HttpResponseMessage()
|
||||||
{
|
{
|
||||||
Content = new StringContent(
|
Content = new StringContent(
|
||||||
result.Content,
|
result.Content,
|
||||||
System.Text.Encoding.UTF8,
|
System.Text.Encoding.UTF8,
|
||||||
"text/html")
|
"text/html")
|
||||||
};
|
};
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage Index()
|
public HttpResponseMessage Index()
|
||||||
{
|
{
|
||||||
//로그인이 되어있지않다면 로그인을 가져온다
|
//로그인이 되어있지않다면 로그인을 가져온다
|
||||||
MethodResult result;
|
MethodResult result;
|
||||||
result = View();
|
result = View();
|
||||||
|
|
||||||
|
|
||||||
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var gets = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
|
|
||||||
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
var key_search = gets.Where(t => t.Key == "search").FirstOrDefault();
|
||||||
var model = GetGlobalModel();
|
var model = GetGlobalModel();
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
//기본값을 찾아서 없애줘야한다
|
//기본값을 찾아서 없애줘야한다
|
||||||
var searchkey = string.Empty;
|
var searchkey = string.Empty;
|
||||||
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
if (key_search.Key != null && key_search.Value.isEmpty() == false) searchkey = key_search.Value.Trim();
|
||||||
|
|
||||||
var tbody = new System.Text.StringBuilder();
|
var tbody = new System.Text.StringBuilder();
|
||||||
|
|
||||||
//테이블데이터생성
|
//테이블데이터생성
|
||||||
var itemcnt = 0;
|
var itemcnt = 0;
|
||||||
//if (searchkey.isEmpty() == false)
|
//if (searchkey.isEmpty() == false)
|
||||||
//{
|
//{
|
||||||
var db = new dsMSSQLTableAdapters.vPurchaseTableAdapter();// EEEntitiesPurchase();
|
var db = new dsMSSQLTableAdapters.vPurchaseTableAdapter();// EEEntitiesPurchase();
|
||||||
var sd = DateTime.Now.ToString("yyyy-MM-01");
|
var sd = DateTime.Now.ToString("yyyy-MM-01");
|
||||||
var rows = db.GetAfter(FCOMMON.info.Login.gcode, sd);// .vPurchase.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.pdate.CompareTo(sd) >= 0).OrderByDescending(t => t.pdate);
|
var rows = db.GetAfter(FCOMMON.info.Login.gcode, sd);// .vPurchase.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.pdate.CompareTo(sd) >= 0).OrderByDescending(t => t.pdate);
|
||||||
itemcnt = rows.Count();
|
itemcnt = rows.Count();
|
||||||
foreach (var item in rows)
|
foreach (var item in rows)
|
||||||
{
|
{
|
||||||
tbody.AppendLine("<tr>");
|
tbody.AppendLine("<tr>");
|
||||||
tbody.AppendLine($"<th scope='row'>{item.pdate.Substring(5)}</th>");
|
tbody.AppendLine($"<th scope='row'>{item.pdate.Substring(5)}</th>");
|
||||||
|
|
||||||
if (item.state == "---") tbody.AppendLine($"<td class='table-info'>{item.state}</td>");
|
if (item.state == "---") tbody.AppendLine($"<td class='table-info'>{item.state}</td>");
|
||||||
else if (item.state == "Received") tbody.AppendLine($"<td class='table-success'>{item.state}</td>");
|
else if (item.state == "Received") tbody.AppendLine($"<td class='table-success'>{item.state}</td>");
|
||||||
else tbody.AppendLine($"<td>{item.state}</td>");
|
else tbody.AppendLine($"<td>{item.state}</td>");
|
||||||
|
|
||||||
tbody.AppendLine($"<td>{item.name}</td>");
|
tbody.AppendLine($"<td>{item.name}</td>");
|
||||||
tbody.AppendLine($"<td>{item.sid}</td>");
|
tbody.AppendLine($"<td>{item.sid}</td>");
|
||||||
tbody.AppendLine($"<td>{item.pumname}</td>");
|
tbody.AppendLine($"<td>{item.pumname}</td>");
|
||||||
|
|
||||||
if (item.pumscale.Length > 10) tbody.AppendLine($"<td>{item.pumscale.Substring(0, 10)}...</td>");
|
if (item.pumscale.Length > 10) tbody.AppendLine($"<td>{item.pumscale.Substring(0, 10)}...</td>");
|
||||||
else tbody.AppendLine($"<td>{item.pumscale}</td>");
|
else tbody.AppendLine($"<td>{item.pumscale}</td>");
|
||||||
|
|
||||||
tbody.AppendLine($"<td>{item.pumqty}</td>");
|
tbody.AppendLine($"<td>{item.pumqty}</td>");
|
||||||
tbody.AppendLine($"<td>{item.pumprice}</td>");
|
tbody.AppendLine($"<td>{item.pumprice}</td>");
|
||||||
tbody.AppendLine($"<td>{item.pumamt}</td>");
|
tbody.AppendLine($"<td>{item.pumamt}</td>");
|
||||||
tbody.AppendLine($"<td>{item.supply}</td>");
|
tbody.AppendLine($"<td>{item.supply}</td>");
|
||||||
if (item.project != null && item.project.Length > 10) tbody.AppendLine($"<td>{item.project.Substring(0, 10)}...</td>");
|
if (item.project != null && item.project.Length > 10) tbody.AppendLine($"<td>{item.project.Substring(0, 10)}...</td>");
|
||||||
else tbody.AppendLine($"<td>{item.project}</td>");
|
else tbody.AppendLine($"<td>{item.project}</td>");
|
||||||
|
|
||||||
if (item.bigo.Length > 10) tbody.AppendLine($"<td>{item.bigo.Substring(0, 10)}...</td>");
|
if (item.bigo.Length > 10) tbody.AppendLine($"<td>{item.bigo.Substring(0, 10)}...</td>");
|
||||||
else tbody.AppendLine($"<td>{item.bigo}</td>");
|
else tbody.AppendLine($"<td>{item.bigo}</td>");
|
||||||
tbody.AppendLine("</tr>");
|
tbody.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//아잍쳄이 없는경우
|
//아잍쳄이 없는경우
|
||||||
if (itemcnt == 0)
|
if (itemcnt == 0)
|
||||||
{
|
{
|
||||||
tbody.AppendLine("<tr>");
|
tbody.AppendLine("<tr>");
|
||||||
tbody.AppendLine("<th scope='row'>1</th>");
|
tbody.AppendLine("<th scope='row'>1</th>");
|
||||||
tbody.AppendLine("<td colspan='6'>자료가 없습니다</td>");
|
tbody.AppendLine("<td colspan='6'>자료가 없습니다</td>");
|
||||||
tbody.AppendLine("</tr>");
|
tbody.AppendLine("</tr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var contents = result.Content.Replace("{search}", searchkey);
|
var contents = result.Content.Replace("{search}", searchkey);
|
||||||
contents = contents.Replace("{tabledata}", tbody.ToString());
|
contents = contents.Replace("{tabledata}", tbody.ToString());
|
||||||
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
contents = contents.Replace("{cnt}", itemcnt.ToString());
|
||||||
|
|
||||||
|
|
||||||
//공용값 적용
|
//공용값 적용
|
||||||
ApplyCommonValue(ref contents);
|
ApplyCommonValue(ref contents);
|
||||||
|
|
||||||
//최종문자 적용
|
//최종문자 적용
|
||||||
result.Content = contents;
|
result.Content = contents;
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
var resp = new HttpResponseMessage()
|
||||||
{
|
{
|
||||||
Content = new StringContent(
|
Content = new StringContent(
|
||||||
result.Content,
|
result.Content,
|
||||||
System.Text.Encoding.UTF8,
|
System.Text.Encoding.UTF8,
|
||||||
"text/html")
|
"text/html")
|
||||||
};
|
};
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,155 +1,156 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Web.Http;
|
using System.Web.Http;
|
||||||
namespace Project
|
|
||||||
{
|
namespace Project.Web.Controllers
|
||||||
public class ResourceController : BaseController
|
{
|
||||||
{
|
public class ResourceController : BaseController
|
||||||
//[HttpGet]
|
{
|
||||||
//public HttpResponseMessage Index()
|
//[HttpGet]
|
||||||
//{
|
//public HttpResponseMessage Index()
|
||||||
// //로그인이 되어있지않다면 로그인을 가져온다
|
//{
|
||||||
// MethodResult result;
|
// //로그인이 되어있지않다면 로그인을 가져온다
|
||||||
// result = View(true);
|
// MethodResult result;
|
||||||
|
// result = View(true);
|
||||||
// var model = GetGlobalModel();
|
|
||||||
// var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
// var model = GetGlobalModel();
|
||||||
|
// var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
// //기본값을 찾아서 없애줘야한다
|
|
||||||
// var contents = result.Content;
|
// //기본값을 찾아서 없애줘야한다
|
||||||
|
// var contents = result.Content;
|
||||||
// //공용값 적용
|
|
||||||
// ApplyCommonValue(ref contents);
|
// //공용값 적용
|
||||||
|
// ApplyCommonValue(ref contents);
|
||||||
// //최종문자 적용
|
|
||||||
// result.Content = contents;
|
// //최종문자 적용
|
||||||
|
// result.Content = contents;
|
||||||
// var resp = new HttpResponseMessage()
|
|
||||||
// {
|
// var resp = new HttpResponseMessage()
|
||||||
// Content = new StringContent(
|
// {
|
||||||
// result.Content,
|
// Content = new StringContent(
|
||||||
// System.Text.Encoding.UTF8,
|
// result.Content,
|
||||||
// "text/html")
|
// System.Text.Encoding.UTF8,
|
||||||
// };
|
// "text/html")
|
||||||
|
// };
|
||||||
// return resp;
|
|
||||||
//}
|
// return resp;
|
||||||
|
//}
|
||||||
[HttpGet]
|
|
||||||
public HttpResponseMessage file()
|
[HttpGet]
|
||||||
{
|
public HttpResponseMessage file()
|
||||||
var config = RequestContext.Configuration;
|
{
|
||||||
var routeData = config.Routes.GetRouteData(Request).Values.ToList();
|
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_resource = routeData.Where(t => t.Key == "resource").FirstOrDefault();
|
||||||
var p_ext = routeData.Where(t => t.Key == "ext").FirstOrDefault();
|
var p_path = routeData.Where(t => t.Key == "path").FirstOrDefault();
|
||||||
var p_subdir = routeData.Where(t => t.Key == "subdir").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_resource = string.Empty;
|
||||||
var v_ext = string.Empty;
|
var v_path = string.Empty;
|
||||||
var v_subdir = 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_resource.Key == "resource") v_resource = p_resource.Value.ToString();
|
||||||
if (p_ext.Key == "ext") v_ext = p_ext.Value.ToString();
|
if (p_path.Key == "path") v_path = p_path.Value.ToString();
|
||||||
if (p_subdir.Key == "subdir") v_subdir = p_subdir.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 file_ext = routeData[0].Value.ToString();
|
||||||
//var name_action = routeData[3].Value.ToString();
|
//var name_resource = routeData[1].Value.ToString() + "." + file_ext;
|
||||||
|
//var name_action = routeData[3].Value.ToString();
|
||||||
Boolean isBinary = true;
|
|
||||||
|
Boolean isBinary = true;
|
||||||
|
|
||||||
string content_type = "text/plain";
|
|
||||||
|
string content_type = "text/plain";
|
||||||
if (v_ext == "json")
|
|
||||||
{
|
if (v_ext == "json")
|
||||||
isBinary = false;
|
{
|
||||||
content_type = "application/json";
|
isBinary = false;
|
||||||
}
|
content_type = "application/json";
|
||||||
else if(v_ext == "vue")
|
}
|
||||||
{
|
else if(v_ext == "vue")
|
||||||
isBinary = false;
|
{
|
||||||
content_type = "application/js";
|
isBinary = false;
|
||||||
}
|
content_type = "application/js";
|
||||||
else if (v_ext == "js")
|
}
|
||||||
{
|
else if (v_ext == "js")
|
||||||
isBinary = false;
|
{
|
||||||
content_type = "application/js";
|
isBinary = false;
|
||||||
}
|
content_type = "application/js";
|
||||||
else if (v_ext == "css")
|
}
|
||||||
{
|
else if (v_ext == "css")
|
||||||
isBinary = false;
|
{
|
||||||
content_type = "text/css";
|
isBinary = false;
|
||||||
}
|
content_type = "text/css";
|
||||||
else if (v_ext == "csv")
|
}
|
||||||
{
|
else if (v_ext == "csv")
|
||||||
isBinary = false;
|
{
|
||||||
content_type = "text/csv";
|
isBinary = false;
|
||||||
}
|
content_type = "text/csv";
|
||||||
else if (v_ext == "ico")
|
}
|
||||||
{
|
else if (v_ext == "ico")
|
||||||
isBinary = true;
|
{
|
||||||
content_type = "image/x-icon";
|
isBinary = true;
|
||||||
}
|
content_type = "image/x-icon";
|
||||||
else if(v_ext == "ttf" || v_ext == "otf")
|
}
|
||||||
{
|
else if(v_ext == "ttf" || v_ext == "otf")
|
||||||
isBinary = true;
|
{
|
||||||
content_type = "application/octet-stream";
|
isBinary = true;
|
||||||
}
|
content_type = "application/octet-stream";
|
||||||
|
}
|
||||||
HttpContent resultContent = null;
|
|
||||||
|
HttpContent resultContent = null;
|
||||||
if (v_resource.isEmpty() && v_ext.isEmpty())
|
|
||||||
{
|
if (v_resource.isEmpty() && v_ext.isEmpty())
|
||||||
v_resource = "index";
|
{
|
||||||
v_ext = "html";
|
v_resource = "index";
|
||||||
isBinary = false;
|
v_ext = "html";
|
||||||
content_type = "text/html";
|
isBinary = false;
|
||||||
}
|
content_type = "text/html";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var file = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "View", v_path, v_subdir, v_resource + "." + v_ext);
|
|
||||||
|
var file = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "View", v_path, v_subdir, v_resource + "." + v_ext);
|
||||||
if (isBinary)
|
|
||||||
{
|
if (isBinary)
|
||||||
|
{
|
||||||
if (System.IO.File.Exists(file))
|
|
||||||
{
|
if (System.IO.File.Exists(file))
|
||||||
var buffer = System.IO.File.ReadAllBytes(file);
|
{
|
||||||
resultContent = new ByteArrayContent(buffer);
|
var buffer = System.IO.File.ReadAllBytes(file);
|
||||||
Console.WriteLine(">>File(B) : " + file);
|
resultContent = new ByteArrayContent(buffer);
|
||||||
}
|
Console.WriteLine(">>File(B) : " + file);
|
||||||
else Console.WriteLine("no resouoir file " + file);
|
}
|
||||||
|
else Console.WriteLine("no resouoir file " + file);
|
||||||
}
|
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
if (System.IO.File.Exists(file))
|
{
|
||||||
{
|
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);
|
var buffer = System.IO.File.ReadAllText(file, System.Text.Encoding.UTF8);
|
||||||
Console.WriteLine(">>File(S) : " + file);
|
resultContent = new StringContent(buffer, System.Text.Encoding.UTF8, content_type);
|
||||||
}
|
Console.WriteLine(">>File(S) : " + file);
|
||||||
else Console.WriteLine("no resouoir file " + file);
|
}
|
||||||
}
|
else Console.WriteLine("no resouoir file " + file);
|
||||||
|
}
|
||||||
|
|
||||||
return new HttpResponseMessage()
|
|
||||||
{
|
return new HttpResponseMessage()
|
||||||
Content = resultContent
|
{
|
||||||
};
|
Content = resultContent
|
||||||
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@@ -1,64 +1,64 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Web.Http;
|
using System.Web.Http;
|
||||||
|
|
||||||
namespace Project
|
namespace Project.Web.Controllers
|
||||||
{
|
{
|
||||||
public class ResultController : BaseController
|
public class ResultController : BaseController
|
||||||
{
|
{
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public void Index([FromBody]string value)
|
public void Index([FromBody]string value)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PUT api/values/5
|
// PUT api/values/5
|
||||||
public void Put(int id, [FromBody]string value)
|
public void Put(int id, [FromBody]string value)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// DELETE api/values/5
|
// DELETE api/values/5
|
||||||
public void Delete(int id)
|
public void Delete(int id)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public string Test()
|
public string Test()
|
||||||
{
|
{
|
||||||
return "test";
|
return "test";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage Index()
|
public HttpResponseMessage Index()
|
||||||
{
|
{
|
||||||
//로그인이 되어있지않다면 로그인을 가져온다
|
//로그인이 되어있지않다면 로그인을 가져온다
|
||||||
MethodResult result;
|
MethodResult result;
|
||||||
result = View();
|
result = View();
|
||||||
|
|
||||||
var model = GetGlobalModel();
|
var model = GetGlobalModel();
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
//기본값을 찾아서 없애줘야한다
|
//기본값을 찾아서 없애줘야한다
|
||||||
var contents = result.Content;
|
var contents = result.Content;
|
||||||
|
|
||||||
//공용값 적용
|
//공용값 적용
|
||||||
ApplyCommonValue(ref contents);
|
ApplyCommonValue(ref contents);
|
||||||
|
|
||||||
//최종문자 적용
|
//최종문자 적용
|
||||||
result.Content = contents;
|
result.Content = contents;
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
var resp = new HttpResponseMessage()
|
||||||
{
|
{
|
||||||
Content = new StringContent(
|
Content = new StringContent(
|
||||||
result.Content,
|
result.Content,
|
||||||
System.Text.Encoding.UTF8,
|
System.Text.Encoding.UTF8,
|
||||||
"text/html")
|
"text/html")
|
||||||
};
|
};
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,63 +1,63 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Web.Http;
|
using System.Web.Http;
|
||||||
|
|
||||||
namespace Project
|
namespace Project.Web.Controllers
|
||||||
{
|
{
|
||||||
public class SettingController : BaseController
|
public class SettingController : BaseController
|
||||||
{
|
{
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public void Index([FromBody]string value)
|
public void Index([FromBody]string value)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PUT api/values/5
|
// PUT api/values/5
|
||||||
public void Put(int id, [FromBody]string value)
|
public void Put(int id, [FromBody]string value)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// DELETE api/values/5
|
// DELETE api/values/5
|
||||||
public void Delete(int id)
|
public void Delete(int id)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public string Test()
|
public string Test()
|
||||||
{
|
{
|
||||||
return "test";
|
return "test";
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public HttpResponseMessage Index()
|
public HttpResponseMessage Index()
|
||||||
{
|
{
|
||||||
//로그인이 되어있지않다면 로그인을 가져온다
|
//로그인이 되어있지않다면 로그인을 가져온다
|
||||||
MethodResult result;
|
MethodResult result;
|
||||||
result = View();
|
result = View();
|
||||||
|
|
||||||
var model = GetGlobalModel();
|
var model = GetGlobalModel();
|
||||||
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
var getParams = Request.GetQueryNameValuePairs();// GetParameters(data);
|
||||||
|
|
||||||
//기본값을 찾아서 없애줘야한다
|
//기본값을 찾아서 없애줘야한다
|
||||||
var contents = result.Content;
|
var contents = result.Content;
|
||||||
|
|
||||||
//공용값 적용
|
//공용값 적용
|
||||||
ApplyCommonValue(ref contents);
|
ApplyCommonValue(ref contents);
|
||||||
|
|
||||||
//최종문자 적용
|
//최종문자 적용
|
||||||
result.Content = contents;
|
result.Content = contents;
|
||||||
|
|
||||||
var resp = new HttpResponseMessage()
|
var resp = new HttpResponseMessage()
|
||||||
{
|
{
|
||||||
Content = new StringContent(
|
Content = new StringContent(
|
||||||
result.Content,
|
result.Content,
|
||||||
System.Text.Encoding.UTF8,
|
System.Text.Encoding.UTF8,
|
||||||
"text/html")
|
"text/html")
|
||||||
};
|
};
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,18 +1,28 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Project
|
namespace Project.Web.Model
|
||||||
{
|
{
|
||||||
public class PageModel
|
public class GroupUserModel
|
||||||
{
|
{
|
||||||
public List<KeyValuePair<string, object>> RouteData { get; set; }
|
public string Gcode { get; set; }
|
||||||
|
public string uid { get; set; }
|
||||||
|
}
|
||||||
public string urlcontrol { get; set; }
|
public class UserModel
|
||||||
public string urlaction { get; set; }
|
{
|
||||||
|
public string uid { get; set; }
|
||||||
}
|
public string password { get; set; }
|
||||||
}
|
}
|
||||||
|
public class PageModel
|
||||||
|
{
|
||||||
|
public List<KeyValuePair<string, object>> RouteData { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public string urlcontrol { get; set; }
|
||||||
|
public string urlaction { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
88
Project/Web/Startup.cs
Normal file
88
Project/Web/Startup.cs
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
using Microsoft.Owin;
|
||||||
|
using Microsoft.Owin.StaticFiles;
|
||||||
|
using Owin;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Web.Http;
|
||||||
|
using System.Web.Http.Routing;
|
||||||
|
using Project.Web.Controllers;
|
||||||
|
|
||||||
|
namespace Project.OWIN
|
||||||
|
{
|
||||||
|
public class Startup
|
||||||
|
{
|
||||||
|
public void Configuration(IAppBuilder app)
|
||||||
|
{
|
||||||
|
// Configure Web API for Self-Host
|
||||||
|
HttpConfiguration config = new HttpConfiguration();
|
||||||
|
|
||||||
|
//라우팅 설정
|
||||||
|
config.MapHttpAttributeRoutes();
|
||||||
|
|
||||||
|
config.Routes.MapHttpRoute(
|
||||||
|
name: "DefaultApi",
|
||||||
|
routeTemplate: "api/{controller}/{action}/{id}",
|
||||||
|
defaults: new { id = RouteParameter.Optional }
|
||||||
|
);
|
||||||
|
|
||||||
|
// JSON 포맷터 설정
|
||||||
|
config.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
|
||||||
|
|
||||||
|
// 파일 업로드 설정
|
||||||
|
config.Formatters.Remove(config.Formatters.XmlFormatter);
|
||||||
|
|
||||||
|
app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);
|
||||||
|
app.UseWebApi(config);
|
||||||
|
|
||||||
|
// 정적 파일 서빙 설정
|
||||||
|
var options = new FileServerOptions
|
||||||
|
{
|
||||||
|
EnableDefaultFiles = true,
|
||||||
|
DefaultFilesOptions = { DefaultFileNames = { "index.html" } },
|
||||||
|
FileSystem = new Microsoft.Owin.FileSystems.PhysicalFileSystem("Web/wwwroot")
|
||||||
|
};
|
||||||
|
|
||||||
|
app.UseFileServer(options);
|
||||||
|
|
||||||
|
// 캐시 방지 미들웨어 추가
|
||||||
|
app.Use(async (context, next) =>
|
||||||
|
{
|
||||||
|
if (context.Request.Path.Value.EndsWith(".js") || context.Request.Path.Value.EndsWith(".css"))
|
||||||
|
{
|
||||||
|
context.Response.Headers["Cache-Control"] = "no-cache, no-store, must-revalidate";
|
||||||
|
context.Response.Headers["Pragma"] = "no-cache";
|
||||||
|
context.Response.Headers["Expires"] = "0";
|
||||||
|
}
|
||||||
|
await next();
|
||||||
|
});
|
||||||
|
|
||||||
|
//appBuilder.UseFileServer(new FileServerOptions
|
||||||
|
//{
|
||||||
|
// RequestPath = new PathString(string.Empty),
|
||||||
|
// FileSystem = new PhysicalFileSystem("./MySubFolder"),
|
||||||
|
// EnableDirectoryBrowsing = true,
|
||||||
|
//});
|
||||||
|
|
||||||
|
//appBuilder.UseStageMarker(PipelineStage.MapHandler);
|
||||||
|
|
||||||
|
|
||||||
|
//config.Routes.MapHttpRoute(
|
||||||
|
// name: "ignore",
|
||||||
|
// routeTemplate: @".*\.(css|js|gif|jpg)(/.*)?",
|
||||||
|
// defaults: new
|
||||||
|
// {
|
||||||
|
// controller = "file",
|
||||||
|
// action = "readtext",
|
||||||
|
// id = RouteParameter.Optional
|
||||||
|
// }
|
||||||
|
// );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,101 +1,101 @@
|
|||||||
using Microsoft.Owin;
|
using Microsoft.Owin;
|
||||||
using Owin;
|
using Owin;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Web.Http;
|
using System.Web.Http;
|
||||||
|
|
||||||
namespace Project.OWIN
|
namespace Project.OWIN
|
||||||
{
|
{
|
||||||
public class StartupSSE
|
public class StartupSSE
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
public void Configuration(IAppBuilder app)
|
public void Configuration(IAppBuilder app)
|
||||||
{
|
{
|
||||||
var api = new Api();
|
var api = new Api();
|
||||||
app.Run(context => api.Invoke(context));
|
app.Run(context => api.Invoke(context));
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Subscriber
|
public class Subscriber
|
||||||
{
|
{
|
||||||
private StreamWriter _writer;
|
private StreamWriter _writer;
|
||||||
private TaskCompletionSource<bool> _tcs;
|
private TaskCompletionSource<bool> _tcs;
|
||||||
public Subscriber(Stream body, TaskCompletionSource<bool> tcs)
|
public Subscriber(Stream body, TaskCompletionSource<bool> tcs)
|
||||||
{
|
{
|
||||||
this._writer = new StreamWriter(body);
|
this._writer = new StreamWriter(body);
|
||||||
this._tcs = tcs;
|
this._tcs = tcs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void WriteAsync(string message)
|
public async void WriteAsync(string message)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_writer.Write(message);
|
_writer.Write(message);
|
||||||
_writer.Flush();
|
_writer.Flush();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
if (e.HResult == -2146232800) // non-existent connection
|
if (e.HResult == -2146232800) // non-existent connection
|
||||||
_tcs.SetResult(true);
|
_tcs.SetResult(true);
|
||||||
else
|
else
|
||||||
_tcs.SetException(e);
|
_tcs.SetException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Api
|
public class Api
|
||||||
{
|
{
|
||||||
System.Timers.Timer _timer = new System.Timers.Timer(500);
|
System.Timers.Timer _timer = new System.Timers.Timer(500);
|
||||||
List<Subscriber> _subscribers = new List<Subscriber>();
|
List<Subscriber> _subscribers = new List<Subscriber>();
|
||||||
public Api()
|
public Api()
|
||||||
{
|
{
|
||||||
_timer.Elapsed += _timer_Elapsed;
|
_timer.Elapsed += _timer_Elapsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
void _timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
||||||
{
|
{
|
||||||
UpdateSubscribers();
|
UpdateSubscribers();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateSubscribers()
|
public void UpdateSubscribers()
|
||||||
{
|
{
|
||||||
Console.WriteLine("updating {0} subscribers", _subscribers.Count);
|
Console.WriteLine("updating {0} subscribers", _subscribers.Count);
|
||||||
var subscribersCopy = _subscribers.ToList<Subscriber>();
|
var subscribersCopy = _subscribers.ToList<Subscriber>();
|
||||||
var msg = String.Format("Hello async at {0}\n", DateTime.Now);
|
var msg = String.Format("Hello async at {0}\n", DateTime.Now);
|
||||||
subscribersCopy.ForEach(w => w.WriteAsync(msg));
|
subscribersCopy.ForEach(w => w.WriteAsync(msg));
|
||||||
_timer.Start();
|
_timer.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Task Invoke(IOwinContext context)
|
public Task Invoke(IOwinContext context)
|
||||||
{
|
{
|
||||||
SetEventHeaders(context);
|
SetEventHeaders(context);
|
||||||
System.IO.Stream responseStream = context.Environment["owin.ResponseBody"] as Stream;
|
System.IO.Stream responseStream = context.Environment["owin.ResponseBody"] as Stream;
|
||||||
var tcs = new TaskCompletionSource<bool>();
|
var tcs = new TaskCompletionSource<bool>();
|
||||||
var s = CreateSubscriber(responseStream, tcs);
|
var s = CreateSubscriber(responseStream, tcs);
|
||||||
tcs.Task.ContinueWith(_ => _subscribers.Remove(s));
|
tcs.Task.ContinueWith(_ => _subscribers.Remove(s));
|
||||||
Console.WriteLine("Add subscriber. Now have {0}", _subscribers.Count);
|
Console.WriteLine("Add subscriber. Now have {0}", _subscribers.Count);
|
||||||
s.WriteAsync("Registered\n");
|
s.WriteAsync("Registered\n");
|
||||||
_timer.Start();
|
_timer.Start();
|
||||||
return tcs.Task;
|
return tcs.Task;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Subscriber CreateSubscriber(System.IO.Stream responseStream, TaskCompletionSource<bool> tcs)
|
private Subscriber CreateSubscriber(System.IO.Stream responseStream, TaskCompletionSource<bool> tcs)
|
||||||
{
|
{
|
||||||
var s = new Subscriber(responseStream, tcs);
|
var s = new Subscriber(responseStream, tcs);
|
||||||
_subscribers.Add(s);
|
_subscribers.Add(s);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SetEventHeaders(IOwinContext context)
|
private static void SetEventHeaders(IOwinContext context)
|
||||||
{
|
{
|
||||||
context.Response.ContentType = "text/eventstream";
|
context.Response.ContentType = "text/eventstream";
|
||||||
context.Response.Headers["Transfer-Encoding"] = "chunked";
|
context.Response.Headers["Transfer-Encoding"] = "chunked";
|
||||||
context.Response.Headers["cache-control"] = "no-cache";
|
context.Response.Headers["cache-control"] = "no-cache";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
311
Project/Web/wwwroot/DashBoard/index.html
Normal file
311
Project/Web/wwwroot/DashBoard/index.html
Normal file
@@ -0,0 +1,311 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ko">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>근태현황 대시보드</title>
|
||||||
|
<script src="https://cdn.tailwindcss.com"></script>
|
||||||
|
<script>
|
||||||
|
tailwind.config = {
|
||||||
|
theme: {
|
||||||
|
extend: {
|
||||||
|
colors: {
|
||||||
|
primary: {
|
||||||
|
50: '#eff6ff',
|
||||||
|
100: '#dbeafe',
|
||||||
|
200: '#bfdbfe',
|
||||||
|
300: '#93c5fd',
|
||||||
|
400: '#60a5fa',
|
||||||
|
500: '#3b82f6',
|
||||||
|
600: '#2563eb',
|
||||||
|
700: '#1d4ed8',
|
||||||
|
800: '#1e40af',
|
||||||
|
900: '#1e3a8a',
|
||||||
|
},
|
||||||
|
success: {
|
||||||
|
50: '#f0fdf4',
|
||||||
|
100: '#dcfce7',
|
||||||
|
200: '#bbf7d0',
|
||||||
|
300: '#86efac',
|
||||||
|
400: '#4ade80',
|
||||||
|
500: '#22c55e',
|
||||||
|
600: '#16a34a',
|
||||||
|
700: '#15803d',
|
||||||
|
800: '#166534',
|
||||||
|
900: '#14532d',
|
||||||
|
},
|
||||||
|
warning: {
|
||||||
|
50: '#fffbeb',
|
||||||
|
100: '#fef3c7',
|
||||||
|
200: '#fde68a',
|
||||||
|
300: '#fcd34d',
|
||||||
|
400: '#fbbf24',
|
||||||
|
500: '#f59e0b',
|
||||||
|
600: '#d97706',
|
||||||
|
700: '#b45309',
|
||||||
|
800: '#92400e',
|
||||||
|
900: '#78350f',
|
||||||
|
},
|
||||||
|
danger: {
|
||||||
|
50: '#fef2f2',
|
||||||
|
100: '#fee2e2',
|
||||||
|
200: '#fecaca',
|
||||||
|
300: '#fca5a5',
|
||||||
|
400: '#f87171',
|
||||||
|
500: '#ef4444',
|
||||||
|
600: '#dc2626',
|
||||||
|
700: '#b91c1c',
|
||||||
|
800: '#991b1b',
|
||||||
|
900: '#7f1d1d',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
animation: {
|
||||||
|
'fade-in': 'fadeIn 0.5s ease-in-out',
|
||||||
|
'slide-up': 'slideUp 0.3s ease-out',
|
||||||
|
'pulse-slow': 'pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite',
|
||||||
|
},
|
||||||
|
keyframes: {
|
||||||
|
fadeIn: {
|
||||||
|
'0%': { opacity: '0' },
|
||||||
|
'100%': { opacity: '1' },
|
||||||
|
},
|
||||||
|
slideUp: {
|
||||||
|
'0%': { transform: 'translateY(10px)', opacity: '0' },
|
||||||
|
'100%': { transform: 'translateY(0)', opacity: '1' },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
.glass-effect {
|
||||||
|
background: rgba(255, 255, 255, 0.25);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.18);
|
||||||
|
}
|
||||||
|
.gradient-bg {
|
||||||
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||||
|
}
|
||||||
|
.card-hover {
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
.card-hover:hover {
|
||||||
|
transform: translateY(-5px);
|
||||||
|
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body class="gradient-bg min-h-screen">
|
||||||
|
<div class="container mx-auto px-4 py-8">
|
||||||
|
<!-- 헤더 -->
|
||||||
|
<div class="text-center mb-8 animate-fade-in">
|
||||||
|
<h1 class="text-4xl font-bold text-white mb-2">근태현황 대시보드</h1>
|
||||||
|
<p class="text-white/80 text-lg">실시간 근태 현황을 확인하세요</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 통계 카드 -->
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
|
||||||
|
<!-- 출근 카드 -->
|
||||||
|
<div class="glass-effect rounded-2xl p-6 card-hover animate-slide-up">
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<p class="text-white/70 text-sm font-medium">출근</p>
|
||||||
|
<p class="text-3xl font-bold text-white" id="presentCount">0</p>
|
||||||
|
</div>
|
||||||
|
<div class="w-12 h-12 bg-success-500/20 rounded-full flex items-center justify-center">
|
||||||
|
<svg class="w-6 h-6 text-success-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 휴가 카드 -->
|
||||||
|
<div class="glass-effect rounded-2xl p-6 card-hover animate-slide-up">
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<p class="text-white/70 text-sm font-medium">휴가</p>
|
||||||
|
<p class="text-3xl font-bold text-white" id="leaveCount">0</p>
|
||||||
|
</div>
|
||||||
|
<div class="w-12 h-12 bg-warning-500/20 rounded-full flex items-center justify-center">
|
||||||
|
<svg class="w-6 h-6 text-warning-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 휴가요청 카드 -->
|
||||||
|
<div class="glass-effect rounded-2xl p-6 card-hover animate-slide-up">
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<p class="text-white/70 text-sm font-medium">휴가요청</p>
|
||||||
|
<p class="text-3xl font-bold text-white" id="leaveRequestCount">0</p>
|
||||||
|
</div>
|
||||||
|
<div class="w-12 h-12 bg-primary-500/20 rounded-full flex items-center justify-center">
|
||||||
|
<svg class="w-6 h-6 text-primary-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 구매요청 카드 -->
|
||||||
|
<div class="glass-effect rounded-2xl p-6 card-hover animate-slide-up">
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<p class="text-white/70 text-sm font-medium">구매요청</p>
|
||||||
|
<p class="text-3xl font-bold text-white" id="purchaseCount">0</p>
|
||||||
|
</div>
|
||||||
|
<div class="w-12 h-12 bg-danger-500/20 rounded-full flex items-center justify-center">
|
||||||
|
<svg class="w-6 h-6 text-danger-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z"></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 휴가자 현황 테이블 -->
|
||||||
|
<div class="glass-effect rounded-2xl overflow-hidden animate-slide-up">
|
||||||
|
<div class="px-6 py-4 border-b border-white/10">
|
||||||
|
<h2 class="text-xl font-semibold text-white flex items-center">
|
||||||
|
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"></path>
|
||||||
|
</svg>
|
||||||
|
휴가자 현황
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
<div class="overflow-x-auto">
|
||||||
|
<table class="w-full">
|
||||||
|
<thead class="bg-white/10">
|
||||||
|
<tr>
|
||||||
|
<th class="px-6 py-4 text-left text-xs font-medium text-white/70 uppercase tracking-wider">이름</th>
|
||||||
|
<th class="px-6 py-4 text-left text-xs font-medium text-white/70 uppercase tracking-wider">휴가 종류</th>
|
||||||
|
<th class="px-6 py-4 text-left text-xs font-medium text-white/70 uppercase tracking-wider">시작일</th>
|
||||||
|
<th class="px-6 py-4 text-left text-xs font-medium text-white/70 uppercase tracking-wider">종료일</th>
|
||||||
|
<th class="px-6 py-4 text-left text-xs font-medium text-white/70 uppercase tracking-wider">사유</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="holidayTable" class="divide-y divide-white/10">
|
||||||
|
<!-- 데이터가 여기에 표시됩니다 -->
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 로딩 인디케이터 -->
|
||||||
|
<div id="loadingIndicator" class="fixed top-4 right-4 bg-white/20 backdrop-blur-sm rounded-full px-4 py-2 text-white text-sm hidden">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<div class="animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"></div>
|
||||||
|
데이터 업데이트 중...
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// 휴가 인원 Ajax 업데이트
|
||||||
|
function updateLeaveCount() {
|
||||||
|
showLoading();
|
||||||
|
fetch('http://127.0.0.1:9000/Dashboard/TodayCountH')
|
||||||
|
.then(response => response.text())
|
||||||
|
.then(data => {
|
||||||
|
const cleanData = data.replace(/"/g, '');
|
||||||
|
const count = parseInt(cleanData, 10);
|
||||||
|
animateNumberChange('leaveCount', count);
|
||||||
|
hideLoading();
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('휴가 인원 업데이트 중 오류 발생:', error);
|
||||||
|
hideLoading();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 휴가자 목록 Ajax 업데이트
|
||||||
|
function updateHolidayList() {
|
||||||
|
showLoading();
|
||||||
|
fetch('http://127.0.0.1:9000/Dashboard/GetholyUser')
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
let tableRows = '';
|
||||||
|
if (data && data.length > 0) {
|
||||||
|
data.forEach(item => {
|
||||||
|
tableRows += `
|
||||||
|
<tr class="hover:bg-white/5 transition-colors">
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap text-white">${item.uid || '-'}</td>
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap">
|
||||||
|
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-warning-500/20 text-warning-300">
|
||||||
|
${item.cate || '-'}
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap text-white/80">${item.sdate || '-'}</td>
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap text-white/80">${item.edate || '-'}</td>
|
||||||
|
<td class="px-6 py-4 text-white/80">${item.HolyReason || '-'}</td>
|
||||||
|
</tr>
|
||||||
|
`;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
tableRows = `
|
||||||
|
<tr>
|
||||||
|
<td colspan="5" class="px-6 py-8 text-center text-white/50">
|
||||||
|
현재 휴가자가 없습니다
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
document.getElementById('holidayTable').innerHTML = tableRows;
|
||||||
|
hideLoading();
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('휴가자 목록 업데이트 중 오류 발생:', error);
|
||||||
|
document.getElementById('holidayTable').innerHTML = `
|
||||||
|
<tr>
|
||||||
|
<td colspan="5" class="px-6 py-8 text-center text-danger-400">
|
||||||
|
데이터를 불러오는 중 오류가 발생했습니다
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
`;
|
||||||
|
hideLoading();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 숫자 애니메이션
|
||||||
|
function animateNumberChange(elementId, newValue) {
|
||||||
|
const element = document.getElementById(elementId);
|
||||||
|
const currentValue = parseInt(element.textContent) || 0;
|
||||||
|
const increment = (newValue - currentValue) / 20;
|
||||||
|
let current = currentValue;
|
||||||
|
|
||||||
|
const timer = setInterval(() => {
|
||||||
|
current += increment;
|
||||||
|
if ((increment > 0 && current >= newValue) || (increment < 0 && current <= newValue)) {
|
||||||
|
element.textContent = newValue;
|
||||||
|
clearInterval(timer);
|
||||||
|
} else {
|
||||||
|
element.textContent = Math.floor(current);
|
||||||
|
}
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 로딩 표시
|
||||||
|
function showLoading() {
|
||||||
|
document.getElementById('loadingIndicator').classList.remove('hidden');
|
||||||
|
}
|
||||||
|
|
||||||
|
function hideLoading() {
|
||||||
|
document.getElementById('loadingIndicator').classList.add('hidden');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 페이지 로드 시 데이터 업데이트
|
||||||
|
updateLeaveCount();
|
||||||
|
updateHolidayList();
|
||||||
|
|
||||||
|
// 30초마다 데이터 새로고침
|
||||||
|
setInterval(() => {
|
||||||
|
updateLeaveCount();
|
||||||
|
updateHolidayList();
|
||||||
|
}, 30000);
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -1,114 +1,114 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="ko">
|
<html lang="ko">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>근태현황 대시보드</title>
|
<title>근태현황 대시보드</title>
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container py-5">
|
<div class="container py-5">
|
||||||
<div class="row mb-4">
|
<div class="row mb-4">
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="card text-center">
|
<div class="card text-center">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title">출근</h5>
|
<h5 class="card-title">출근</h5>
|
||||||
<p class="card-text fs-2" id="presentCount">0</p>
|
<p class="card-text fs-2" id="presentCount">0</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="card text-center">
|
<div class="card text-center">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title">휴가</h5>
|
<h5 class="card-title">휴가</h5>
|
||||||
<p class="card-text fs-2" id="leaveCount">0</p>
|
<p class="card-text fs-2" id="leaveCount">0</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="card text-center">
|
<div class="card text-center">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title">휴가요청</h5>
|
<h5 class="card-title">휴가요청</h5>
|
||||||
<p class="card-text fs-2" id="leaveCount">0</p>
|
<p class="card-text fs-2" id="leaveCount">0</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="card text-center">
|
<div class="card text-center">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title">구매요청</h5>
|
<h5 class="card-title">구매요청</h5>
|
||||||
<p class="card-text fs-2" id="leaveCount">0</p>
|
<p class="card-text fs-2" id="leaveCount">0</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
휴가자 현황
|
휴가자 현황
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body p-0">
|
<div class="card-body p-0">
|
||||||
<table class="table mb-0">
|
<table class="table mb-0">
|
||||||
<thead class="table-light">
|
<thead class="table-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th>이름</th>
|
<th>이름</th>
|
||||||
<th>출근 시간</th>
|
<th>출근 시간</th>
|
||||||
<th>퇴근 시간</th>
|
<th>퇴근 시간</th>
|
||||||
<th>상태</th>
|
<th>상태</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="attendanceTable">
|
<tbody id="attendanceTable">
|
||||||
<!-- 데이터가 여기에 표시됩니다 -->
|
<!-- 데이터가 여기에 표시됩니다 -->
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
// 샘플 데이터
|
// 샘플 데이터
|
||||||
const attendanceData = [
|
const attendanceData = [
|
||||||
{ name: '홍길동', checkIn: '09:01', checkOut: '18:00', status: '지각' },
|
{ name: '홍길동', checkIn: '09:01', checkOut: '18:00', status: '지각' },
|
||||||
{ name: '김철수', checkIn: '08:55', checkOut: '18:05', status: '정상' },
|
{ name: '김철수', checkIn: '08:55', checkOut: '18:05', status: '정상' },
|
||||||
{ name: '이영희', checkIn: '-', checkOut: '-', status: '결근' },
|
{ name: '이영희', checkIn: '-', checkOut: '-', status: '결근' },
|
||||||
{ name: '박민수', checkIn: '09:00', checkOut: '18:10', status: '정상' },
|
{ name: '박민수', checkIn: '09:00', checkOut: '18:10', status: '정상' },
|
||||||
{ name: '최지우', checkIn: '09:20', checkOut: '18:00', status: '지각' }
|
{ name: '최지우', checkIn: '09:20', checkOut: '18:00', status: '지각' }
|
||||||
];
|
];
|
||||||
|
|
||||||
function updateDashboard(data) {
|
function updateDashboard(data) {
|
||||||
let present = 0, leave = 0, late = 0, absent = 0;
|
let present = 0, leave = 0, late = 0, absent = 0;
|
||||||
let tableRows = '';
|
let tableRows = '';
|
||||||
data.forEach(item => {
|
data.forEach(item => {
|
||||||
if (item.status === '정상' || item.status === '지각') present++;
|
if (item.status === '정상' || item.status === '지각') present++;
|
||||||
if (item.checkOut !== '-') leave++;
|
if (item.checkOut !== '-') leave++;
|
||||||
if (item.status === '지각') late++;
|
if (item.status === '지각') late++;
|
||||||
if (item.status === '결근') absent++;
|
if (item.status === '결근') absent++;
|
||||||
tableRows += `<tr>
|
tableRows += `<tr>
|
||||||
<td>${item.name}</td>
|
<td>${item.name}</td>
|
||||||
<td>${item.checkIn}</td>
|
<td>${item.checkIn}</td>
|
||||||
<td>${item.checkOut}</td>
|
<td>${item.checkOut}</td>
|
||||||
<td>${item.status}</td>
|
<td>${item.status}</td>
|
||||||
</tr>`;
|
</tr>`;
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 페이지 로드 시 대시보드 업데이트
|
// 페이지 로드 시 대시보드 업데이트
|
||||||
updateDashboard(attendanceData);
|
updateDashboard(attendanceData);
|
||||||
|
|
||||||
// 휴가 인원 Ajax 업데이트
|
// 휴가 인원 Ajax 업데이트
|
||||||
function updateLeaveCount() {
|
function updateLeaveCount() {
|
||||||
fetch('http://127.0.0.1:9000/Dashboard/TodayCountH')
|
fetch('http://127.0.0.1:9000/Dashboard/TodayCountH')
|
||||||
.then(response => response.text())
|
.then(response => response.text())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
// 수신된 데이터가 "1" 형태로 반환되므로, 쌍따옴표를 제거하고 숫자로 변환
|
// 수신된 데이터가 "1" 형태로 반환되므로, 쌍따옴표를 제거하고 숫자로 변환
|
||||||
const cleanData = data.replace(/"/g, '');
|
const cleanData = data.replace(/"/g, '');
|
||||||
document.getElementById('leaveCount').textContent = parseInt(cleanData, 10);
|
document.getElementById('leaveCount').textContent = parseInt(cleanData, 10);
|
||||||
})
|
})
|
||||||
.catch(error => console.error('휴가 인원 업데이트 중 오류 발생:', error));
|
.catch(error => console.error('휴가 인원 업데이트 중 오류 발생:', error));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 페이지 로드 시 휴가 인원 업데이트
|
// 페이지 로드 시 휴가 인원 업데이트
|
||||||
updateLeaveCount();
|
updateLeaveCount();
|
||||||
</script>
|
</script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
30
Project/Web/wwwroot/index.html
Normal file
30
Project/Web/wwwroot/index.html
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ko">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
|
||||||
|
<meta http-equiv="Pragma" content="no-cache">
|
||||||
|
<meta http-equiv="Expires" content="0">
|
||||||
|
<title>VNC 서버 목록 관리</title>
|
||||||
|
<script src="https://cdn.tailwindcss.com"></script>
|
||||||
|
<script>
|
||||||
|
tailwind.config = {
|
||||||
|
theme: {
|
||||||
|
extend: {
|
||||||
|
colors: {
|
||||||
|
primary: '#3B82F6',
|
||||||
|
secondary: '#6B7280',
|
||||||
|
success: '#10B981',
|
||||||
|
danger: '#EF4444',
|
||||||
|
warning: '#F59E0B'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body class="bg-gray-50 min-h-screen">
|
||||||
|
intro file
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
354
Project/Web/wwwroot/login.html
Normal file
354
Project/Web/wwwroot/login.html
Normal file
@@ -0,0 +1,354 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ko">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>로그인 - GroupWare</title>
|
||||||
|
<script src="https://cdn.tailwindcss.com"></script>
|
||||||
|
<script>
|
||||||
|
tailwind.config = {
|
||||||
|
theme: {
|
||||||
|
extend: {
|
||||||
|
colors: {
|
||||||
|
primary: {
|
||||||
|
50: '#eff6ff',
|
||||||
|
100: '#dbeafe',
|
||||||
|
200: '#bfdbfe',
|
||||||
|
300: '#93c5fd',
|
||||||
|
400: '#60a5fa',
|
||||||
|
500: '#3b82f6',
|
||||||
|
600: '#2563eb',
|
||||||
|
700: '#1d4ed8',
|
||||||
|
800: '#1e40af',
|
||||||
|
900: '#1e3a8a',
|
||||||
|
},
|
||||||
|
success: {
|
||||||
|
50: '#f0fdf4',
|
||||||
|
100: '#dcfce7',
|
||||||
|
200: '#bbf7d0',
|
||||||
|
300: '#86efac',
|
||||||
|
400: '#4ade80',
|
||||||
|
500: '#22c55e',
|
||||||
|
600: '#16a34a',
|
||||||
|
700: '#15803d',
|
||||||
|
800: '#166534',
|
||||||
|
900: '#14532d',
|
||||||
|
},
|
||||||
|
warning: {
|
||||||
|
50: '#fffbeb',
|
||||||
|
100: '#fef3c7',
|
||||||
|
200: '#fde68a',
|
||||||
|
300: '#fcd34d',
|
||||||
|
400: '#fbbf24',
|
||||||
|
500: '#f59e0b',
|
||||||
|
600: '#d97706',
|
||||||
|
700: '#b45309',
|
||||||
|
800: '#92400e',
|
||||||
|
900: '#78350f',
|
||||||
|
},
|
||||||
|
danger: {
|
||||||
|
50: '#fef2f2',
|
||||||
|
100: '#fee2e2',
|
||||||
|
200: '#fecaca',
|
||||||
|
300: '#fca5a5',
|
||||||
|
400: '#f87171',
|
||||||
|
500: '#ef4444',
|
||||||
|
600: '#dc2626',
|
||||||
|
700: '#b91c1c',
|
||||||
|
800: '#991b1b',
|
||||||
|
900: '#7f1d1d',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
animation: {
|
||||||
|
'fade-in': 'fadeIn 0.6s ease-in-out',
|
||||||
|
'slide-up': 'slideUp 0.4s ease-out',
|
||||||
|
'bounce-in': 'bounceIn 0.6s ease-out',
|
||||||
|
'pulse-slow': 'pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite',
|
||||||
|
},
|
||||||
|
keyframes: {
|
||||||
|
fadeIn: {
|
||||||
|
'0%': { opacity: '0' },
|
||||||
|
'100%': { opacity: '1' },
|
||||||
|
},
|
||||||
|
slideUp: {
|
||||||
|
'0%': { transform: 'translateY(20px)', opacity: '0' },
|
||||||
|
'100%': { transform: 'translateY(0)', opacity: '1' },
|
||||||
|
},
|
||||||
|
bounceIn: {
|
||||||
|
'0%': { transform: 'scale(0.3)', opacity: '0' },
|
||||||
|
'50%': { transform: 'scale(1.05)' },
|
||||||
|
'70%': { transform: 'scale(0.9)' },
|
||||||
|
'100%': { transform: 'scale(1)', opacity: '1' },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
.glass-effect {
|
||||||
|
background: rgba(255, 255, 255, 0.25);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.18);
|
||||||
|
}
|
||||||
|
.gradient-bg {
|
||||||
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||||
|
}
|
||||||
|
.card-hover {
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
.card-hover:hover {
|
||||||
|
transform: translateY(-2px);
|
||||||
|
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
||||||
|
}
|
||||||
|
.input-focus {
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
.input-focus:focus {
|
||||||
|
transform: scale(1.02);
|
||||||
|
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
|
||||||
|
}
|
||||||
|
.floating-label {
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
.input-field:focus + .floating-label,
|
||||||
|
.input-field:not(:placeholder-shown) + .floating-label {
|
||||||
|
transform: translateY(-1.5rem) scale(0.85);
|
||||||
|
color: #3b82f6;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body class="gradient-bg min-h-screen flex items-center justify-center p-4">
|
||||||
|
<div class="w-full max-w-md">
|
||||||
|
<!-- 로그인 카드 -->
|
||||||
|
<div class="glass-effect rounded-3xl p-8 card-hover animate-bounce-in">
|
||||||
|
<!-- 로고 및 제목 -->
|
||||||
|
<div class="text-center mb-8 animate-fade-in">
|
||||||
|
<div class="w-16 h-16 bg-white/20 rounded-full flex items-center justify-center mx-auto mb-4">
|
||||||
|
<svg class="w-8 h-8 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
<h1 class="text-2xl font-bold text-white mb-2">GroupWare</h1>
|
||||||
|
<p class="text-white/70 text-sm">로그인하여 시스템에 접속하세요</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 로그인 폼 -->
|
||||||
|
<form id="loginForm" class="space-y-6 animate-slide-up">
|
||||||
|
<!-- 사용자 ID 입력 -->
|
||||||
|
<div class="relative">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
id="userId"
|
||||||
|
name="userId"
|
||||||
|
class="input-field w-full px-4 py-3 bg-white/10 border border-white/20 rounded-xl text-white placeholder-transparent focus:outline-none focus:border-primary-400 input-focus"
|
||||||
|
placeholder="사용자 ID"
|
||||||
|
required
|
||||||
|
>
|
||||||
|
<label for="userId" class="floating-label absolute left-4 top-3 text-white/60 text-sm pointer-events-none">
|
||||||
|
사용자 ID
|
||||||
|
</label>
|
||||||
|
<div class="absolute right-3 top-3">
|
||||||
|
<svg class="w-5 h-5 text-white/40" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 비밀번호 입력 -->
|
||||||
|
<div class="relative">
|
||||||
|
<input
|
||||||
|
type="password"
|
||||||
|
id="password"
|
||||||
|
name="password"
|
||||||
|
class="input-field w-full px-4 py-3 bg-white/10 border border-white/20 rounded-xl text-white placeholder-transparent focus:outline-none focus:border-primary-400 input-focus"
|
||||||
|
placeholder="비밀번호"
|
||||||
|
required
|
||||||
|
>
|
||||||
|
<label for="password" class="floating-label absolute left-4 top-3 text-white/60 text-sm pointer-events-none">
|
||||||
|
비밀번호
|
||||||
|
</label>
|
||||||
|
<div class="absolute right-3 top-3">
|
||||||
|
<svg class="w-5 h-5 text-white/40" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 로그인 버튼 -->
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
class="w-full bg-primary-500 hover:bg-primary-600 text-white font-semibold py-3 px-4 rounded-xl transition-all duration-300 transform hover:scale-105 focus:outline-none focus:ring-2 focus:ring-primary-400 focus:ring-offset-2 focus:ring-offset-transparent"
|
||||||
|
>
|
||||||
|
<span class="flex items-center justify-center">
|
||||||
|
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1"></path>
|
||||||
|
</svg>
|
||||||
|
로그인
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<!-- 추가 옵션 -->
|
||||||
|
<div class="mt-6 text-center">
|
||||||
|
<div class="flex items-center justify-center space-x-4 text-sm">
|
||||||
|
<label class="flex items-center text-white/70 hover:text-white cursor-pointer transition-colors">
|
||||||
|
<input type="checkbox" class="mr-2 w-4 h-4 text-primary-500 bg-white/10 border-white/20 rounded focus:ring-primary-400 focus:ring-2">
|
||||||
|
로그인 정보 저장
|
||||||
|
</label>
|
||||||
|
<a href="#" class="text-primary-300 hover:text-primary-200 transition-colors">비밀번호 찾기</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 푸터 -->
|
||||||
|
<div class="text-center mt-6 animate-fade-in">
|
||||||
|
<p class="text-white/50 text-sm">
|
||||||
|
© 2024 GroupWare System. All rights reserved.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 로딩 인디케이터 -->
|
||||||
|
<div id="loadingIndicator" class="fixed top-4 right-4 bg-white/20 backdrop-blur-sm rounded-full px-4 py-2 text-white text-sm hidden">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<div class="animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"></div>
|
||||||
|
로그인 중...
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 에러 메시지 -->
|
||||||
|
<div id="errorMessage" class="fixed top-4 left-1/2 transform -translate-x-1/2 bg-danger-500 text-white px-6 py-3 rounded-lg shadow-lg hidden">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
||||||
|
</svg>
|
||||||
|
<span id="errorText">로그인에 실패했습니다.</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 성공 메시지 -->
|
||||||
|
<div id="successMessage" class="fixed top-4 left-1/2 transform -translate-x-1/2 bg-success-500 text-white px-6 py-3 rounded-lg shadow-lg hidden">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path>
|
||||||
|
</svg>
|
||||||
|
<span id="successText">로그인에 성공했습니다.</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// 폼 제출 처리
|
||||||
|
document.getElementById('loginForm').addEventListener('submit', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
const userId = document.getElementById('userId').value;
|
||||||
|
const password = document.getElementById('password').value;
|
||||||
|
const rememberMe = document.querySelector('input[type="checkbox"]').checked;
|
||||||
|
|
||||||
|
if (!userId || !password) {
|
||||||
|
showError('사용자 ID와 비밀번호를 입력해주세요.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 로딩 표시
|
||||||
|
showLoading();
|
||||||
|
|
||||||
|
// HomeController의 로그인 API 호출
|
||||||
|
fetch('http://127.0.0.1:9000/Home/Login', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
UserId: userId,
|
||||||
|
Password: password,
|
||||||
|
RememberMe: rememberMe
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
hideLoading();
|
||||||
|
|
||||||
|
if (data.Success) {
|
||||||
|
// 로그인 성공
|
||||||
|
showSuccess(data.Message);
|
||||||
|
|
||||||
|
// 리다이렉트 URL이 있으면 이동
|
||||||
|
if (data.RedirectUrl) {
|
||||||
|
setTimeout(() => {
|
||||||
|
window.location.href = data.RedirectUrl;
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 로그인 실패
|
||||||
|
showError(data.Message || '로그인에 실패했습니다.');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
hideLoading();
|
||||||
|
console.error('로그인 요청 중 오류 발생:', error);
|
||||||
|
showError('서버 연결에 실패했습니다. 다시 시도해주세요.');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 입력 필드 포커스 효과
|
||||||
|
document.querySelectorAll('.input-field').forEach(input => {
|
||||||
|
input.addEventListener('focus', function() {
|
||||||
|
this.parentElement.classList.add('ring-2', 'ring-primary-400');
|
||||||
|
});
|
||||||
|
|
||||||
|
input.addEventListener('blur', function() {
|
||||||
|
this.parentElement.classList.remove('ring-2', 'ring-primary-400');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 로딩 표시 함수
|
||||||
|
function showLoading() {
|
||||||
|
document.getElementById('loadingIndicator').classList.remove('hidden');
|
||||||
|
}
|
||||||
|
|
||||||
|
function hideLoading() {
|
||||||
|
document.getElementById('loadingIndicator').classList.add('hidden');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 에러 메시지 표시 함수
|
||||||
|
function showError(message) {
|
||||||
|
const errorDiv = document.getElementById('errorMessage');
|
||||||
|
const errorText = document.getElementById('errorText');
|
||||||
|
|
||||||
|
errorText.textContent = message;
|
||||||
|
errorDiv.classList.remove('hidden');
|
||||||
|
|
||||||
|
// 3초 후 자동 숨김
|
||||||
|
setTimeout(() => {
|
||||||
|
errorDiv.classList.add('hidden');
|
||||||
|
}, 3000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 성공 메시지 표시 함수
|
||||||
|
function showSuccess(message) {
|
||||||
|
const successDiv = document.getElementById('successMessage');
|
||||||
|
const successText = document.getElementById('successText');
|
||||||
|
|
||||||
|
successText.textContent = message;
|
||||||
|
successDiv.classList.remove('hidden');
|
||||||
|
|
||||||
|
// 3초 후 자동 숨김
|
||||||
|
setTimeout(() => {
|
||||||
|
successDiv.classList.add('hidden');
|
||||||
|
}, 3000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 페이지 로드 시 애니메이션
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
// 입력 필드에 자동 포커스
|
||||||
|
setTimeout(() => {
|
||||||
|
document.getElementById('userId').focus();
|
||||||
|
}, 500);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -18,7 +18,8 @@ namespace Project
|
|||||||
{
|
{
|
||||||
string SearchKey = string.Empty;
|
string SearchKey = string.Empty;
|
||||||
ServiceHost host;
|
ServiceHost host;
|
||||||
|
private IDisposable webApp;
|
||||||
|
bool webok = false;
|
||||||
|
|
||||||
|
|
||||||
public fMain()
|
public fMain()
|
||||||
@@ -79,6 +80,7 @@ namespace Project
|
|||||||
|
|
||||||
private void __Closing(object sender, FormClosingEventArgs e)
|
private void __Closing(object sender, FormClosingEventArgs e)
|
||||||
{
|
{
|
||||||
|
webApp?.Dispose();
|
||||||
MessageWindow.CloseAll();
|
MessageWindow.CloseAll();
|
||||||
if (closeforce == false)
|
if (closeforce == false)
|
||||||
{
|
{
|
||||||
@@ -148,47 +150,37 @@ namespace Project
|
|||||||
|
|
||||||
tmDisplay.Start(); //display timer
|
tmDisplay.Start(); //display timer
|
||||||
|
|
||||||
Func_Login();
|
|
||||||
|
|
||||||
Update_Site();
|
|
||||||
UpdateControls();
|
|
||||||
|
|
||||||
//사용기록추적
|
|
||||||
Pub.CheckNRegister3(Application.ProductName, "chi", Application.ProductVersion);
|
|
||||||
|
|
||||||
// Start OWIN host
|
// Start OWIN host
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
var options = new StartOptions("http://127.0.0.1:9000");
|
||||||
WebApp.Start<OWIN.Startup>(url: "http://127.0.0.1:9000");
|
webApp = WebApp.Start<OWIN.Startup>(options);
|
||||||
Console.WriteLine("start webapp");
|
Console.WriteLine("start webapp");
|
||||||
Pub.log.AddI("웹지원 서버 준비 완료");
|
Pub.log.AddI("웹지원 서버 준비 완료");
|
||||||
|
webok = true;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
//Util.MsgE("Web Interface Error\r\n" + ex.Message)/;
|
//Util.MsgE("Web Interface Error\r\n" + ex.Message)/;
|
||||||
Console.WriteLine(ex.Message);
|
Console.WriteLine(ex.Message);
|
||||||
Pub.log.AddE("웹지원오류" + ex.Message);
|
Pub.log.AddE("웹지원오류" + ex.Message);
|
||||||
|
webok = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Func_Login();
|
||||||
|
|
||||||
//// Address
|
///즐겨찾기 목록 갱신
|
||||||
//string address = "net.tcp://localhost:57900/eetgw";
|
Update_FavoriteSite();
|
||||||
|
|
||||||
//// Binding : TCP 사용
|
UpdateControls();
|
||||||
//NetTcpBinding binding = new NetTcpBinding();
|
|
||||||
|
|
||||||
//// Service Host 만들기
|
//사용기록추적
|
||||||
//host = new ServiceHost(typeof(MyService));
|
Pub.CheckNRegister3(Application.ProductName, "chi", Application.ProductVersion);
|
||||||
|
|
||||||
//// End Point 추가
|
|
||||||
//host.AddServiceEndpoint(typeof(IMyContract), binding, address);
|
|
||||||
|
|
||||||
//// Service Host 시작
|
|
||||||
//host.Open();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
void Update_Site()
|
|
||||||
|
void Update_FavoriteSite()
|
||||||
{
|
{
|
||||||
//즐겨찾기 없데이트 g=17
|
//즐겨찾기 없데이트 g=17
|
||||||
//타입
|
//타입
|
||||||
@@ -212,9 +204,19 @@ namespace Project
|
|||||||
|
|
||||||
void Func_Login()
|
void Func_Login()
|
||||||
{
|
{
|
||||||
using (Dialog.fLogin flogIn = new Dialog.fLogin())
|
if (this.webok)
|
||||||
if (flogIn.ShowDialog() != System.Windows.Forms.DialogResult.OK)
|
{
|
||||||
Application.ExitThread();
|
using (var flogIn = new Dialog.fLogin_WB())
|
||||||
|
if (flogIn.ShowDialog() != System.Windows.Forms.DialogResult.OK)
|
||||||
|
Application.ExitThread();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
using (var flogIn = new Dialog.fLogin())
|
||||||
|
if (flogIn.ShowDialog() != System.Windows.Forms.DialogResult.OK)
|
||||||
|
Application.ExitThread();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
this.mn_purchase.Visible = FCOMMON.Util.getBit(FCOMMON.info.Login.gpermission, (int)FCOMMON.eGroupPermission.menu_purchase);
|
this.mn_purchase.Visible = FCOMMON.Util.getBit(FCOMMON.info.Login.gpermission, (int)FCOMMON.eGroupPermission.menu_purchase);
|
||||||
this.mn_project.Visible = FCOMMON.Util.getBit(FCOMMON.info.Login.gpermission, (int)FCOMMON.eGroupPermission.menu_project);
|
this.mn_project.Visible = FCOMMON.Util.getBit(FCOMMON.info.Login.gpermission, (int)FCOMMON.eGroupPermission.menu_project);
|
||||||
|
|||||||
Reference in New Issue
Block a user