This commit is contained in:
chi
2024-02-14 14:57:50 +09:00
parent 3691bee8a9
commit 0546ec2723
6 changed files with 154 additions and 48 deletions

View File

@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호가 자동으로
// 지정되도록 할 수 있습니다.
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("24.02.08.0950")]
[assembly: AssemblyFileVersion("24.02.08.0950")]
[assembly: AssemblyVersion("24.02.14.1450")]
[assembly: AssemblyFileVersion("24.02.14.1450")]

View File

@@ -116,7 +116,7 @@ namespace FEQ0000
var s요청 = dr.IsrequestNameNull() ? "" : dr.requestName;// fpSpread1_Sheet1.Cells[i, col_요청].Value;
var sSID = dr.IssidNull() ? "" : dr.sid;// fpSpread1_Sheet1.Cells[i, col_SID].Value;
var s품명 = dr.IspumnameNull() ? "" : dr.pumname;// fpSpread1_Sheet1.Cells[i, col_품명].Value;
var s규격 = dr.IspumunitNull() ? "" : dr.pumunit;// fpSpread1_Sheet1.Cells[i, col_규격].Value;
var s규격 = dr.IspumunitNull() ? "" : dr.pumscale;// fpSpread1_Sheet1.Cells[i, col_규격].Value;
var qty = dr.IspumqtyNull() ? 0 : dr.pumqty;// fpSpread1_Sheet1.Cells[i, col_수량].Value;
var price = dr.IspumpriceNull() ? 0 : dr.pumprice;// fpSpread1_Sheet1.Cells[i, col_단가].Value;
var amt = dr.IspumamtNull() ? 0 : dr.pumamt;// fpSpread1_Sheet1.Cells[i, col_금액].Value;
@@ -321,7 +321,7 @@ namespace FEQ0000
var s요청 = dr.IsrequestNameNull() ? "" : dr.requestName;// fpSpread1_Sheet1.Cells[i, col_요청].Value;
var sSID = dr.IssidNull() ? "" : dr.sid;// fpSpread1_Sheet1.Cells[i, col_SID].Value;
var s품명 = dr.IspumnameNull() ? "" : dr.pumname;// fpSpread1_Sheet1.Cells[i, col_품명].Value;
var s규격 = dr.IspumunitNull() ? "" : dr.pumunit;// fpSpread1_Sheet1.Cells[i, col_규격].Value;
var s규격 = dr.IspumunitNull() ? "" : dr.pumscale;// fpSpread1_Sheet1.Cells[i, col_규격].Value;
var qty = dr.IspumqtyNull() ? 0 : dr.pumqty;// fpSpread1_Sheet1.Cells[i, col_수량].Value;
var price = dr.IspumpriceNull() ? 0 : dr.pumprice;// fpSpread1_Sheet1.Cells[i, col_단가].Value;
var amt = dr.IspumamtNull() ? 0 : dr.pumamt;// fpSpread1_Sheet1.Cells[i, col_금액].Value;
@@ -519,7 +519,7 @@ namespace FEQ0000
var s요청 = dr.IsrequestNameNull() ? "" : dr.requestName;// fpSpread1_Sheet1.Cells[i, col_요청].Value;
var sSID = dr.IssidNull() ? "" : dr.sid;// fpSpread1_Sheet1.Cells[i, col_SID].Value;
var s품명 = dr.IspumnameNull() ? "" : dr.pumname;// fpSpread1_Sheet1.Cells[i, col_품명].Value;
var s규격 = dr.IspumunitNull() ? "" : dr.pumunit;// fpSpread1_Sheet1.Cells[i, col_규격].Value;
var s규격 = dr.IspumunitNull() ? "" : dr.pumscale;// fpSpread1_Sheet1.Cells[i, col_규격].Value;
var qty = dr.IspumqtyNull() ? 0 : dr.pumqty;// fpSpread1_Sheet1.Cells[i, col_수량].Value;
var price = dr.IspumpriceNull() ? 0 : dr.pumprice;// fpSpread1_Sheet1.Cells[i, col_단가].Value;
var amt = dr.IspumamtNull() ? 0 : dr.pumamt;// fpSpread1_Sheet1.Cells[i, col_금액].Value;

