..
This commit is contained in:
@@ -151,6 +151,8 @@ namespace Project.Dialog
|
||||
//로그인정보 기록
|
||||
AddLoginInfo();
|
||||
|
||||
//210221
|
||||
MakeAutoJobReport();
|
||||
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
@@ -160,6 +162,55 @@ namespace Project.Dialog
|
||||
DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void MakeAutoJobReport()
|
||||
{
|
||||
//자동로그인 업무일지 기록 기능 추가 = 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 db = new EEEntitiesMain();
|
||||
var nd = DateTime.Now.ToShortDateString();
|
||||
if (db.JobReport.Where(t => t.gcode == FCOMMON.info.Login.gcode &&
|
||||
t.autoinput == true &&
|
||||
t.uid == FCOMMON.info.Login.no &&
|
||||
t.pdate == nd).Any() == false)
|
||||
{
|
||||
var rows = db.EETGW_JobReport_AutoInput.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.autoinput == "L" && t.uid == FCOMMON.info.Login.no && t.pdate.CompareTo(nd) <= 0 && (string.IsNullOrEmpty(t.edate) == true || t.edate.CompareTo(nd) > 0));
|
||||
foreach (var dr in rows)
|
||||
{
|
||||
//이데이터를 그대로 생성해준다.
|
||||
var newdr = new JobReport();
|
||||
newdr.gcode = FCOMMON.info.Login.gcode;
|
||||
newdr.wuid = FCOMMON.info.Login.no;
|
||||
newdr.wdate = DateTime.Now;
|
||||
newdr.pdate = nd;
|
||||
newdr.import = false;
|
||||
newdr.hrs = dr.hrs;
|
||||
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;
|
||||
db.JobReport.Add(newdr);
|
||||
}
|
||||
if (rows.Count() > 0)
|
||||
{
|
||||
db.SaveChanges();
|
||||
Util.MsgI($"{rows.Count()} 건의 업무일지가 자동 생성 되었습니다\n업무일지는 로그인시 최초 1회 자동 등록됩니다\n" +
|
||||
"자동입력을 해제하려면 '업무일지-자동입력' 화면에서 내역을 변경하거나 종료일자를 설정하시기 바랍니다");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void AddLoginInfo()
|
||||
|
||||
Reference in New Issue
Block a user