...
This commit is contained in:
@@ -197,6 +197,107 @@ namespace FCOMMON
|
||||
}
|
||||
}
|
||||
|
||||
public static bool AddMagamList(string mon)
|
||||
{
|
||||
var gcode = FCOMMON.info.Login.gcode;
|
||||
|
||||
|
||||
//해당기간내의 마감 자료를 조회해서 넣는다.
|
||||
var cn = getCn();
|
||||
cn.Open();
|
||||
|
||||
var retval = new List<string>();
|
||||
string sql = "select count(*) from EETGW_Magam where gcode=@gcode and pdate = @pdate";
|
||||
var cmd = new SqlCommand(sql, cn);
|
||||
cmd.Parameters.Add("gcode", System.Data.SqlDbType.VarChar).Value = gcode;
|
||||
cmd.Parameters.Add("pdate", System.Data.SqlDbType.VarChar).Value = mon;
|
||||
var datacnt = int.Parse(cmd.ExecuteScalar().ToString());
|
||||
if (datacnt == 0)
|
||||
{
|
||||
sql = "insert into EETGW_Magam(gcode,pdate,wdate,wuid) values(@gcode,@pdate,@wdate,@wuid)";
|
||||
cmd.CommandText = sql;
|
||||
cmd.Parameters.Add("wdate", System.Data.SqlDbType.DateTime).Value = DateTime.Now;
|
||||
cmd.Parameters.Add("wuid", System.Data.SqlDbType.VarChar).Value = FCOMMON.info.Login.no;
|
||||
datacnt = cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
cn.Close();
|
||||
cn.Dispose();
|
||||
return datacnt == 1;
|
||||
|
||||
}
|
||||
|
||||
public static List<string> GetMagamList()
|
||||
{
|
||||
var gcode = FCOMMON.info.Login.gcode;
|
||||
var sdate = DateTime.Now.AddMonths(-6).ToString("yyyy-MM");
|
||||
var edate = DateTime.Now.AddMonths(1).ToString("yyyy-MM");
|
||||
|
||||
//해당기간내의 마감 자료를 조회해서 넣는다.
|
||||
var cn = getCn();
|
||||
cn.Open();
|
||||
|
||||
var retval = new List<string>();
|
||||
|
||||
string sql = "select pdate" +
|
||||
" from EETGW_Magam " +
|
||||
" where gcode=@gcode and pdate between @sdate and @edate and isnull(pdate,'') <> ''";
|
||||
|
||||
var cmd = new SqlCommand(sql, cn);
|
||||
cmd.Parameters.Add("gcode", System.Data.SqlDbType.VarChar).Value = gcode;
|
||||
cmd.Parameters.Add("sdate", System.Data.SqlDbType.VarChar).Value = sdate;
|
||||
cmd.Parameters.Add("edate", System.Data.SqlDbType.VarChar).Value = edate;
|
||||
|
||||
var rdr = cmd.ExecuteReader();
|
||||
while (rdr.Read())
|
||||
{
|
||||
retval.Add(rdr[0].ToString());
|
||||
}
|
||||
|
||||
cn.Close();
|
||||
cn.Dispose();
|
||||
return retval;
|
||||
|
||||
}
|
||||
|
||||
public static bool GetMagamStatus(DateTime mon)
|
||||
{
|
||||
return GetMagamStatus(mon.ToString("yyyy-MM"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 머감상태를 확인합니다.
|
||||
/// </summary>
|
||||
/// <param name="mon">yyyy-MM</param>
|
||||
/// <returns></returns>
|
||||
public static bool GetMagamStatus(string mon)
|
||||
{
|
||||
var gcode = FCOMMON.info.Login.gcode;
|
||||
var sdate = mon;// DateTime.Now.AddMonths(-6).ToString("yyyy-MM");
|
||||
//var edate = DateTime.Now.AddMonths(1).ToString("yyyy-MM");
|
||||
|
||||
//해당기간내의 마감 자료를 조회해서 넣는다.
|
||||
var cn = getCn();
|
||||
cn.Open();
|
||||
|
||||
var retval = new List<string>();
|
||||
|
||||
string sql = "select count(*)" +
|
||||
" from EETGW_Magam " +
|
||||
" where gcode=@gcode and pdate = @sdate";
|
||||
|
||||
var cmd = new SqlCommand(sql, cn);
|
||||
cmd.Parameters.Add("gcode", System.Data.SqlDbType.VarChar).Value = gcode;
|
||||
cmd.Parameters.Add("sdate", System.Data.SqlDbType.VarChar).Value = sdate;
|
||||
|
||||
var cnt = int.Parse(cmd.ExecuteScalar().ToString());
|
||||
|
||||
|
||||
cn.Close();
|
||||
cn.Dispose();
|
||||
return cnt > 0;
|
||||
|
||||
}
|
||||
|
||||
public static sItemInfo getLastPurchaseInfo(int idx)
|
||||
{
|
||||
|
||||
@@ -119,6 +119,12 @@
|
||||
<Compile Include="fLovDateList.Designer.cs">
|
||||
<DependentUpon>fLovDateList.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="fMagam.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="fMagam.Designer.cs">
|
||||
<DependentUpon>fMagam.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="fProgress.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -169,6 +175,9 @@
|
||||
<EmbeddedResource Include="fLovDateList.resx">
|
||||
<DependentUpon>fLovDateList.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="fMagam.resx">
|
||||
<DependentUpon>fMagam.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="fProgress.resx">
|
||||
<DependentUpon>fProgress.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
||||
173
SubProject/FCOMMON/fMagam.Designer.cs
generated
Normal file
173
SubProject/FCOMMON/fMagam.Designer.cs
generated
Normal file
@@ -0,0 +1,173 @@
|
||||
|
||||
namespace FCOMMON
|
||||
{
|
||||
partial class fMagam
|
||||
{
|
||||
/// <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.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem(new string[] {
|
||||
"1982-11",
|
||||
"O"}, -1);
|
||||
System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem(new string[] {
|
||||
"1982-11",
|
||||
"X"}, -1);
|
||||
System.Windows.Forms.ListViewItem listViewItem3 = new System.Windows.Forms.ListViewItem(new string[] {
|
||||
"1982-11",
|
||||
"X"}, -1);
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.listView1 = new System.Windows.Forms.ListView();
|
||||
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.panel1.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.button1.Font = new System.Drawing.Font("굴림", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.button1.Location = new System.Drawing.Point(10, 10);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(392, 61);
|
||||
this.button1.TabIndex = 2;
|
||||
this.button1.Text = "선택 마감 삭제";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// listView1
|
||||
//
|
||||
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||
this.columnHeader1,
|
||||
this.columnHeader2});
|
||||
this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.listView1.Font = new System.Drawing.Font("굴림", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.listView1.FullRowSelect = true;
|
||||
this.listView1.GridLines = true;
|
||||
this.listView1.HideSelection = false;
|
||||
listViewItem1.StateImageIndex = 0;
|
||||
listViewItem2.StateImageIndex = 0;
|
||||
listViewItem3.StateImageIndex = 0;
|
||||
this.listView1.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
|
||||
listViewItem1,
|
||||
listViewItem2,
|
||||
listViewItem3});
|
||||
this.listView1.Location = new System.Drawing.Point(0, 58);
|
||||
this.listView1.Name = "listView1";
|
||||
this.listView1.Size = new System.Drawing.Size(412, 299);
|
||||
this.listView1.TabIndex = 3;
|
||||
this.listView1.UseCompatibleStateImageBehavior = false;
|
||||
this.listView1.View = System.Windows.Forms.View.Details;
|
||||
//
|
||||
// columnHeader1
|
||||
//
|
||||
this.columnHeader1.Text = "월";
|
||||
this.columnHeader1.Width = 300;
|
||||
//
|
||||
// columnHeader2
|
||||
//
|
||||
this.columnHeader2.Text = "마감";
|
||||
this.columnHeader2.Width = 100;
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.button1);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 357);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Padding = new System.Windows.Forms.Padding(10);
|
||||
this.panel1.Size = new System.Drawing.Size(412, 81);
|
||||
this.panel1.TabIndex = 4;
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.Controls.Add(this.textBox1);
|
||||
this.panel2.Controls.Add(this.button2);
|
||||
this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel2.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Padding = new System.Windows.Forms.Padding(10);
|
||||
this.panel2.Size = new System.Drawing.Size(412, 58);
|
||||
this.panel2.TabIndex = 5;
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.textBox1.Font = new System.Drawing.Font("굴림", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.textBox1.Location = new System.Drawing.Point(10, 10);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(267, 38);
|
||||
this.textBox1.TabIndex = 3;
|
||||
this.textBox1.Text = "1982-11";
|
||||
this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.button2.Font = new System.Drawing.Font("굴림", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.button2.Location = new System.Drawing.Point(277, 10);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(125, 38);
|
||||
this.button2.TabIndex = 2;
|
||||
this.button2.Text = "마감";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.button2.Click += new System.EventHandler(this.button2_Click);
|
||||
//
|
||||
// fMagam
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(412, 438);
|
||||
this.Controls.Add(this.listView1);
|
||||
this.Controls.Add(this.panel2);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "fMagam";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "근태자료 마감";
|
||||
this.Load += new System.EventHandler(this.fMagam_Load);
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.panel2.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.ListView listView1;
|
||||
private System.Windows.Forms.ColumnHeader columnHeader1;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.ColumnHeader columnHeader2;
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.Button button2;
|
||||
}
|
||||
}
|
||||
58
SubProject/FCOMMON/fMagam.cs
Normal file
58
SubProject/FCOMMON/fMagam.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace FCOMMON
|
||||
{
|
||||
public partial class fMagam : Form
|
||||
{
|
||||
public fMagam()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void fMagam_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
int curLevel = Math.Max(FCOMMON.info.Login.level, FCOMMON.DBM.getAuth(FCOMMON.DBM.eAuthType.holyday));
|
||||
|
||||
button2.Enabled = curLevel >= 5;
|
||||
button1.Enabled = curLevel >= 5;
|
||||
|
||||
|
||||
textBox1.Text = DateTime.Now.ToString("yyyy-MM");
|
||||
refreshList();
|
||||
}
|
||||
|
||||
void refreshList()
|
||||
{
|
||||
var lst = FCOMMON.DBM.GetMagamList();
|
||||
this.listView1.Items.Clear();
|
||||
foreach (var item in lst)
|
||||
{
|
||||
var lv = this.listView1.Items.Add(item);
|
||||
lv.SubItems.Add("O");
|
||||
}
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
///마감작업
|
||||
var data = textBox1.Text.Trim();
|
||||
if (FCOMMON.Util.MsgQ($"{data} 월 자료를 마감할까요?") != DialogResult.Yes) return;
|
||||
|
||||
var rlt = FCOMMON.DBM.AddMagamList(data);
|
||||
if (rlt == false)
|
||||
{
|
||||
FCOMMON.Util.MsgE("저장 실패");
|
||||
}
|
||||
refreshList();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
SubProject/FCOMMON/fMagam.resx
Normal file
120
SubProject/FCOMMON/fMagam.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>
|
||||
Reference in New Issue
Block a user