View File

@@ -998,6 +998,9 @@ namespace FEQ0000
newdr.pdate = DateTime.Now.ToShortDateString();
newdr.wdate = DateTime.Now;
newdr.wuid = FCOMMON.info.Login.no;
newdr.bigo = string.Empty;
newdr.bigo2 = string.Empty;
newdr.chkremark = string.Empty;
newdr.state = "---";
newdr.request = FCOMMON.info.Login.no;
newdr.receive = "";// FCOMMON.info.Login.nameK;

View File

@@ -778,7 +778,7 @@ namespace FEQ0000
newdr.bigo = string.Empty;
newdr.bigo2 = string.Empty;
newdr.chkremark = string.Empty;
newdr.request = FCOMMON.info.Login.no;
newdr.receive = "";// FCOMMON.info.Login.nameK;
newdr.sc = string.Empty;

View File

@@ -30,11 +30,11 @@
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(fPurchaseEB_ConfRequest));
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
this.dsPurchase = new FEQ0000.dsPurchase();
this.bs = new System.Windows.Forms.BindingSource(this.components);
this.tam = new FEQ0000.dsPurchaseTableAdapters.TableAdapterManager();
@@ -57,6 +57,8 @@
this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();
this.tbFind = new System.Windows.Forms.ToolStripTextBox();
this.btFind = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
@@ -76,8 +78,6 @@
this.bigoDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.supplyDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.bigo2DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
((System.ComponentModel.ISupportInitialize)(this.dsPurchase)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bs)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bn)).BeginInit();
@@ -287,6 +287,20 @@
this.btFind.Text = "toolStripButton2";
this.btFind.Click += new System.EventHandler(this.btFind_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(6, 31);
//
// toolStripButton2
//
this.toolStripButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton2.Image")));
this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton2.Name = "toolStripButton2";
this.toolStripButton2.Size = new System.Drawing.Size(163, 28);
this.toolStripButton2.Text = "구매수량 일괄 업데이트";
this.toolStripButton2.Click += new System.EventHandler(this.toolStripButton2_Click_1);
//
// toolStrip1
//
this.toolStrip1.ImageScalingSize = new System.Drawing.Size(30, 30);
@@ -315,14 +329,14 @@
this.supplyDataGridViewTextBoxColumn,
this.bigo2DataGridViewTextBoxColumn});
this.dataGridView1.DataSource = this.bs;
dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle10.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle10.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
dataGridViewCellStyle10.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle10.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle10.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dataGridView1.DefaultCellStyle = dataGridViewCellStyle10;
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle5.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dataGridView1.DefaultCellStyle = dataGridViewCellStyle5;
this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataGridView1.Location = new System.Drawing.Point(0, 25);
this.dataGridView1.Name = "dataGridView1";
@@ -410,16 +424,16 @@
// pumnameDataGridViewTextBoxColumn
//
this.pumnameDataGridViewTextBoxColumn.DataPropertyName = "pumname";
dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
this.pumnameDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle6;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
this.pumnameDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle1;
this.pumnameDataGridViewTextBoxColumn.HeaderText = "품목";
this.pumnameDataGridViewTextBoxColumn.Name = "pumnameDataGridViewTextBoxColumn";
//
// pumscaleDataGridViewTextBoxColumn
//
this.pumscaleDataGridViewTextBoxColumn.DataPropertyName = "pumscale";
dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
this.pumscaleDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle7;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
this.pumscaleDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle2;
this.pumscaleDataGridViewTextBoxColumn.HeaderText = "규격";
this.pumscaleDataGridViewTextBoxColumn.Name = "pumscaleDataGridViewTextBoxColumn";
//
@@ -450,16 +464,16 @@
// bigoDataGridViewTextBoxColumn
//
this.bigoDataGridViewTextBoxColumn.DataPropertyName = "bigo";
dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
this.bigoDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle8;
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
this.bigoDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle3;
this.bigoDataGridViewTextBoxColumn.HeaderText = "용도";
this.bigoDataGridViewTextBoxColumn.Name = "bigoDataGridViewTextBoxColumn";
//
// supplyDataGridViewTextBoxColumn
//
this.supplyDataGridViewTextBoxColumn.DataPropertyName = "supply";
dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
this.supplyDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle9;
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
this.supplyDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle4;
this.supplyDataGridViewTextBoxColumn.HeaderText = "업체명";
this.supplyDataGridViewTextBoxColumn.Name = "supplyDataGridViewTextBoxColumn";
//
@@ -469,20 +483,6 @@
this.bigo2DataGridViewTextBoxColumn.HeaderText = "구매담당비고";
this.bigo2DataGridViewTextBoxColumn.Name = "bigo2DataGridViewTextBoxColumn";
//
// toolStripButton2
//
this.toolStripButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton2.Image")));
this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton2.Name = "toolStripButton2";
this.toolStripButton2.Size = new System.Drawing.Size(163, 28);
this.toolStripButton2.Text = "구매수량 일괄 업데이트";
this.toolStripButton2.Click += new System.EventHandler(this.toolStripButton2_Click_1);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(6, 31);
//
// fPurchaseEB_ConfRequest
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
@@ -540,6 +540,8 @@
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private dsPurchaseTableAdapters.EETGW_PurchaseEBTableAdapter ta;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripButton toolStripButton2;
private System.Windows.Forms.DataGridViewTextBoxColumn sidDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn requestNameDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn pumnameDataGridViewTextBoxColumn;
@@ -551,7 +553,5 @@
private System.Windows.Forms.DataGridViewTextBoxColumn bigoDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn supplyDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn bigo2DataGridViewTextBoxColumn;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripButton toolStripButton2;
}
}

