This commit is contained in:
chi
2024-11-13 17:21:49 +09:00
parent a1cb35070e
commit e6f2ce845f
12 changed files with 324 additions and 264 deletions

View File

@@ -121,6 +121,7 @@
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator();
this.exportDataToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem8 = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -562,6 +563,7 @@
this.toolStripMenuItem3,
this.exportDataToolStripMenuItem,
this.toolStripMenuItem4,
this.toolStripMenuItem8,
this.ToolStripMenuItem,
this.toolStripMenuItem2,
this.ToolStripMenuItem,
@@ -574,7 +576,7 @@
this.toolStripMenuItem5,
this.SAP구매정보생성ToolStripMenuItem});
this.cm1.Name = "contextMenuStrip1";
this.cm1.Size = new System.Drawing.Size(449, 454);
this.cm1.Size = new System.Drawing.Size(449, 496);
//
// columnSizeToolStripMenuItem
//
@@ -636,6 +638,13 @@
this.toolStripMenuItem4.Name = "toolStripMenuItem4";
this.toolStripMenuItem4.Size = new System.Drawing.Size(445, 6);
//
// toolStripMenuItem8
//
this.toolStripMenuItem8.Name = "toolStripMenuItem8";
this.toolStripMenuItem8.Size = new System.Drawing.Size(448, 42);
this.toolStripMenuItem8.Text = "상태 일괄 변경";
this.toolStripMenuItem8.Click += new System.EventHandler(this.toolStripMenuItem8_Click);
//
// 입고ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "입고ToolStripMenuItem";
@@ -1177,6 +1186,8 @@
this.fpSpread1_Sheet1.Columns.Get(16).Tag = "pumunit";
this.fpSpread1_Sheet1.Columns.Get(16).Width = 51F;
numberCellType4.DecimalPlaces = 2;
numberCellType4.Separator = ",";
numberCellType4.ShowSeparator = true;
this.fpSpread1_Sheet1.Columns.Get(17).CellType = numberCellType4;
this.fpSpread1_Sheet1.Columns.Get(17).DataField = "pumpriceD";
this.fpSpread1_Sheet1.Columns.Get(17).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Right;
@@ -1458,6 +1469,7 @@
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem6;
private System.Windows.Forms.ToolStripMenuItem btMakeItemsData;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem8;
private FarPoint.Win.Spread.SheetView fpSpread1_Sheet1;
}
}

View File

@@ -112,7 +112,7 @@ namespace FEQ0000
this.dtED.Text = DateTime.Now.AddDays(10).ToShortDateString();
var gcode = FCOMMON.info.Login.gcode;
var sdatestr = FCOMMON.DBM.ExecuteScalar($"select min(pdate) from EETGW_PurchaseCR where gcode='{gcode}' and [state] in ('---','PO','PR')");
var sdatestr = FCOMMON.DBM.ExecuteScalar($"select min(pdate) from EETGW_PurchaseCR with(nolock) where gcode='{gcode}' and [state] in ('---','PO','PR')");
if (DateTime.TryParse(sdatestr, out DateTime sdate))
dtSD.Text = sdate.ToShortDateString();
@@ -142,12 +142,14 @@ namespace FEQ0000
{
btSave.Visible = true;
ToolStripMenuItem.Visible = true;
toolStripMenuItem8.Visible = true;
//fpSpread1.ActiveSheet.OperationMode = FarPoint.Win.Spread.OperationMode.Normal;
//fpSpread1.ActiveSheet.SelectionUnit = FarPoint.Win.Spread.Model.SelectionUnit.Cell;
//fpSpread1.ActiveSheet.OperationMode = FarPoint.Win.Spread.OperationMode.MultiSelect;
}
else
{
toolStripMenuItem8.Visible = false;
btMakeItemsData.Visible = false;
ToolStripMenuItem.Visible = false;
btSave.Visible = false;
@@ -198,7 +200,7 @@ namespace FEQ0000
System.Data.SqlClient.SqlDataAdapter da = new System.Data.SqlClient.SqlDataAdapter();
System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand();
cmd.CommandText = " select *,dbo.getusername(request) as requestName,dbo.getusername(receive) as receiveName" +
" from EETGW_PurchaseCR " +
" from EETGW_PurchaseCR with(nolock) " +
" where gcode='" + FCOMMON.info.Login.gcode + "' and isnull(" + dateField + ",'') between @sd and @ed ";
@@ -1529,5 +1531,42 @@ namespace FEQ0000
}
}
}
private void toolStripMenuItem8_Click(object sender, EventArgs e)
{
var selected = this.fpSpread1_Sheet1.GetSelections(); //선택된 개체확인
List<int> rows = new List<int>();
foreach (var item in selected)
{
for (int i = item.Row; i < item.Row + item.RowCount; i++)
{
if (rows.Contains(i) == false)
{
if (fpSpread1_Sheet1.IsRowBound(i))
{
rows.Add(i);
}
}
}
}
//이대상의 실제 데이터베이스 인덱스값을 생성해서 폼에 전송한다.
var codlist = DBM.getCodeList("04");
var f = new FEQ0000.Purchase.fBatchUpdate(rows);
if (f.ShowDialog() != DialogResult.OK) return;
var colstat = fpSpread1_Sheet1.Columns["state"];
var value = f.cmbState.Text;
foreach (var rowindex in rows)
{
fpSpread1_Sheet1.SetValue(rowindex, colstat.Index, value);
}
FCOMMON.Util.MsgI($"{rows.Count} 건의 자료가 변경되었습니다\n저장 버튼을 누르면 적용 됩니다\n취소하려면 새로고침을 누르세요");
}
}
}