기타근무자 관련 코드 수정
This commit is contained in:
46
Project/Dialog/fCommon.Designer.cs
generated
Normal file
46
Project/Dialog/fCommon.Designer.cs
generated
Normal file
@@ -0,0 +1,46 @@
|
||||
namespace Project.Dialog
|
||||
{
|
||||
partial class fCommon
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// fHolyday
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1063, 567);
|
||||
this.Name = "fHolyday";
|
||||
this.Text = "근태입력";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
86
Project/Dialog/fCommon.cs
Normal file
86
Project/Dialog/fCommon.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
using FCM0000.Mail;
|
||||
using FCOMMON;
|
||||
using Microsoft.Web.WebView2.Core;
|
||||
using Microsoft.Web.WebView2.WinForms;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Project.Dialog
|
||||
{
|
||||
public partial class fCommon : fBase
|
||||
{
|
||||
private WebView2 webView21;
|
||||
public fCommon()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
||||
InitializeWebView2();
|
||||
|
||||
|
||||
}
|
||||
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.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($"{Pub.setting.WebServiceURL}/Common");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"WebView2 초기화 실패: {ex.Message}");
|
||||
}
|
||||
}
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
EnsureVisibleAndUsableSize();
|
||||
}
|
||||
private void label1_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
120
Project/Dialog/fCommon.resx
Normal file
120
Project/Dialog/fCommon.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
</root>
|
||||
@@ -254,10 +254,10 @@ namespace Project.Dialog
|
||||
AddLoginInfo();
|
||||
|
||||
//210221
|
||||
MakeAutoJobReportbyLogin();
|
||||
Pub.MakeAutoJobReportbyLogin();
|
||||
|
||||
//210613
|
||||
MakeAutoJobReportByAuto();
|
||||
Pub.MakeAutoJobReportByAuto();
|
||||
|
||||
DialogResult = DialogResult.OK;
|
||||
FCOMMON.info.Login.loginusetime = (DateTime.Now - dt).TotalMilliseconds;
|
||||
@@ -269,137 +269,6 @@ namespace Project.Dialog
|
||||
}
|
||||
}
|
||||
|
||||
/// <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;
|
||||
|
||||
@@ -129,10 +129,10 @@ namespace Project.Dialog
|
||||
AddLoginInfo();
|
||||
|
||||
//210221
|
||||
MakeAutoJobReportbyLogin();
|
||||
Pub.MakeAutoJobReportbyLogin();
|
||||
|
||||
//210613
|
||||
MakeAutoJobReportByAuto();
|
||||
Pub.MakeAutoJobReportByAuto();
|
||||
|
||||
DialogResult = DialogResult.OK;
|
||||
FCOMMON.info.Login.loginusetime = (DateTime.Now - dt).TotalMilliseconds;
|
||||
@@ -373,10 +373,10 @@ namespace Project.Dialog
|
||||
AddLoginInfo();
|
||||
|
||||
//210221
|
||||
MakeAutoJobReportbyLogin();
|
||||
Pub.MakeAutoJobReportbyLogin();
|
||||
|
||||
//210613
|
||||
MakeAutoJobReportByAuto();
|
||||
Pub.MakeAutoJobReportByAuto();
|
||||
|
||||
DialogResult = DialogResult.OK;
|
||||
FCOMMON.info.Login.loginusetime = (DateTime.Now - dt).TotalMilliseconds;
|
||||
@@ -388,136 +388,7 @@ namespace Project.Dialog
|
||||
}
|
||||
}
|
||||
|
||||
/// <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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user