View File

@@ -20,6 +20,7 @@ using FarPoint.Win.Spread.CellType;
using FCM0000;
using GrapeCity.Win.Spread.InputMan.CellType;
using NetOffice.OutlookApi;
using System.Data.SqlClient;
namespace FEQ0000
{
@@ -829,7 +830,7 @@ namespace FEQ0000
newdr.bigo = string.Empty;
newdr.bigo2 = string.Empty;
newdr.purchase_manager = string.Empty;
newdr.chkremark = string.Empty;
newdr.request = FCOMMON.info.Login.no;
newdr.receive = "";// FCOMMON.info.Login.nameK;
newdr.sc = string.Empty;
@@ -1488,8 +1489,110 @@ namespace FEQ0000
var dlg = FCOMMON.Util.MsgQ("구매내역에서 품목정보를 생성합니다, 중복되는 sid는 업데이트 되지 않습니다\n" +
"완료메시지 나올떄까지 기다려주세요");
if (dlg != DialogResult.Yes) return;
ta.PurchaseDataToItemsNR(FCOMMON.info.Login.gcode);
FCOMMON.Util.MsgI("업데이트 완료");
//ta.PurchaseDataToItemsNR(FCOMMON.info.Login.gcode);
//connect to db
var cn = DBM.getCn();
cn.Open();
var cn2 = DBM.getCn();
cn2.Open();
var purchasetable = "Purchase";
var sql1 = $"select pumname as name,[sid],pumscale as model,pumunit as unit, supply, supplyidx, pumprice as price from {purchasetable} WITH(NOLOCK) where gcode = @gcode and len(sid) = 9 and isnull(UpdateToItem,0) = 0 order by wdate";
var sql2 = $"select count(*) from items WITH(NOLOCK) where gcode = @gcode and sid = @sid";
var sqlI = $"insert into items(gcode, [name],[sid],model,manu,scale,unit,supply,supplyidx,price,memo,wuid,wdate,import,disable) " +
$"values(@gcode,@name,@sid,@model,'',1,'',@supply,@supplyidx,@price,'','{FCOMMON.info.Login.no}',GETDATE(),1,0)";
var cmd = new System.Data.SqlClient.SqlCommand(sql1, cn);
var cmd2 = new System.Data.SqlClient.SqlCommand(sql2, cn2);
var cmdI = new System.Data.SqlClient.SqlCommand(sqlI, cn2);
var cmdU = new System.Data.SqlClient.SqlCommand("", cn2);
cmd.Parameters.Add("gcode", SqlDbType.VarChar).Value = FCOMMON.info.Login.gcode;
cmd2.Parameters.Add("gcode", SqlDbType.VarChar).Value = FCOMMON.info.Login.gcode;
cmd2.Parameters.Add("sid", SqlDbType.VarChar).Value = "";
cmdI.Parameters.Add("gcode", SqlDbType.VarChar).Value = FCOMMON.info.Login.gcode;
cmdI.Parameters.Add("name", SqlDbType.VarChar);
cmdI.Parameters.Add("sid", SqlDbType.VarChar);
cmdI.Parameters.Add("model", SqlDbType.VarChar);
cmdI.Parameters.Add("supply", SqlDbType.VarChar);
cmdI.Parameters.Add("supplyidx", SqlDbType.Int);
cmdI.Parameters.Add("price", SqlDbType.Decimal);
var dar = cmd.ExecuteReader();
var cntI = 0;
var cntU = 0;
var cnt = 0;
while (dar.Read())
{
var data = new
{
name = dar[0],
sid = dar[1].ToString(),
model = dar[2],
unit = dar[3],
supply = dar[4],
supplyidx = dar[5],
price = dar[6],
};
cmd2.Parameters["sid"].Value = data.sid;
var datacnt = (int)cmd2.ExecuteScalar();
var sql = "";
if (datacnt > 0)
{
//있으면 업데이트
if (data.price != null)
{
var price = (decimal)data.price;
sql = $"update items set price = {price}";
sql += $" where gcode='{FCOMMON.info.Login.gcode}' and sid='{data.sid}' and isnull(price,0) < {price}";
cmdU.CommandText = sql;
cntU += cmdU.ExecuteNonQuery();
}
Console.WriteLine($"{cnt}:update sid:{data.sid},price={data.price},totalupdate:{cntU}");
}
else
{
//없으면추가
cmdI.Parameters["name"].Value = data.name;
cmdI.Parameters["sid"].Value = data.sid;
cmdI.Parameters["model"].Value = data.model;
cmdI.Parameters["supply"].Value = data.supply;
cmdI.Parameters["supplyidx"].Value = data.supplyidx;
cmdI.Parameters["price"].Value = data.price;
cntI += cmdI.ExecuteNonQuery();
Console.WriteLine($"{cnt}:uinsert sid:{data.sid},price={data.price},totalupdate:{cntI}");
}
sql = $"update {purchasetable} set UpdateToItem = 1 where gcode = '{FCOMMON.info.Login.gcode}' and sid = '{data.sid}' and isnull(UpdateToItem,0) = 0";
cmdU.CommandText = sql;
cmdU.ExecuteNonQuery();
cnt += 1;
//if ((cnt) % 10 == 0)
{
this.Text = $"품목업데이트 수량(I:{cntI}/U:{cntU})";
}
System.Windows.Forms.Application.DoEvents();
System.Threading.Thread.Sleep(500);
}
//close db
cn.Close();
cn.Dispose();
cn2.Close();
cn2.Dispose();
FCOMMON.Util.MsgI($"업데이트 완료(I:{cntI}/U:{cntU})");
}
private void fpSpread1_CellClick(object sender, FarPoint.Win.Spread.CellClickEventArgs e)