From 6a5eb13a6c5d1605934cb87206431476caea7619 Mon Sep 17 00:00:00 2001 From: chi Date: Mon, 30 May 2022 16:24:06 +0900 Subject: [PATCH] ... --- JobReportMailService/DataSet1.Designer.cs | 52 +- JobReportMailService/DataSet1.xsd | 30 +- JobReportMailService/DataSet1.xss | 14 +- .../Properties/AssemblyInfo.cs | 4 +- .../fJobReportWeek.Designer.cs | 100 +-- JobReportMailService/fJobReportWeek.cs | 669 +++++++++--------- JobReportMailService/fJobReportWeek.resx | 15 + Project/Properties/AssemblyInfo.cs | 4 +- Project/dsMSSQL.Designer.cs | 152 ++-- Project/dsMSSQL.xsd | 64 +- Project/dsMSSQL.xss | 2 +- 11 files changed, 611 insertions(+), 495 deletions(-) diff --git a/JobReportMailService/DataSet1.Designer.cs b/JobReportMailService/DataSet1.Designer.cs index 73a1f99..9ec93ea 100644 --- a/JobReportMailService/DataSet1.Designer.cs +++ b/JobReportMailService/DataSet1.Designer.cs @@ -2908,6 +2908,8 @@ namespace JobReportMailService { private global::System.Data.DataColumn columnoutdate; + private global::System.Data.DataColumn columnemail; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public vJobReportUserListDataTable() { @@ -2973,6 +2975,14 @@ namespace JobReportMailService { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public global::System.Data.DataColumn emailColumn { + get { + return this.columnemail; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.Browsable(false)] @@ -3010,13 +3020,14 @@ namespace JobReportMailService { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public vJobReportUserListRow AddvJobReportUserListRow(string gcode, string name, string id, string outdate) { + public vJobReportUserListRow AddvJobReportUserListRow(string gcode, string name, string id, string outdate, string email) { vJobReportUserListRow rowvJobReportUserListRow = ((vJobReportUserListRow)(this.NewRow())); object[] columnValuesArray = new object[] { gcode, name, id, - outdate}; + outdate, + email}; rowvJobReportUserListRow.ItemArray = columnValuesArray; this.Rows.Add(rowvJobReportUserListRow); return rowvJobReportUserListRow; @@ -3043,6 +3054,7 @@ namespace JobReportMailService { this.columnname = base.Columns["name"]; this.columnid = base.Columns["id"]; this.columnoutdate = base.Columns["outdate"]; + this.columnemail = base.Columns["email"]; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -3056,6 +3068,8 @@ namespace JobReportMailService { base.Columns.Add(this.columnid); this.columnoutdate = new global::System.Data.DataColumn("outdate", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnoutdate); + this.columnemail = new global::System.Data.DataColumn("email", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnemail); this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { this.columnid}, false)); this.columngcode.AllowDBNull = false; @@ -3064,6 +3078,7 @@ namespace JobReportMailService { this.columnid.Unique = true; this.columnid.MaxLength = 20; this.columnoutdate.MaxLength = 20; + this.columnemail.MaxLength = 100; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -6851,6 +6866,22 @@ namespace JobReportMailService { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public string email { + get { + if (this.IsemailNull()) { + return string.Empty; + } + else { + return ((string)(this[this.tablevJobReportUserList.emailColumn])); + } + } + set { + this[this.tablevJobReportUserList.emailColumn] = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public bool IsnameNull() { @@ -6886,6 +6917,18 @@ namespace JobReportMailService { public void SetoutdateNull() { this[this.tablevJobReportUserList.outdateColumn] = global::System.Convert.DBNull; } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public bool IsemailNull() { + return this.IsNull(this.tablevJobReportUserList.emailColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public void SetemailNull() { + this[this.tablevJobReportUserList.emailColumn] = global::System.Convert.DBNull; + } } /// @@ -11792,6 +11835,7 @@ SELECT idx, gcode, cate, title, tolist, bcc, cc, subject, tail, body, selfTo, se tableMapping.ColumnMappings.Add("name", "name"); tableMapping.ColumnMappings.Add("id", "id"); tableMapping.ColumnMappings.Add("outdate", "outdate"); + tableMapping.ColumnMappings.Add("email", "email"); this._adapter.TableMappings.Add(tableMapping); } @@ -11808,8 +11852,8 @@ SELECT idx, gcode, cate, title, tolist, bcc, cc, subject, tail, body, selfTo, se this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; - this._commandCollection[0].CommandText = "SELECT gcode, name, id, outdate\r\nFROM vGroupUser\r\nWHERE (ISNULL(useJobRepor" + - "t, 0) = 1) AND (gcode = @gcode)"; + this._commandCollection[0].CommandText = "SELECT gcode, name, id, outdate, email\r\nFROM vGroupUser\r\nWHERE (ISNULL(useJ" + + "obReport, 0) = 1) AND (gcode = @gcode)"; this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; this._commandCollection[0].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@gcode", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "gcode", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } diff --git a/JobReportMailService/DataSet1.xsd b/JobReportMailService/DataSet1.xsd index 53375bf..919f0b8 100644 --- a/JobReportMailService/DataSet1.xsd +++ b/JobReportMailService/DataSet1.xsd @@ -521,7 +521,7 @@ ORDER BY name - SELECT gcode, name, id, outdate + SELECT gcode, name, id, outdate, email FROM vGroupUser WHERE (ISNULL(useJobReport, 0) = 1) AND (gcode = @gcode) @@ -536,6 +536,7 @@ WHERE (ISNULL(useJobReport, 0) = 1) AND (gcode = @gcode) + @@ -944,7 +945,7 @@ ORDER BY pdate - + @@ -1032,7 +1033,7 @@ ORDER BY pdate - + @@ -1127,7 +1128,7 @@ ORDER BY pdate - + @@ -1222,7 +1223,7 @@ ORDER BY pdate - + @@ -1310,7 +1311,7 @@ ORDER BY pdate - + @@ -1330,7 +1331,7 @@ ORDER BY pdate - + @@ -1361,10 +1362,17 @@ ORDER BY pdate + + + + + + + - + @@ -1508,7 +1516,7 @@ ORDER BY pdate - + @@ -1538,7 +1546,7 @@ ORDER BY pdate - + @@ -1680,7 +1688,7 @@ ORDER BY pdate - + diff --git a/JobReportMailService/DataSet1.xss b/JobReportMailService/DataSet1.xss index 86abaa8..33e9827 100644 --- a/JobReportMailService/DataSet1.xss +++ b/JobReportMailService/DataSet1.xss @@ -4,18 +4,18 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + - + - - - - - + + + + + \ No newline at end of file diff --git a/JobReportMailService/Properties/AssemblyInfo.cs b/JobReportMailService/Properties/AssemblyInfo.cs index f423b6b..23a85e0 100644 --- a/JobReportMailService/Properties/AssemblyInfo.cs +++ b/JobReportMailService/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를 // 기본값으로 할 수 있습니다. // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("22.05.26.1150")] -[assembly: AssemblyFileVersion("22.05.26.1150")] +[assembly: AssemblyVersion("22.05.30.0920")] +[assembly: AssemblyFileVersion("22.05.30.0920")] diff --git a/JobReportMailService/fJobReportWeek.Designer.cs b/JobReportMailService/fJobReportWeek.Designer.cs index 81e7738..0c372f1 100644 --- a/JobReportMailService/fJobReportWeek.Designer.cs +++ b/JobReportMailService/fJobReportWeek.Designer.cs @@ -29,49 +29,60 @@ namespace JobReportMailService /// private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(fJobReportWeek)); - this.toolStrip1 = new System.Windows.Forms.ToolStrip(); - this.btRun = new System.Windows.Forms.ToolStripButton(); - this.toolStrip1.SuspendLayout(); - this.SuspendLayout(); - // - // timer1 - // - this.timer1.Tick += new System.EventHandler(this.timer1_Tick); - // - // toolStrip1 - // - this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.btRun}); - this.toolStrip1.Location = new System.Drawing.Point(0, 0); - this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(473, 25); - this.toolStrip1.TabIndex = 3; - this.toolStrip1.Text = "toolStrip1"; - // - // btRun - // - this.btRun.Image = ((System.Drawing.Image)(resources.GetObject("btRun.Image"))); - this.btRun.ImageTransparentColor = System.Drawing.Color.Magenta; - this.btRun.Name = "btRun"; - this.btRun.Size = new System.Drawing.Size(48, 22); - this.btRun.Text = "Run"; - this.btRun.Click += new System.EventHandler(this.toolStripButton1_Click); - // - // fJobReportWeek - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(473, 416); - this.Controls.Add(this.toolStrip1); - this.Name = "fJobReportWeek"; - this.Text = "업무일지(주간보고)"; - this.Load += new System.EventHandler(this.fJobReportDay_Load); - this.Controls.SetChildIndex(this.toolStrip1, 0); - this.toolStrip1.ResumeLayout(false); - this.toolStrip1.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(fJobReportWeek)); + this.toolStrip1 = new System.Windows.Forms.ToolStrip(); + this.btRun = new System.Windows.Forms.ToolStripButton(); + this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); + this.toolStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // timer1 + // + this.timer1.Tick += new System.EventHandler(this.timer1_Tick); + // + // toolStrip1 + // + this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.btRun, + this.toolStripButton1}); + this.toolStrip1.Location = new System.Drawing.Point(0, 0); + this.toolStrip1.Name = "toolStrip1"; + this.toolStrip1.Size = new System.Drawing.Size(473, 25); + this.toolStrip1.TabIndex = 3; + this.toolStrip1.Text = "toolStrip1"; + // + // btRun + // + this.btRun.Image = ((System.Drawing.Image)(resources.GetObject("btRun.Image"))); + this.btRun.ImageTransparentColor = System.Drawing.Color.Magenta; + this.btRun.Name = "btRun"; + this.btRun.Size = new System.Drawing.Size(48, 22); + this.btRun.Text = "Run"; + this.btRun.Click += new System.EventHandler(this.toolStripButton1_Click); + // + // toolStripButton1 + // + this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image"))); + this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton1.Name = "toolStripButton1"; + this.toolStripButton1.Size = new System.Drawing.Size(67, 22); + this.toolStripButton1.Text = "manual"; + this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click_1); + // + // fJobReportWeek + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(473, 416); + this.Controls.Add(this.toolStrip1); + this.Name = "fJobReportWeek"; + this.Text = "업무일지(주간보고)"; + this.Load += new System.EventHandler(this.fJobReportDay_Load); + this.Controls.SetChildIndex(this.toolStrip1, 0); + this.toolStrip1.ResumeLayout(false); + this.toolStrip1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); } @@ -79,5 +90,6 @@ namespace JobReportMailService private System.Windows.Forms.ToolStrip toolStrip1; private System.Windows.Forms.ToolStripButton btRun; - } + private System.Windows.Forms.ToolStripButton toolStripButton1; + } } \ No newline at end of file diff --git a/JobReportMailService/fJobReportWeek.cs b/JobReportMailService/fJobReportWeek.cs index 34583d5..354327b 100644 --- a/JobReportMailService/fJobReportWeek.cs +++ b/JobReportMailService/fJobReportWeek.cs @@ -10,337 +10,374 @@ using System.Windows.Forms; namespace JobReportMailService { - public partial class fJobReportWeek : fChildBase - { + public partial class fJobReportWeek : fChildBase + { - public fJobReportWeek() - { - InitializeComponent(); - } + public fJobReportWeek() + { + InitializeComponent(); + } - private void fJobReportDay_Load(object sender, EventArgs e) - { - task = Task.Run(() => - { - while (taskrun) - { - if (taskwait) - { - task.Wait(1000); - continue; - } + private void fJobReportDay_Load(object sender, EventArgs e) + { + task = Task.Run(() => + { + while (taskrun) + { + if (taskwait) + { + task.Wait(1000); + continue; + } - var ts = DateTime.Now - LastUpdateTime; - if (ts.TotalMinutes <= 15) - { - if ((DateTime.Now - ConsoleTime).TotalHours >= 1.0) - { - addmsg("15분 미만이라 동작하지 않습니다"); - ConsoleTime = DateTime.Now; - } - } - else if (DateTime.Now.DayOfWeek != DayOfWeek.Monday) - { - //토,일요일에는 동작하지 않는다 - if ((DateTime.Now - ConsoleTime).TotalHours >= 1.0) - { - addmsg("월요일에만 동작 함"); - ConsoleTime = DateTime.Now; - } - } - else if (DateTime.Now.Hour < 9) - { - if ((DateTime.Now - ConsoleTime).TotalHours >= 1.0) - { - addmsg("9시 이전에는 동작하지 않습니다"); - ConsoleTime = DateTime.Now; - } - } - else - { - LastUpdateTime = DateTime.Now; - try - { - RunData(); - } - catch (Exception ex) - { - addmsg(ex.Message); + var ts = DateTime.Now - LastUpdateTime; + if (ts.TotalMinutes <= 15) + { + if ((DateTime.Now - ConsoleTime).TotalHours >= 1.0) + { + addmsg("15분 미만이라 동작하지 않습니다"); + ConsoleTime = DateTime.Now; + } + } + else if (DateTime.Now.DayOfWeek != DayOfWeek.Monday) + { + //토,일요일에는 동작하지 않는다 + if ((DateTime.Now - ConsoleTime).TotalHours >= 1.0) + { + addmsg("월요일에만 동작 함"); + ConsoleTime = DateTime.Now; + } + } + else if (DateTime.Now.Hour < 9) + { + if ((DateTime.Now - ConsoleTime).TotalHours >= 1.0) + { + addmsg("9시 이전에는 동작하지 않습니다"); + ConsoleTime = DateTime.Now; + } + } + else + { + LastUpdateTime = DateTime.Now; + try + { + RunData(); + } + catch (Exception ex) + { + addmsg(ex.Message); - using (var ta = new DataSet1TableAdapters.MailDataTableAdapter()) - { - using (var dt = new DataSet1.MailDataDataTable()) - { - var newdr = dt.NewMailDataRow(); - newdr.gcode = "EET1P"; - newdr.cate = "ER"; - newdr.subject = "[ERROR] 업무일지(주간) 메일작성 실패"; - newdr.fromlist = "chikyun.kim@amkor.co.kr"; - newdr.tolist = "chikyun.kim@amkor.co.kr"; - newdr.bcc = string.Empty; - newdr.cc = string.Empty; - newdr.pdate = DateTime.Now.ToShortDateString(); - newdr.body = ex.Message; - newdr.wuid = "dev"; - newdr.wdate = DateTime.Now; - newdr.EndEdit(); - dt.AddMailDataRow(newdr); - var cnt = ta.Update(dt); - } - } + using (var ta = new DataSet1TableAdapters.MailDataTableAdapter()) + { + using (var dt = new DataSet1.MailDataDataTable()) + { + var newdr = dt.NewMailDataRow(); + newdr.gcode = "EET1P"; + newdr.cate = "ER"; + newdr.subject = "[ERROR] 업무일지(주간) 메일작성 실패"; + newdr.fromlist = "chikyun.kim@amkor.co.kr"; + newdr.tolist = "chikyun.kim@amkor.co.kr"; + newdr.bcc = string.Empty; + newdr.cc = string.Empty; + newdr.pdate = DateTime.Now.ToShortDateString(); + newdr.body = ex.Message; + newdr.wuid = "dev"; + newdr.wdate = DateTime.Now; + newdr.EndEdit(); + dt.AddMailDataRow(newdr); + var cnt = ta.Update(dt); + } + } - task.Wait(5000); - } - } - Task.Delay(Delaytime).Wait(); - } + task.Wait(5000); + } + } + Task.Delay(Delaytime).Wait(); + } - }); - timer1.Start(); - if (Pub.setting.autoRunData) - btRun.PerformClick(); - } + }); + timer1.Start(); + if (Pub.setting.autoRunData) + btRun.PerformClick(); + } - void RunData() - { + void RunData() + { - addmsg("업무일지 미 작성자(주간) 추출 작업을 시작 합니다"); + addmsg("업무일지 미 작성자(주간) 추출 작업을 시작 합니다"); - var db = new EEEntities(); - - //기준일자는 오늘부터 -15일이다 - var sd = DateTime.Now.AddDays(-15); - var ed = DateTime.Now; - var str_sd = sd.ToShortDateString(); - var str_ed = ed.ToShortDateString(); - var str_dt = DateTime.Now.ToShortDateString(); - - var gcodelist = db.MailForm.GroupBy(t => t.gcode).ToList(); - foreach (var gcodedata in gcodelist) - { - //메일양식이 지정되어있는지 체크 - var vGcode = gcodedata.Key; - if (string.IsNullOrEmpty(vGcode)) continue; - - //메일양식이 지정되어있는지 체크 - var MailJW = db.MailForm.Where(t => t.gcode == vGcode & t.cate == "JW").FirstOrDefault(); - - if (MailJW == null) - { - //토,일요일에는 동작하지 않는다 - addmsg($"[{vGcode}] 업무일지 미작성(주간) 메일 양식이 입력되지 않았습니다"); - continue; - } - if (MailJW.exceptmail == null) MailJW.exceptmail = string.Empty; - if (MailJW.exceptmailcc == null) MailJW.exceptmailcc = string.Empty; - - //오늘날짜로 주간 데이터가 등록되어있느지 확인한다. - db = new EEEntities(); - var Existweek = db.MailData.Where(t => t.gcode == vGcode && t.cate == "JW" && t.pdate == str_dt).Any(); - if (Existweek) - { - addmsg($"[{vGcode}] 주간일자({str_dt}) 보고 메일이 이미 등록되어 있습니다"); - continue; - } - - //대상 사용자 목록을 추출한다 - db = new EEEntities(); - var users = db.vJobReportForUser.Where(t => t.gcode == vGcode).GroupBy(t => t.id); - Dictionary uids = new Dictionary(); - foreach (var user in users) - { - //해당 사용자의 오늘 날짜로 등록된 자동 데이터가 있다면 대상에 넣지 않는다 - var userinfo = user.FirstOrDefault(); - if (userinfo == null || string.IsNullOrEmpty(userinfo.id)) continue; //null인게 있네? 220110 - - //퇴사자 확인 - db = new EEEntities(); - var userdata = db.vGroupUser.Where(t => t.gcode == vGcode && t.id == userinfo.id).FirstOrDefault(); - if (userdata == null) continue; - if (userdata != null && string.IsNullOrEmpty(userdata.outdate) == false) continue; - - //사용자 정보에 업무일지를 사용하지 않기로 했다면 처리하지 않는다. 퇴사자는 이값도 설정된다. - if (userdata.useJobReport != null && userdata.useJobReport == false) continue; - - //이 대상의 이메일이 받는 사람에 제외되어있다면 처리하지 않는다. - if (MailJW.exceptmail == null) MailJW.exceptmail = string.Empty; - var exxptolist = MailJW.exceptmail.ToUpper().Split(';'); - if (exxptolist.Contains(userdata.email.ToUpper()) == false) - { - //모두대상으로 처리한다 - //if (userdata.email.ToUpper() != ("BongSeok.Jung@amkor.co.kr").ToUpper()) - uids.Add(userinfo.id, userinfo.name); - } - else addmsg($"[{vGcode}] 주간 제외대상자임 " + userdata.email); - } - - addmsg($"[{vGcode}] {uids.Count} 명의 전체 사용자가 확인 되었습니다"); - - //먼저 날짜목록을 가져온다 - db = new EEEntities(); - var lstDate = db.JobReport - .Where(t => t.gcode == vGcode && t.pdate.CompareTo(str_sd) >= 0 && t.pdate.CompareTo(str_ed) < 0) - .OrderBy(t => t.pdate) - .GroupBy(t => t.pdate).ToList(); - - //날짜대로 루프를 돈다 - List days = new List(); - foreach (var dateitem in lstDate) - { - var jobdata = dateitem.FirstOrDefault(); - var dt = DateTime.Parse(jobdata.pdate); - if (dt.DayOfWeek == DayOfWeek.Sunday || dt.DayOfWeek == DayOfWeek.Saturday) continue; - - //이 날짜가 휴일인지 체크한다. - db = new EEEntities(); - var Holyinfo = db.HolidayLIst.Where(t => t.pdate == jobdata.pdate).FirstOrDefault(); - if (Holyinfo != null && Holyinfo.free != null && (bool)(Holyinfo.free)) continue; - - //이날짜에는 8시간을 근무 해야 한다 - days.Add(DateTime.Parse(jobdata.pdate)); - } - addmsg($"[{vGcode}] {days.Count} 건의 일자가 확인 되었습니다(기간:{str_sd}~{str_ed}"); - - //사용자 목록과 날짜 목록을 모두 수집했다 - List totWarnList = new List(); - foreach (var uid in uids) - { - //이사용자의 날짜별 근무시간을 확인한다. - db = new EEEntities(); - var UserDatas = db.vJobReportForUser.Where(t => t.gcode == vGcode && t.id == uid.Key && t.pdate.CompareTo(str_sd) >= 0 && t.pdate.CompareTo(str_ed) < 0).ToList(); - - Dictionary WarnList = new Dictionary(); - foreach (var dt in days.OrderBy(t => t)) - { - var dtstr = dt.ToShortDateString(); - var userdata = UserDatas.Where(t => t.pdate == dtstr); //해당날짜의 데이터를 확인한다. - var hrs = 0.0; - if (userdata.Any()) hrs = (double)userdata.Sum(t => t.hrs); - - //자료를 입력하지 않았거나, 입력시간이 8시간 미만이면 경고한다 - if (hrs < 8.0) - { - //WarnList.Add(dt, hrs); - totWarnList.Add(new ReportUserData { date = dt, hrs = hrs, uid = uid.Key, uname = uid.Value }); //전체알림시에 사용하는 목록 - } - } - - } - - if (totWarnList.Count > 0) - { - addmsg($"[{vGcode}] 주간 경고 데이터는 {totWarnList.Count} 건 입니다"); - - //오늘잘짜로 등록된 자료가 있으면 처리하지 안흔다. - //해당 사용자의 오늘 날짜로 등록된 자동 데이터가 있다면 대상에 넣지 않는다 - db = new EEEntities(); - - var mail_subject = MailJW.subject; - var mail_to = MailJW.tolist;//.Replace("{담당자}", userinfo.email); - var pmail_cc = new List(); // - if (MailJW.cc != null) pmail_cc = MailJW.cc.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries).ToList();//.Replace("{담당자}", userinfo.email); - var mail_bcc = string.Empty; - if (MailJW.bcc != null) mail_bcc = MailJW.bcc;//.Replace("{담당자}", userinfo.email); - var mail_body = MailJW.body;//.Replace("{담당자}", userinfo.name); - - //메일본문을 생성해서 진행해야함 - var vmail_body = "

담당자별 정보

"; - vmail_body += "
조회기간 : " + sd.ToShortDateString() + "~" + ed.ToShortDateString(); - - //참고데이터를 추가한다 - var usergrplist = totWarnList.OrderBy(t => t.uname).GroupBy(t => t.uid).ToList(); - foreach (var item in usergrplist) - { - var fitem = item.FirstOrDefault(); - db = new EEEntities(); - var userinfo = db.vGroupUser.Where(t => t.gcode == vGcode && t.id == fitem.uid).FirstOrDefault(); - var username = string.Empty; - if (userinfo != null) - { - if (string.IsNullOrEmpty(userinfo.email) == false) - { - //if (pmail_cc.Contains(userinfo.email) == false) - // pmail_cc.Add(userinfo.email); - } - username = userinfo.name; - } - } - - vmail_body += "
"; - var mail_cc = string.Join(";", pmail_cc); //모든 대상을 세미콜론으로 붙인다. - foreach (var warnitem in usergrplist) - { - var item = warnitem.FirstOrDefault(); - vmail_body += $""; - } - vmail_body += "
담당자일자별시간
{item.uname}({item.uid})"; - foreach (var ii in warnitem.OrderBy(t => t.date)) - { - vmail_body += $" {ii.date.ToString("MM/dd")}({ii.hrs}h)"; - } - vmail_body += "
"; - - //메일데이터를 생성한다. - //mail_bcc = string.Empty; - //mail_cc = string.Empty; - //mail_to = "chikyun.kim@amkor.co.kr"; - - db = new EEEntities(); - mail_to = Pub.MailSort(mail_to, MailJW.exceptmail); - if (string.IsNullOrEmpty(mail_to) == false) - { - db.MailData.Add(new MailData - { - gcode = vGcode, - cate = "JW", - subject = mail_subject, - fromlist = "EETGW@amkor.co.kr", - tolist = Pub.MailSort(mail_to, MailJW.exceptmail), - bcc = mail_bcc, - cc = Pub.MailSort(mail_cc, MailJW.exceptmailcc), - pdate = DateTime.Now.ToShortDateString(), - body = mail_body.Replace("{내용}", vmail_body), - wuid = "dev", - wdate = DateTime.Now, - }); - db.SaveChanges(); - addmsg($"[{vGcode}] 주간 알림데이터가 등록되었습니다"); - } - else - { - addmsg($"[{vGcode}] 받는사람이 소거되어 메일을 생성하지 않습니다"); - } - } + var taMailForm = new DataSet1TableAdapters.MailFormTableAdapter(); + var taMailData = new DataSet1TableAdapters.MailDataTableAdapter(); + var taJobReportUserList = new DataSet1TableAdapters.vJobReportUserListTableAdapter(); + var taJobReport = new DataSet1TableAdapters.JobReportTableAdapter(); + var taHolidayList = new DataSet1TableAdapters.HolidayLIstTableAdapter(); + var taGroupUser = new DataSet1TableAdapters.vGroupUserTableAdapter(); + var taJobReportDateList = new DataSet1TableAdapters.JobReportDateListTableAdapter(); - System.Threading.Thread.Sleep(500); + var dtMailForm = new DataSet1.MailFormDataTable(); + var dtMailData = new DataSet1.MailDataDataTable(); + var dtDateList = new DataSet1.JobReportDateListDataTable(); - } + taMailForm.Fill(dtMailForm); + + //기준일자는 오늘부터 -15일이다 + var sd = DateTime.Now.AddDays(-15); + var ed = DateTime.Now.AddDays(-1); + var str_sd = sd.ToShortDateString(); + var str_ed = ed.ToShortDateString(); + var str_dt = DateTime.Now.ToShortDateString(); + + var gcodelist = dtMailForm.GroupBy(t => t.gcode).Select(t => t.Key).ToList(); + foreach (var gcodedata in gcodelist) + { + //메일양식이 지정되어있는지 체크 + var vGcode = gcodedata; + if (string.IsNullOrEmpty(vGcode)) continue; + + //메일양식이 지정되어있는지 체크 + var MailJW = dtMailForm.Where(t => t.gcode == vGcode & t.cate == "JW").FirstOrDefault(); + if (MailJW == null) + { + addmsg($"[{vGcode}] 업무일지 미작성(주간) 메일 양식이 입력되지 않았습니다"); + continue; + } + if (MailJW.exceptmail == null) MailJW.exceptmail = string.Empty; + if (MailJW.exceptmailcc == null) MailJW.exceptmailcc = string.Empty; + + //오늘날짜로 주간 데이터가 등록되어있느지 확인한다. + var Existweek = taMailData.GetDataExistDay(vGcode, "JW", str_dt).Any(); + if (Existweek) + { + addmsg($"[{vGcode}] 업무일지({str_dt}) (주간)보고 메일이 이미 등록되어 있습니다"); + continue; + } + + //대상 사용자 목록을 추출한다 + var users = taJobReportUserList.GetData(vGcode); + Dictionary uids = new Dictionary(); + foreach (var userinfo in users) + { + //해당 사용자의 오늘 날짜로 등록된 자동 데이터가 있다면 대상에 넣지 않는다 + // var userinfo = user.FirstOrDefault(); + if (userinfo == null || string.IsNullOrEmpty(userinfo.id)) continue; //null인게 있네? 220110 + + //퇴사자 확인 + var 퇴사일자 = userinfo.outdate; + if (string.IsNullOrEmpty(퇴사일자) == false) + { + //퇴사자 + if (퇴사일자.CompareTo(str_dt) < 1) continue; + } + + //이 대상의 이메일이 받는 사람에 제외되어있다면 처리하지 않는다. + if (MailJW.exceptmail == null) MailJW.exceptmail = string.Empty; + var exxptolist = MailJW.exceptmail.ToUpper().Split(';'); + if (exxptolist.Contains(userinfo.email.ToUpper()) == false) + { + //모두대상으로 처리한다 + //if (userdata.email.ToUpper() != ("BongSeok.Jung@amkor.co.kr").ToUpper()) + uids.Add(userinfo.id, userinfo.name); + } + else addmsg($"[{vGcode}] 주간 제외대상자임 " + userinfo.email); + } + + addmsg($"[{vGcode}] {uids.Count} 명의 전체 사용자가 확인 되었습니다"); + + //먼저 날짜목록을 가져온다 + //db = new EEEntities(); + //var lstDate = db.JobReport + // .Where(t => t.gcode == vGcode && t.pdate.CompareTo(str_sd) >= 0 && t.pdate.CompareTo(str_ed) < 0) + // .OrderBy(t => t.pdate) + // .GroupBy(t => t.pdate).ToList(); + + dtDateList = taJobReportDateList.GetData(vGcode, str_sd, str_ed);// + + //날짜대로 루프를 돈다 + List days = new List(); + foreach (var jobdata in dtDateList) + { + // var jobdata = dateitem.FirstOrDefault(); + var dt = DateTime.Parse(jobdata.pdate); + if (dt.DayOfWeek == DayOfWeek.Sunday || dt.DayOfWeek == DayOfWeek.Saturday) continue; + + //이 날짜가 휴일인지 체크한다. + var Holyinfo = taHolidayList.GetData(jobdata.pdate).FirstOrDefault(); + //var Holyinfo = db.HolidayLIst.Where(t => t.pdate == jobdata.pdate).FirstOrDefault(); + if (Holyinfo != null && Holyinfo.free == true) continue; + + //이날짜에는 8시간을 근무 해야 한다 + days.Add(DateTime.Parse(jobdata.pdate)); + } + addmsg($"[{vGcode}] {days.Count} 건의 일자가 확인 되었습니다(기간:{str_sd}~{str_ed}"); + + //사용자 목록과 날짜 목록을 모두 수집했다 + List totWarnList = new List(); + foreach (var uid in uids) + { + //이사용자의 날짜별 근무시간을 확인한다. + var UserDatas = taJobReport.GetUserDates(vGcode, uid.Key, str_sd, str_ed); + + Dictionary WarnList = new Dictionary(); + foreach (var dt in days.OrderBy(t => t)) + { + var dtstr = dt.ToShortDateString(); + var userdata = UserDatas.Where(t => t.pdate == dtstr); //해당날짜의 데이터를 확인한다. + var hrs = 0.0; + if (userdata.Any()) hrs = (double)userdata.Sum(t => t.hrs); + + //자료를 입력하지 않았거나, 입력시간이 8시간 미만이면 경고한다 + if (hrs < 8.0) + { + //WarnList.Add(dt, hrs); + totWarnList.Add(new ReportUserData { date = dt, hrs = hrs, uid = uid.Key, uname = uid.Value }); //전체알림시에 사용하는 목록 + } + } + + } + + if (totWarnList.Count > 0) + { + addmsg($"[{vGcode}] 주간 경고 데이터는 {totWarnList.Count} 건 입니다"); + + //오늘잘짜로 등록된 자료가 있으면 처리하지 안흔다. + //해당 사용자의 오늘 날짜로 등록된 자동 데이터가 있다면 대상에 넣지 않는다 + //db = new EEEntities(); + + var mail_subject = MailJW.subject; + var mail_to = MailJW.tolist;//.Replace("{담당자}", userinfo.email); + var pmail_cc = new List(); // + if (MailJW.cc != null) pmail_cc = MailJW.cc.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries).ToList();//.Replace("{담당자}", userinfo.email); + var mail_bcc = string.Empty; + if (MailJW.bcc != null) mail_bcc = MailJW.bcc;//.Replace("{담당자}", userinfo.email); + var mail_body = MailJW.body;//.Replace("{담당자}", userinfo.name); + + //메일본문을 생성해서 진행해야함 + var vmail_body = "

담당자별 정보

"; + vmail_body += "
조회기간 : " + sd.ToShortDateString() + "~" + ed.ToShortDateString(); + + ////참고데이터를 추가한다 + var usergrplist = totWarnList.OrderBy(t => t.uname).GroupBy(t => t.uid).ToList(); + //foreach (var item in usergrplist) + //{ + // //var fitem = item.FirstOrDefault(); + // //db = new EEEntities(); + // var userinfo = item.FirstOrDefault();// db.vGroupUser.Where(t => t.gcode == vGcode && t.id == fitem.uid).FirstOrDefault(); + // var username = string.Empty; + // if (userinfo != null) + // { + // if (string.IsNullOrEmpty(userinfo.email) == false) + // { + // //if (pmail_cc.Contains(userinfo.email) == false) + // // pmail_cc.Add(userinfo.email); + // } + // username = userinfo.name; + // } + //} + + vmail_body += "
"; + var mail_cc = string.Join(";", pmail_cc); //모든 대상을 세미콜론으로 붙인다. + foreach (var warnitem in usergrplist) + { + var item = warnitem.FirstOrDefault(); + vmail_body += $""; + } + vmail_body += "
담당자일자별시간
{item.uname}({item.uid})"; + foreach (var ii in warnitem.OrderBy(t => t.date)) + { + vmail_body += $" {ii.date.ToString("MM/dd")}({ii.hrs}h)"; + } + vmail_body += "
"; + + //메일데이터를 생성한다. + //mail_bcc = string.Empty; + //mail_cc = string.Empty; + //mail_to = "chikyun.kim@amkor.co.kr"; + + //db = new EEEntities(); + mail_to = Pub.MailSort(mail_to, MailJW.exceptmail); + if (string.IsNullOrEmpty(mail_to) == false) + { + using (var dt = new DataSet1.MailDataDataTable()) + { + + var newdr = dt.NewMailDataRow(); + newdr.gcode = vGcode; + newdr.cate = "JW"; + newdr.subject = mail_subject; + newdr.fromlist = "EETGW@amkor.co.kr"; + newdr.tolist = Pub.MailSort(mail_to, MailJW.exceptmail); + newdr.bcc = mail_bcc; + newdr.cc = Pub.MailSort(mail_cc, MailJW.exceptmailcc); + newdr.pdate = DateTime.Now.ToShortDateString(); + newdr.body = mail_body.Replace("{내용}", vmail_body); + newdr.wuid = "dev"; + newdr.wdate = DateTime.Now; + newdr.EndEdit(); + dt.AddMailDataRow(newdr); + var cnt = taMailData.Update(dt); + + if (cnt == 1) + { + addmsg($"[{vGcode}] {cnt}건) 메일 생성 완료(week)"); + System.Threading.Thread.Sleep(10000); + } + } + } + else + { + addmsg($"[{vGcode}] 받는사람이 소거되어 메일을 생성하지 않습니다"); + } + } + + + System.Threading.Thread.Sleep(500); + + } + + dtMailForm.Dispose(); + dtMailData.Dispose(); + dtDateList.Dispose(); - } - private void toolStripButton1_Click(object sender, EventArgs e) - { - taskwait = !taskwait; - } + taMailForm.Dispose();// = new DataSet1TableAdapters.MailFormTableAdapter(); + taMailData.Dispose();// = new DataSet1TableAdapters.MailDataTableAdapter(); + taJobReportUserList.Dispose();// = new DataSet1TableAdapters.vJobReportUserListTableAdapter(); + taJobReport.Dispose();// = new DataSet1TableAdapters.JobReportTableAdapter(); + taHolidayList.Dispose();// = new DataSet1TableAdapters.HolidayLIstTableAdapter(); + taGroupUser.Dispose();// = new DataSet1TableAdapters.vGroupUserTableAdapter(); + taJobReportDateList.Dispose(); - private void timer1_Tick(object sender, EventArgs e) - { - if (task != null) - { - if (task.IsCompleted) this.btRun.Text = "완료"; - else if (task.IsCanceled) this.btRun.Text = "취소"; - else if (taskwait) this.btRun.Text = "대기상태"; - else this.btRun.Text = "가동중"; - this.btRun.Enabled = true; - } - else - { - this.btRun.Text = "사용불가"; - this.btRun.Enabled = false; - } - } - } + + } + + private void toolStripButton1_Click(object sender, EventArgs e) + { + taskwait = !taskwait; + } + + private void timer1_Tick(object sender, EventArgs e) + { + if (task != null) + { + if (task.IsCompleted) this.btRun.Text = "완료"; + else if (task.IsCanceled) this.btRun.Text = "취소"; + else if (taskwait) this.btRun.Text = "대기상태"; + else this.btRun.Text = "가동중"; + this.btRun.Enabled = true; + } + else + { + this.btRun.Text = "사용불가"; + this.btRun.Enabled = false; + } + } + + private void toolStripButton1_Click_1(object sender, EventArgs e) + { + RunData(); + } + } } diff --git a/JobReportMailService/fJobReportWeek.resx b/JobReportMailService/fJobReportWeek.resx index df60ad6..0f604e2 100644 --- a/JobReportMailService/fJobReportWeek.resx +++ b/JobReportMailService/fJobReportWeek.resx @@ -137,6 +137,21 @@ mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D TgDQASA1MVpwzwAAAABJRU5ErkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG + YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 + 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw + bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc + VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 + c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 + Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo + mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ + kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D + TgDQASA1MVpwzwAAAABJRU5ErkJggg== \ No newline at end of file diff --git a/Project/Properties/AssemblyInfo.cs b/Project/Properties/AssemblyInfo.cs index 1bd7973..b669793 100644 --- a/Project/Properties/AssemblyInfo.cs +++ b/Project/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호가 자동으로 // 지정되도록 할 수 있습니다. // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("22.05.27.2330")] -[assembly: AssemblyFileVersion("22.05.27.2330")] +[assembly: AssemblyVersion("22.05.30.1600")] +[assembly: AssemblyFileVersion("22.05.30.1600")] diff --git a/Project/dsMSSQL.Designer.cs b/Project/dsMSSQL.Designer.cs index 9399bd4..7cbac80 100644 --- a/Project/dsMSSQL.Designer.cs +++ b/Project/dsMSSQL.Designer.cs @@ -8032,11 +8032,11 @@ namespace Project { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public string dept { get { - try { - return ((string)(this[this.tablevGroupUser.deptColumn])); + if (this.IsdeptNull()) { + return string.Empty; } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("\'vGroupUser\' 테이블의 \'dept\' 열의 값이 DBNull입니다.", e); + else { + return ((string)(this[this.tablevGroupUser.deptColumn])); } } set { @@ -8048,11 +8048,11 @@ namespace Project { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public short level { get { - try { - return ((short)(this[this.tablevGroupUser.levelColumn])); + if (this.IslevelNull()) { + return 0; } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("\'vGroupUser\' 테이블의 \'level\' 열의 값이 DBNull입니다.", e); + else { + return ((short)(this[this.tablevGroupUser.levelColumn])); } } set { @@ -8064,11 +8064,11 @@ namespace Project { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public string name { get { - try { - return ((string)(this[this.tablevGroupUser.nameColumn])); + if (this.IsnameNull()) { + return string.Empty; } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("\'vGroupUser\' 테이블의 \'name\' 열의 값이 DBNull입니다.", e); + else { + return ((string)(this[this.tablevGroupUser.nameColumn])); } } set { @@ -8080,11 +8080,11 @@ namespace Project { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public string nameE { get { - try { - return ((string)(this[this.tablevGroupUser.nameEColumn])); + if (this.IsnameENull()) { + return string.Empty; } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("\'vGroupUser\' 테이블의 \'nameE\' 열의 값이 DBNull입니다.", e); + else { + return ((string)(this[this.tablevGroupUser.nameEColumn])); } } set { @@ -8096,11 +8096,11 @@ namespace Project { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public string grade { get { - try { - return ((string)(this[this.tablevGroupUser.gradeColumn])); + if (this.IsgradeNull()) { + return string.Empty; } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("\'vGroupUser\' 테이블의 \'grade\' 열의 값이 DBNull입니다.", e); + else { + return ((string)(this[this.tablevGroupUser.gradeColumn])); } } set { @@ -8112,11 +8112,11 @@ namespace Project { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public string email { get { - try { - return ((string)(this[this.tablevGroupUser.emailColumn])); + if (this.IsemailNull()) { + return string.Empty; } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("\'vGroupUser\' 테이블의 \'email\' 열의 값이 DBNull입니다.", e); + else { + return ((string)(this[this.tablevGroupUser.emailColumn])); } } set { @@ -8128,11 +8128,11 @@ namespace Project { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public string tel { get { - try { - return ((string)(this[this.tablevGroupUser.telColumn])); + if (this.IstelNull()) { + return string.Empty; } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("\'vGroupUser\' 테이블의 \'tel\' 열의 값이 DBNull입니다.", e); + else { + return ((string)(this[this.tablevGroupUser.telColumn])); } } set { @@ -8144,11 +8144,11 @@ namespace Project { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public string indate { get { - try { - return ((string)(this[this.tablevGroupUser.indateColumn])); + if (this.IsindateNull()) { + return string.Empty; } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("\'vGroupUser\' 테이블의 \'indate\' 열의 값이 DBNull입니다.", e); + else { + return ((string)(this[this.tablevGroupUser.indateColumn])); } } set { @@ -8160,11 +8160,11 @@ namespace Project { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public string outdate { get { - try { - return ((string)(this[this.tablevGroupUser.outdateColumn])); + if (this.IsoutdateNull()) { + return string.Empty; } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("\'vGroupUser\' 테이블의 \'outdate\' 열의 값이 DBNull입니다.", e); + else { + return ((string)(this[this.tablevGroupUser.outdateColumn])); } } set { @@ -8176,11 +8176,11 @@ namespace Project { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public string hp { get { - try { - return ((string)(this[this.tablevGroupUser.hpColumn])); + if (this.IshpNull()) { + return string.Empty; } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("\'vGroupUser\' 테이블의 \'hp\' 열의 값이 DBNull입니다.", e); + else { + return ((string)(this[this.tablevGroupUser.hpColumn])); } } set { @@ -8192,11 +8192,11 @@ namespace Project { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public string place { get { - try { - return ((string)(this[this.tablevGroupUser.placeColumn])); + if (this.IsplaceNull()) { + return string.Empty; } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("\'vGroupUser\' 테이블의 \'place\' 열의 값이 DBNull입니다.", e); + else { + return ((string)(this[this.tablevGroupUser.placeColumn])); } } set { @@ -8208,11 +8208,11 @@ namespace Project { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public string ads_employNo { get { - try { - return ((string)(this[this.tablevGroupUser.ads_employNoColumn])); + if (this.Isads_employNoNull()) { + return string.Empty; } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("\'vGroupUser\' 테이블의 \'ads_employNo\' 열의 값이 DBNull입니다.", e); + else { + return ((string)(this[this.tablevGroupUser.ads_employNoColumn])); } } set { @@ -8224,11 +8224,11 @@ namespace Project { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public string ads_title { get { - try { - return ((string)(this[this.tablevGroupUser.ads_titleColumn])); + if (this.Isads_titleNull()) { + return string.Empty; } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("\'vGroupUser\' 테이블의 \'ads_title\' 열의 값이 DBNull입니다.", e); + else { + return ((string)(this[this.tablevGroupUser.ads_titleColumn])); } } set { @@ -8240,11 +8240,11 @@ namespace Project { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public string ads_created { get { - try { - return ((string)(this[this.tablevGroupUser.ads_createdColumn])); + if (this.Isads_createdNull()) { + return string.Empty; } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("\'vGroupUser\' 테이블의 \'ads_created\' 열의 값이 DBNull입니다.", e); + else { + return ((string)(this[this.tablevGroupUser.ads_createdColumn])); } } set { @@ -8256,11 +8256,11 @@ namespace Project { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public string memo { get { - try { - return ((string)(this[this.tablevGroupUser.memoColumn])); + if (this.IsmemoNull()) { + return string.Empty; } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("\'vGroupUser\' 테이블의 \'memo\' 열의 값이 DBNull입니다.", e); + else { + return ((string)(this[this.tablevGroupUser.memoColumn])); } } set { @@ -8272,11 +8272,11 @@ namespace Project { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public string processs { get { - try { - return ((string)(this[this.tablevGroupUser.processsColumn])); + if (this.IsprocesssNull()) { + return string.Empty; } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("\'vGroupUser\' 테이블의 \'processs\' 열의 값이 DBNull입니다.", e); + else { + return ((string)(this[this.tablevGroupUser.processsColumn])); } } set { @@ -8299,11 +8299,11 @@ namespace Project { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public string state { get { - try { - return ((string)(this[this.tablevGroupUser.stateColumn])); + if (this.IsstateNull()) { + return string.Empty; } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("\'vGroupUser\' 테이블의 \'state\' 열의 값이 DBNull입니다.", e); + else { + return ((string)(this[this.tablevGroupUser.stateColumn])); } } set { @@ -8315,11 +8315,11 @@ namespace Project { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public bool useJobReport { get { - try { - return ((bool)(this[this.tablevGroupUser.useJobReportColumn])); + if (this.IsuseJobReportNull()) { + return false; } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("\'vGroupUser\' 테이블의 \'useJobReport\' 열의 값이 DBNull입니다.", e); + else { + return ((bool)(this[this.tablevGroupUser.useJobReportColumn])); } } set { @@ -8331,11 +8331,11 @@ namespace Project { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public bool useUserState { get { - try { - return ((bool)(this[this.tablevGroupUser.useUserStateColumn])); + if (this.IsuseUserStateNull()) { + return false; } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("\'vGroupUser\' 테이블의 \'useUserState\' 열의 값이 DBNull입니다.", e); + else { + return ((bool)(this[this.tablevGroupUser.useUserStateColumn])); } } set { diff --git a/Project/dsMSSQL.xsd b/Project/dsMSSQL.xsd index aa074f2..1ca5500 100644 --- a/Project/dsMSSQL.xsd +++ b/Project/dsMSSQL.xsd @@ -1369,7 +1369,7 @@ WHERE (idx = @idx) - + @@ -1510,7 +1510,7 @@ WHERE (idx = @idx) - + @@ -1581,7 +1581,7 @@ WHERE (idx = @idx) - + @@ -1639,7 +1639,7 @@ WHERE (idx = @idx) - + @@ -1709,7 +1709,7 @@ WHERE (idx = @idx) - + @@ -1767,7 +1767,7 @@ WHERE (idx = @idx) - + @@ -1794,14 +1794,14 @@ WHERE (idx = @idx) - + - + @@ -1811,7 +1811,7 @@ WHERE (idx = @idx) - + @@ -1927,7 +1927,7 @@ WHERE (idx = @idx) - + @@ -1966,7 +1966,7 @@ WHERE (idx = @idx) - + @@ -1976,128 +1976,128 @@ WHERE (idx = @idx) - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + @@ -2108,7 +2108,7 @@ WHERE (idx = @idx) - + diff --git a/Project/dsMSSQL.xss b/Project/dsMSSQL.xss index e8aec6d..237f75c 100644 --- a/Project/dsMSSQL.xss +++ b/Project/dsMSSQL.xss @@ -4,7 +4,7 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - +