공정 항목 추가 (업무일지, 프로젝트)

구매내역에 s/c 정렬 기능 추가
This commit is contained in:
chi
2020-01-06 16:27:21 +09:00
parent d73a2e212a
commit 178c295587
80 changed files with 12686 additions and 9599 deletions

View File

@@ -30,19 +30,19 @@
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(fInventory));
FarPoint.Win.Spread.CellType.TextCellType textCellType11 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType12 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType13 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType14 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType15 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType16 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType17 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.NumberCellType numberCellType4 = new FarPoint.Win.Spread.CellType.NumberCellType();
FarPoint.Win.Spread.CellType.NumberCellType numberCellType5 = new FarPoint.Win.Spread.CellType.NumberCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType18 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType19 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType20 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.NumberCellType numberCellType6 = new FarPoint.Win.Spread.CellType.NumberCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType21 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType22 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType23 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType24 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType25 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType26 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType27 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.NumberCellType numberCellType7 = new FarPoint.Win.Spread.CellType.NumberCellType();
FarPoint.Win.Spread.CellType.NumberCellType numberCellType8 = new FarPoint.Win.Spread.CellType.NumberCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType28 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType29 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType30 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.NumberCellType numberCellType9 = new FarPoint.Win.Spread.CellType.NumberCellType();
this.bn = new System.Windows.Forms.BindingNavigator(this.components);
this.bindingNavigatorCountItem = new System.Windows.Forms.ToolStripLabel();
this.bindingNavigatorMoveFirstItem = new System.Windows.Forms.ToolStripButton();
@@ -68,6 +68,8 @@
this.toolStripLabel4 = new System.Windows.Forms.ToolStripLabel();
this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();
this.dtED = new System.Windows.Forms.ToolStripTextBox();
this.toolStripLabel7 = new System.Windows.Forms.ToolStripLabel();
this.cmbPlace = new System.Windows.Forms.ToolStripComboBox();
this.toolStripLabel6 = new System.Windows.Forms.ToolStripLabel();
this.cmbInvType = new System.Windows.Forms.ToolStripComboBox();
this.toolStripLabel5 = new System.Windows.Forms.ToolStripLabel();
@@ -91,8 +93,9 @@
this.bs = new System.Windows.Forms.BindingSource(this.components);
this.dSInventory = new FCM0000.DSInventory();
this.ta = new FCM0000.DSInventoryTableAdapters.vInventoryTableAdapter();
this.toolStripLabel7 = new System.Windows.Forms.ToolStripLabel();
this.cmbPlace = new System.Windows.Forms.ToolStripComboBox();
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)(this.bn)).BeginInit();
this.bn.SuspendLayout();
this.toolStrip1.SuspendLayout();
@@ -340,6 +343,23 @@
this.dtED.Text = "1982-11-23";
this.dtED.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// toolStripLabel7
//
this.toolStripLabel7.Name = "toolStripLabel7";
this.toolStripLabel7.Size = new System.Drawing.Size(43, 34);
this.toolStripLabel7.Text = "저장소";
//
// cmbPlace
//
this.cmbPlace.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbPlace.Items.AddRange(new object[] {
"전체",
"입고",
"출고",
"정정"});
this.cmbPlace.Name = "cmbPlace";
this.cmbPlace.Size = new System.Drawing.Size(75, 37);
//
// toolStripLabel6
//
this.toolStripLabel6.Name = "toolStripLabel6";
@@ -409,6 +429,9 @@
//
this.cm.Font = new System.Drawing.Font("맑은 고딕", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.cm.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ToolStripMenuItem,
this.ToolStripMenuItem,
this.toolStripMenuItem3,
this.columnSizeToolStripMenuItem,
this.exportListToolStripMenuItem,
this.ToolStripMenuItem,
@@ -418,7 +441,7 @@
this.toolStripMenuItem1,
this.ToolStripMenuItem});
this.cm.Name = "contextMenuStrip1";
this.cm.Size = new System.Drawing.Size(299, 232);
this.cm.Size = new System.Drawing.Size(299, 332);
//
// columnSizeToolStripMenuItem
//
@@ -513,89 +536,89 @@
this.fpSpread1_Sheet1.ColumnHeader.Cells.Get(0, 10).Value = "보관소";
this.fpSpread1_Sheet1.ColumnHeader.Cells.Get(0, 11).Value = "비고";
this.fpSpread1_Sheet1.ColumnHeader.Rows.Get(0).Height = 30F;
this.fpSpread1_Sheet1.Columns.Get(0).CellType = textCellType11;
this.fpSpread1_Sheet1.Columns.Get(0).CellType = textCellType21;
this.fpSpread1_Sheet1.Columns.Get(0).DataField = "pdate";
this.fpSpread1_Sheet1.Columns.Get(0).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(0).Label = "등록일";
this.fpSpread1_Sheet1.Columns.Get(0).VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(0).Width = 62F;
this.fpSpread1_Sheet1.Columns.Get(1).CellType = textCellType12;
this.fpSpread1_Sheet1.Columns.Get(1).CellType = textCellType22;
this.fpSpread1_Sheet1.Columns.Get(1).DataField = "invtype";
this.fpSpread1_Sheet1.Columns.Get(1).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(1).Label = "구분";
this.fpSpread1_Sheet1.Columns.Get(1).VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(2).CellType = textCellType13;
this.fpSpread1_Sheet1.Columns.Get(2).CellType = textCellType23;
this.fpSpread1_Sheet1.Columns.Get(2).DataField = "sid";
this.fpSpread1_Sheet1.Columns.Get(2).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(2).Label = "SID";
this.fpSpread1_Sheet1.Columns.Get(2).VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(2).Width = 92F;
this.fpSpread1_Sheet1.Columns.Get(3).AllowAutoFilter = true;
this.fpSpread1_Sheet1.Columns.Get(3).CellType = textCellType14;
this.fpSpread1_Sheet1.Columns.Get(3).CellType = textCellType24;
this.fpSpread1_Sheet1.Columns.Get(3).DataField = "itemName";
this.fpSpread1_Sheet1.Columns.Get(3).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(3).Label = "품명";
this.fpSpread1_Sheet1.Columns.Get(3).VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(4).CellType = textCellType15;
this.fpSpread1_Sheet1.Columns.Get(4).CellType = textCellType25;
this.fpSpread1_Sheet1.Columns.Get(4).DataField = "itemModel";
this.fpSpread1_Sheet1.Columns.Get(4).Label = "모델명";
this.fpSpread1_Sheet1.Columns.Get(4).Width = 77F;
this.fpSpread1_Sheet1.Columns.Get(5).CellType = textCellType16;
this.fpSpread1_Sheet1.Columns.Get(5).CellType = textCellType26;
this.fpSpread1_Sheet1.Columns.Get(5).DataField = "sid";
this.fpSpread1_Sheet1.Columns.Get(5).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(5).Label = "SID";
this.fpSpread1_Sheet1.Columns.Get(5).VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(5).Width = 77F;
this.fpSpread1_Sheet1.Columns.Get(6).CellType = textCellType17;
this.fpSpread1_Sheet1.Columns.Get(6).CellType = textCellType27;
this.fpSpread1_Sheet1.Columns.Get(6).DataField = "serial";
this.fpSpread1_Sheet1.Columns.Get(6).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(6).Label = "S/N";
this.fpSpread1_Sheet1.Columns.Get(6).VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(6).Width = 83F;
numberCellType4.DecimalPlaces = 0;
numberCellType4.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.Yes;
numberCellType4.MaximumValue = 2147483647D;
numberCellType4.MinimumValue = -2147483648D;
this.fpSpread1_Sheet1.Columns.Get(7).CellType = numberCellType4;
numberCellType7.DecimalPlaces = 0;
numberCellType7.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.Yes;
numberCellType7.MaximumValue = 2147483647D;
numberCellType7.MinimumValue = -2147483648D;
this.fpSpread1_Sheet1.Columns.Get(7).CellType = numberCellType7;
this.fpSpread1_Sheet1.Columns.Get(7).DataField = "dr_qty";
this.fpSpread1_Sheet1.Columns.Get(7).ForeColor = System.Drawing.Color.Blue;
this.fpSpread1_Sheet1.Columns.Get(7).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(7).Label = "수량";
this.fpSpread1_Sheet1.Columns.Get(7).VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(7).Width = 77F;
numberCellType5.DecimalPlaces = 0;
numberCellType5.MaximumValue = 999999999999999D;
numberCellType5.MinimumValue = -999999999999999D;
numberCellType5.NegativeRed = true;
numberCellType5.NullDisplay = "--";
numberCellType5.Separator = ",";
numberCellType5.ShowSeparator = true;
this.fpSpread1_Sheet1.Columns.Get(8).CellType = numberCellType5;
numberCellType8.DecimalPlaces = 0;
numberCellType8.MaximumValue = 999999999999999D;
numberCellType8.MinimumValue = -999999999999999D;
numberCellType8.NegativeRed = true;
numberCellType8.NullDisplay = "--";
numberCellType8.Separator = ",";
numberCellType8.ShowSeparator = true;
this.fpSpread1_Sheet1.Columns.Get(8).CellType = numberCellType8;
this.fpSpread1_Sheet1.Columns.Get(8).DataField = "dr_amt";
this.fpSpread1_Sheet1.Columns.Get(8).ForeColor = System.Drawing.Color.Blue;
this.fpSpread1_Sheet1.Columns.Get(8).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Right;
this.fpSpread1_Sheet1.Columns.Get(8).Label = "금액";
this.fpSpread1_Sheet1.Columns.Get(8).VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(8).Width = 75F;
this.fpSpread1_Sheet1.Columns.Get(9).CellType = textCellType18;
this.fpSpread1_Sheet1.Columns.Get(9).CellType = textCellType28;
this.fpSpread1_Sheet1.Columns.Get(9).DataField = "userName";
this.fpSpread1_Sheet1.Columns.Get(9).Label = "사용자";
this.fpSpread1_Sheet1.Columns.Get(10).CellType = textCellType19;
this.fpSpread1_Sheet1.Columns.Get(10).CellType = textCellType29;
this.fpSpread1_Sheet1.Columns.Get(10).DataField = "place";
this.fpSpread1_Sheet1.Columns.Get(10).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(10).Label = "보관소";
this.fpSpread1_Sheet1.Columns.Get(10).VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(11).CellType = textCellType20;
this.fpSpread1_Sheet1.Columns.Get(11).CellType = textCellType30;
this.fpSpread1_Sheet1.Columns.Get(11).DataField = "memo";
this.fpSpread1_Sheet1.Columns.Get(11).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(11).Label = "비고";
this.fpSpread1_Sheet1.Columns.Get(11).VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(11).Width = 151F;
numberCellType6.DecimalPlaces = 0;
numberCellType6.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.Yes;
numberCellType6.MaximumValue = 2147483647D;
numberCellType6.MinimumValue = -2147483648D;
this.fpSpread1_Sheet1.Columns.Get(12).CellType = numberCellType6;
numberCellType9.DecimalPlaces = 0;
numberCellType9.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.Yes;
numberCellType9.MaximumValue = 2147483647D;
numberCellType9.MinimumValue = -2147483648D;
this.fpSpread1_Sheet1.Columns.Get(12).CellType = numberCellType9;
this.fpSpread1_Sheet1.Columns.Get(12).DataField = "idx";
this.fpSpread1_Sheet1.Columns.Get(12).Visible = false;
this.fpSpread1_Sheet1.DataAutoCellTypes = false;
@@ -620,22 +643,24 @@
//
this.ta.ClearBeforeFill = true;
//
// toolStripLabel7
// toolStripMenuItem3
//
this.toolStripLabel7.Name = "toolStripLabel7";
this.toolStripLabel7.Size = new System.Drawing.Size(43, 34);
this.toolStripLabel7.Text = "저장소";
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(295, 6);
//
// cmbPlace
// 입고등록ToolStripMenuItem
//
this.cmbPlace.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbPlace.Items.AddRange(new object[] {
"전체",
"입고",
"출고",
"정정"});
this.cmbPlace.Name = "cmbPlace";
this.cmbPlace.Size = new System.Drawing.Size(75, 37);
this.ToolStripMenuItem.Name = "입고등록ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(298, 36);
this.ToolStripMenuItem.Text = "입고 등록";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// 출고등록ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "출고등록ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(298, 36);
this.ToolStripMenuItem.Text = "출고 등록";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// fInventory
//
@@ -715,5 +740,8 @@
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripLabel toolStripLabel7;
private System.Windows.Forms.ToolStripComboBox cmbPlace;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3;
}
}

View File

@@ -182,7 +182,7 @@ namespace FCM0000
tbFind.SelectAll();
tbFind.Focus();
}
catch (Exception eX)
catch
{
tbFind.BackColor = Color.Red;
}
@@ -417,5 +417,75 @@ namespace FCM0000
{
FPUtil.printsheet(this.fpSpread1, "재고등록현황");
}
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
//입고
var drv = this.bs.Current as DataRowView;
if (drv == null) return;
var dr = drv.Row as DSInventory.vInventoryRow;
if(dr.item == -1)
{
FCOMMON.Util.MsgE("입력된 품목이 없습니다");
return;
}
var newdr = this.dSInventory.vInventory.NewvInventoryRow();
newdr.pdate = DateTime.Now.ToShortDateString();
newdr.invtype = "입고";
newdr.item = dr.item;
//newdr.ItemArray = dr.ItemArray;
newdr.itemModel = dr.itemModel;
newdr.itemName = dr.itemName;
newdr.place = dr.place;
newdr.sid = dr.sid;
var f = new finventoryAdd(newdr);
if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
this.dSInventory.vInventory.AddvInventoryRow(newdr);
int cnt = this.ta.Update(newdr);
newdr.AcceptChanges();
if (cnt != 1)
FCOMMON.Util.MsgE("자료가 추가되지 않았습니다.\n\n잠시 후 다시 시도하세요");
}
else newdr.Delete();
}
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
//출고
var drv = this.bs.Current as DataRowView;
if (drv == null) return;
var dr = drv.Row as DSInventory.vInventoryRow;
if (dr.item == -1)
{
FCOMMON.Util.MsgE("입력된 품목이 없습니다");
return;
}
var newdr = this.dSInventory.vInventory.NewvInventoryRow();
newdr.pdate = DateTime.Now.ToShortDateString();
newdr.invtype = "출고";
newdr.item = dr.item;
//newdr.ItemArray = dr.ItemArray;
newdr.sid = dr.sid;
newdr.itemModel = dr.itemModel;
newdr.itemName = dr.itemName;
newdr.place = dr.place;
var f = new finventoryAdd(newdr);
if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
this.dSInventory.vInventory.AddvInventoryRow(newdr);
int cnt = this.ta.Update(newdr);
newdr.AcceptChanges();
if (cnt != 1)
FCOMMON.Util.MsgE("자료가 추가되지 않았습니다.\n\n잠시 후 다시 시도하세요");
}
else newdr.Delete();
}
}
}

View File

@@ -30,7 +30,7 @@
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(fInventoryJagoList));
FarPoint.Win.Spread.CellType.TextCellType textCellType6 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType7 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType1 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType2 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType3 = new FarPoint.Win.Spread.CellType.TextCellType();
@@ -39,6 +39,7 @@
FarPoint.Win.Spread.CellType.NumberCellType numberCellType2 = new FarPoint.Win.Spread.CellType.NumberCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType5 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.NumberCellType numberCellType3 = new FarPoint.Win.Spread.CellType.NumberCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType6 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.NoPrinterPrintInfo noPrinterPrintInfo1 = new FarPoint.Win.Spread.NoPrinterPrintInfo();
this.bn = new System.Windows.Forms.BindingNavigator(this.components);
this.bindingNavigatorCountItem = new System.Windows.Forms.ToolStripLabel();
@@ -57,31 +58,33 @@
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
this.dtSD = new System.Windows.Forms.ToolStripTextBox();
this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();
this.cmbPlace = new System.Windows.Forms.ToolStripComboBox();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.btSearch = new System.Windows.Forms.ToolStripButton();
this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
this.fpSpread1 = new FarPoint.Win.Spread.FpSpread();
this.cm = new System.Windows.Forms.ContextMenuStrip(this.components);
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator();
this.columnSizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.loadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator();
this.fpSpread1_Sheet1 = new FarPoint.Win.Spread.SheetView();
this.bs = new System.Windows.Forms.BindingSource(this.components);
this.dSReport = new FCM0000.DSReport();
this.ta = new FCM0000.DSReportTableAdapters.jagosummaryPlaceTableAdapter();
this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();
this.cmbPlace = new System.Windows.Forms.ToolStripComboBox();
this.fpSpread1_Sheet1 = new FarPoint.Win.Spread.SheetView();
((System.ComponentModel.ISupportInitialize)(this.bn)).BeginInit();
this.bn.SuspendLayout();
this.toolStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.fpSpread1)).BeginInit();
this.cm.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.fpSpread1_Sheet1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bs)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dSReport)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.fpSpread1_Sheet1)).BeginInit();
this.SuspendLayout();
//
// bn
@@ -248,6 +251,18 @@
this.dtSD.Text = "1982-11-23";
this.dtSD.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// toolStripLabel2
//
this.toolStripLabel2.Name = "toolStripLabel2";
this.toolStripLabel2.Size = new System.Drawing.Size(43, 34);
this.toolStripLabel2.Text = "보관소";
//
// cmbPlace
//
this.cmbPlace.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbPlace.Name = "cmbPlace";
this.cmbPlace.Size = new System.Drawing.Size(120, 37);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
@@ -283,7 +298,7 @@
this.fpSpread1_Sheet1});
this.fpSpread1.Size = new System.Drawing.Size(979, 517);
this.fpSpread1.TabIndex = 3;
this.fpSpread1.TitleInfo.CellType = textCellType6;
this.fpSpread1.TitleInfo.CellType = textCellType7;
this.fpSpread1.TitleInfo.Font = new System.Drawing.Font("맑은 고딕", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.fpSpread1.TitleInfo.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.fpSpread1.TitleInfo.Text = "재고 현황";
@@ -294,12 +309,33 @@
//
this.cm.Font = new System.Drawing.Font("맑은 고딕", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.cm.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ToolStripMenuItem,
this.ToolStripMenuItem,
this.toolStripMenuItem2,
this.columnSizeToolStripMenuItem,
this.exportListToolStripMenuItem,
this.ToolStripMenuItem,
this.toolStripMenuItem2});
this.ToolStripMenuItem});
this.cm.Name = "contextMenuStrip1";
this.cm.Size = new System.Drawing.Size(243, 118);
this.cm.Size = new System.Drawing.Size(243, 190);
//
// 입고등록ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "입고등록ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(242, 36);
this.ToolStripMenuItem.Text = "입고 등록";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// 출고등록ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "출고등록ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(242, 36);
this.ToolStripMenuItem.Text = "출고 등록";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(239, 6);
//
// columnSizeToolStripMenuItem
//
@@ -340,10 +376,19 @@
this.ToolStripMenuItem.Text = "인쇄";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// toolStripMenuItem2
// bs
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(239, 6);
this.bs.DataMember = "jagosummaryPlace";
this.bs.DataSource = this.dSReport;
//
// dSReport
//
this.dSReport.DataSetName = "DSReport";
this.dSReport.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
//
// ta
//
this.ta.ClearBeforeFill = true;
//
// fpSpread1_Sheet1
//
@@ -351,7 +396,7 @@
this.fpSpread1_Sheet1.SheetName = "Sheet1";
// Formulas and custom names must be loaded with R1C1 reference style
this.fpSpread1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.R1C1;
this.fpSpread1_Sheet1.ColumnCount = 8;
this.fpSpread1_Sheet1.ColumnCount = 9;
this.fpSpread1_Sheet1.ActiveColumnIndex = -1;
this.fpSpread1_Sheet1.ActiveRowIndex = -1;
this.fpSpread1_Sheet1.AutoGenerateColumns = false;
@@ -422,6 +467,8 @@
this.fpSpread1_Sheet1.Columns.Get(7).CellType = numberCellType3;
this.fpSpread1_Sheet1.Columns.Get(7).DataField = "idx";
this.fpSpread1_Sheet1.Columns.Get(7).Visible = false;
this.fpSpread1_Sheet1.Columns.Get(8).CellType = textCellType6;
this.fpSpread1_Sheet1.Columns.Get(8).DataField = "item";
this.fpSpread1_Sheet1.DataAutoCellTypes = false;
this.fpSpread1_Sheet1.DataAutoSizeColumns = false;
this.fpSpread1_Sheet1.DataSource = this.bs;
@@ -453,32 +500,6 @@
this.fpSpread1_Sheet1.TitleInfo.Value = "재고현황";
this.fpSpread1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.A1;
//
// bs
//
this.bs.DataMember = "jagosummaryPlace";
this.bs.DataSource = this.dSReport;
//
// dSReport
//
this.dSReport.DataSetName = "DSReport";
this.dSReport.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
//
// ta
//
this.ta.ClearBeforeFill = true;
//
// toolStripLabel2
//
this.toolStripLabel2.Name = "toolStripLabel2";
this.toolStripLabel2.Size = new System.Drawing.Size(43, 34);
this.toolStripLabel2.Text = "보관소";
//
// cmbPlace
//
this.cmbPlace.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbPlace.Name = "cmbPlace";
this.cmbPlace.Size = new System.Drawing.Size(120, 37);
//
// fInventoryJagoList
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
@@ -497,9 +518,9 @@
this.toolStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.fpSpread1)).EndInit();
this.cm.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.fpSpread1_Sheet1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bs)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dSReport)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.fpSpread1_Sheet1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@@ -537,9 +558,11 @@
private System.Windows.Forms.ToolStripButton toolStripButton2;
private DSReport dSReport;
private DSReportTableAdapters.jagosummaryPlaceTableAdapter ta;
private FarPoint.Win.Spread.SheetView fpSpread1_Sheet1;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripLabel toolStripLabel2;
private System.Windows.Forms.ToolStripComboBox cmbPlace;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private FarPoint.Win.Spread.SheetView fpSpread1_Sheet1;
}
}

View File

@@ -214,5 +214,93 @@ namespace FCM0000
{
FPUtil.printsheet(this.fpSpread1, "재고현황");
}
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
//입고
var drv = this.bs.Current as DataRowView;
if (drv == null) return;
var dr = drv.Row as DSReport.jagosummaryPlaceRow;
var taInventory = new DSInventoryTableAdapters.vInventoryTableAdapter();
var vinventory = new DSInventory.vInventoryDataTable();
var newdr = vinventory.NewvInventoryRow();
newdr.item = dr.item;
newdr.invtype = "입고";
newdr.itemModel = dr.model;
newdr.itemName = dr.name;
newdr.place = dr.place;
newdr.sid = dr.sid;
newdr.gcode = FCOMMON.info.Login.gcode;
newdr.wuid = FCOMMON.info.Login.no;
newdr.uid = FCOMMON.info.Login.no;
newdr.wdate = DateTime.Now;
newdr.pdate = DateTime.Now.ToShortDateString();
newdr.cr_qty = 0;
newdr.cr_amt = 0;
newdr.dr_qty = 0;
newdr.dr_amt = 0;
//newdr.item = -1;
var f = new finventoryAdd(newdr);
if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
vinventory.AddvInventoryRow(newdr);
int cnt = taInventory.Update(newdr);
newdr.AcceptChanges();
if (cnt != 1)
FCOMMON.Util.MsgE("자료가 추가되지 않았습니다.\n\n잠시 후 다시 시도하세요");
}
else newdr.Delete();
this.RefreshData();
}
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
//입고
var drv = this.bs.Current as DataRowView;
if (drv == null) return;
var dr = drv.Row as DSReport.jagosummaryPlaceRow;
var taInventory = new DSInventoryTableAdapters.vInventoryTableAdapter();
var vinventory = new DSInventory.vInventoryDataTable();
var newdr = vinventory.NewvInventoryRow();
newdr.item = dr.item;
newdr.invtype = "출고";
newdr.itemModel = dr.model;
newdr.itemName = dr.name;
newdr.place = dr.place;
newdr.sid = dr.sid;
newdr.gcode = FCOMMON.info.Login.gcode;
newdr.wuid = FCOMMON.info.Login.no;
newdr.uid = FCOMMON.info.Login.no;
newdr.wdate = DateTime.Now;
newdr.pdate = DateTime.Now.ToShortDateString();
newdr.cr_qty = 0;
newdr.cr_amt = 0;
newdr.dr_qty = 0;
newdr.dr_amt = 0;
// newdr.item = -1;
var f = new finventoryAdd(newdr);
if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
vinventory.AddvInventoryRow(newdr);
int cnt = taInventory.Update(newdr);
newdr.AcceptChanges();
if (cnt != 1)
FCOMMON.Util.MsgE("자료가 추가되지 않았습니다.\n\n잠시 후 다시 시도하세요");
}
else newdr.Delete();
this.RefreshData();
}
}
}

View File

@@ -1,326 +1,326 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace FCM0000
{
public partial class fInventoryUser : Form
{
public fInventoryUser()
{
InitializeComponent();
this.FormClosed += __Closed;
this.dsMSSQL.InventoryUser.TableNewRow += Inventory_TableNewRow;
var invtypeList = new FCOMMON.keyValuedataTable();
invtypeList.Add("I1", "입고");
invtypeList.Add("I2", "입고(대여)");
invtypeList.Add("O1", "출고");
invtypeList.Add("O2", "출고(대여)");
invtypeList.Add("ET", "기타");
dvc_iffnvtype.DataSource = invtypeList.DataTable;
dvc_iffnvtype.ValueMember = "key";
dvc_iffnvtype.DisplayMember = "Value";
this.dtSD.KeyDown += dtSD_KeyDown;
this.dtED.KeyDown += dtSD_KeyDown;
}
void dtSD_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
ToolStripTextBox tb = sender as ToolStripTextBox;
var vale = tb.Text.Trim();
var datestring = string.Empty;
if (FCOMMON.Util.MakeDateString(vale, out datestring))
{
tb.Text = datestring;
if (e.KeyCode == Keys.Enter)
SendKeys.Send("{TAB}");
}
else
{
FCOMMON.Util.MsgE("날짜형식으로 입력하세요.\n\n18-01-01");
tb.SelectAll();
tb.Focus();
}
}
}
void __Closed(object sender, FormClosedEventArgs e)
{
var form = this as Form;
FCOMMON.Util.SetFormStatus(ref form, this.Name, false);
}
private void __Load(object sender, EventArgs e)
{
// TODO: 이 코드는 데이터를 'dsMSSQL.InventoryUser' 테이블에 로드합니다. 필요한 경우 이 코드를 이동하거나 제거할 수 있습니다.
var form = this as Form;
FCOMMON.Util.SetFormStatus(ref form, this.Name, true);
this.Show();
Application.DoEvents();
//사용자이름 181030
this.tbName.Text = FCOMMON.info.Login.nameK;
//마지막 자료를 가져온날을 찾는다.
var dateList = FCOMMON.DBM.getDateList("InventoryUser", "uid='" + FCOMMON.info.Login.no + "'");
dtED.Text = DateTime.Now.ToShortDateString();
if (dateList.Count > 0) dtSD.Text = dateList[dateList.Count - 1];
else dtSD.Text = DateTime.Now.AddDays(-7).ToShortDateString();
btSearch.PerformClick();
}
private void btSearch_Click(object sender, EventArgs e)
{
try
{
string sd = dtSD.Text;
string ed = dtED.Text;
string name = "%";
if (tbName.Text != "") name = tbName.Text.Trim();
this.ta.FillByName(this.dsMSSQL.InventoryUser, sd, ed, name);
this.dsMSSQL.InventoryUser.AcceptChanges();
dv1.AutoResizeColumns();
}
catch (Exception ex)
{
FCOMMON.Util.MsgE(ex.Message);
}
}
private void inventoryBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.bs.EndEdit();
var dlg = FCOMMON.Util.MsgQ("변경된 사항을 저장 하시겠습니까?");
if (dlg != System.Windows.Forms.DialogResult.Yes) return;
try
{
this.tam.UpdateAll(this.dsMSSQL);
}
catch (Exception ex)
{
FCOMMON.Util.MsgE(ex.Message);
}
}
void Inventory_TableNewRow(object sender, DataTableNewRowEventArgs e)
{
e.Row["wuid"] = FCOMMON.info.Login.no;
e.Row["uid"] = FCOMMON.info.Login.no;
e.Row["wdate"] = DateTime.Now;
e.Row["pdate"] = DateTime.Now.ToShortDateString();
e.Row["dr_qty"] = 0;
e.Row["dr_amt"] = 0;
e.Row["invtype"] = "I1";
}
private void toolStripTextBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
string inputstr = tbFind.Text.Trim();
if (inputstr == "")
{
bs.Filter = "";
tbFind.BackColor = Color.White;
}
else
{
string[] collist = new string[] { "projectName", "itemName", "memo", "serial" };
System.Text.StringBuilder filter = new StringBuilder();
foreach (var col in collist)
{
if (filter.Length > 0) filter.Append(" or ");
filter.Append(col + " like '%" + inputstr + "%'");
}
try
{
bs.Filter = filter.ToString();
tbFind.BackColor = Color.Lime;
tbFind.SelectAll();
tbFind.Focus();
}
catch (Exception eX)
{
tbFind.BackColor = Color.Red;
}
}
}
}
private void autoColumnsSizeToolStripMenuItem_Click(object sender, EventArgs e)
{
dv1.AutoResizeColumns();
}
private void dv1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex < 0 || e.RowIndex < 0) return;
var col = dv1.Columns[e.ColumnIndex];
switch (col.DataPropertyName)
{
case "itemName":
var valuen = dv1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;
if (valuen != null)
{
string inputtext = valuen.ToString().Trim();
if (inputtext.isEmpty())
{
dv1.Rows[e.RowIndex].Cells["dvc_itemName"].Value = inputtext;
}
else
{
//검색을 실행해서 보여준다.
var SearchDT = taItem.GetSearch("%" + inputtext + "%", FCOMMON.info.Login.gcode);
if (SearchDT == null || SearchDT.Rows.Count < 1)
{
FCOMMON.Util.MsgE("검색 결과가 없습니다.");
return;
}
else
{
//검색된 결과를 표시해서 보여준다.
var f = new fLovItem("%" + inputtext + "%");
if(f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
dv1.Rows[e.RowIndex].Cells["dvc_item"].Value = f.item;
dv1.Rows[e.RowIndex].Cells["dvc_itemName"].Value = f.itemName;
}
}
}
}
break;
case "item":
var value = dv1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;
if (value != null)
{
int idx = (int)value;
if (idx != -1)
{
var item = this.taItem.GetbyIDX(idx);
if (item.Count == 1)
{
//1개만 찾았다면 그것을 사용한다.
var itemnameValue = item[0]["name"];
if (itemnameValue != null)
dv1.Rows[e.RowIndex].Cells["dvc_itemName"].Value = itemnameValue.ToString();
}
else
{
FCOMMON.Util.MsgE("해당 아이템이 존재하지 않습니다.");
dv1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = DBNull.Value;
}
}
}
break;
case "project":
var valuep = dv1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;
if (valuep != null)
{
int idx = (int)valuep;
if (idx != -1)
{
var item = this.taPrj.GetData(idx);
if (item.Count == 1)
{
//1개만 찾았다면 그것을 사용한다.
var itemnameValue = item[0]["name"];
if (itemnameValue != null)
dv1.Rows[e.RowIndex].Cells["dvc_projectName"].Value = itemnameValue.ToString();
}
else
{
FCOMMON.Util.MsgE("해당 프로젝트가 존재하지 않습니다.");
dv1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = DBNull.Value;
}
}
}
break;
case "projectName":
var valuepn = dv1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;
if (valuepn != null)
{
string inputtext = valuepn.ToString().Trim();
if (inputtext.isEmpty())
{
dv1.Rows[e.RowIndex].Cells["dvc_projectname"].Value = inputtext;
}
else
{
//검색을 실행해서 보여준다.
var SearchDT = this.taPrj.GetSearch("%" + inputtext + "%",FCOMMON.info.Login.gcode);
if (SearchDT == null || SearchDT.Rows.Count < 1)
{
FCOMMON.Util.MsgE("검색 결과가 없습니다.");
return;
}
else
{
//검색된 결과를 표시해서 보여준다.
var f = new fLovProject("%" + inputtext + "%");
if(f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
dv1.Rows[e.RowIndex].Cells["dvc_project"].Value = f.Index;
dv1.Rows[e.RowIndex].Cells["dvc_projectname"].Value = f.Title;
}
}
}
}
break;
}
}
private void toolStripLabel1_Click(object sender, EventArgs e)
{
//시작일(inventory 에 uid 가 내것인 데이터)
var dataList = FCOMMON.DBM.getDateList("inventoryUser", "uid='" + FCOMMON.info.Login.no + "'", true);
var f = new FCOMMON.fLovDateList(dataList);
if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
dtSD.Text = f.selectedDate;
}
}
private void toolStripLabel2_Click(object sender, EventArgs e)
{
var dataList = FCOMMON.DBM.getDateList("inventoryUser", "uid='" + FCOMMON.info.Login.no + "'", true);
var f = new FCOMMON.fLovDateList(dataList);
if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
dtED.Text = f.selectedDate;
btSearch.PerformClick();
}
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
var f = new Inventory.RepInvStockUser(this.tbName.Text.Trim());
f.MdiParent = this.MdiParent;
f.Show();
}
private void toolStripLabel3_Click(object sender, EventArgs e)
{
tbFind.Text = string.Empty;
btFind.PerformClick();
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace FCM0000
{
public partial class fInventoryUser : Form
{
public fInventoryUser()
{
InitializeComponent();
this.FormClosed += __Closed;
this.dsMSSQL.InventoryUser.TableNewRow += Inventory_TableNewRow;
var invtypeList = new FCOMMON.keyValuedataTable();
invtypeList.Add("I1", "입고");
invtypeList.Add("I2", "입고(대여)");
invtypeList.Add("O1", "출고");
invtypeList.Add("O2", "출고(대여)");
invtypeList.Add("ET", "기타");
dvc_iffnvtype.DataSource = invtypeList.DataTable;
dvc_iffnvtype.ValueMember = "key";
dvc_iffnvtype.DisplayMember = "Value";
this.dtSD.KeyDown += dtSD_KeyDown;
this.dtED.KeyDown += dtSD_KeyDown;
}
void dtSD_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
ToolStripTextBox tb = sender as ToolStripTextBox;
var vale = tb.Text.Trim();
var datestring = string.Empty;
if (FCOMMON.Util.MakeDateString(vale, out datestring))
{
tb.Text = datestring;
if (e.KeyCode == Keys.Enter)
SendKeys.Send("{TAB}");
}
else
{
FCOMMON.Util.MsgE("날짜형식으로 입력하세요.\n\n18-01-01");
tb.SelectAll();
tb.Focus();
}
}
}
void __Closed(object sender, FormClosedEventArgs e)
{
var form = this as Form;
FCOMMON.Util.SetFormStatus(ref form, this.Name, false);
}
private void __Load(object sender, EventArgs e)
{
// TODO: 이 코드는 데이터를 'dsMSSQL.InventoryUser' 테이블에 로드합니다. 필요한 경우 이 코드를 이동하거나 제거할 수 있습니다.
var form = this as Form;
FCOMMON.Util.SetFormStatus(ref form, this.Name, true);
this.Show();
Application.DoEvents();
//사용자이름 181030
this.tbName.Text = FCOMMON.info.Login.nameK;
//마지막 자료를 가져온날을 찾는다.
var dateList = FCOMMON.DBM.getDateList("InventoryUser", "uid='" + FCOMMON.info.Login.no + "'");
dtED.Text = DateTime.Now.ToShortDateString();
if (dateList.Count > 0) dtSD.Text = dateList[dateList.Count - 1];
else dtSD.Text = DateTime.Now.AddDays(-7).ToShortDateString();
btSearch.PerformClick();
}
private void btSearch_Click(object sender, EventArgs e)
{
try
{
string sd = dtSD.Text;
string ed = dtED.Text;
string name = "%";
if (tbName.Text != "") name = tbName.Text.Trim();
this.ta.FillByName(this.dsMSSQL.InventoryUser, sd, ed, name);
this.dsMSSQL.InventoryUser.AcceptChanges();
dv1.AutoResizeColumns();
}
catch (Exception ex)
{
FCOMMON.Util.MsgE(ex.Message);
}
}
private void inventoryBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.bs.EndEdit();
var dlg = FCOMMON.Util.MsgQ("변경된 사항을 저장 하시겠습니까?");
if (dlg != System.Windows.Forms.DialogResult.Yes) return;
try
{
this.tam.UpdateAll(this.dsMSSQL);
}
catch (Exception ex)
{
FCOMMON.Util.MsgE(ex.Message);
}
}
void Inventory_TableNewRow(object sender, DataTableNewRowEventArgs e)
{
e.Row["wuid"] = FCOMMON.info.Login.no;
e.Row["uid"] = FCOMMON.info.Login.no;
e.Row["wdate"] = DateTime.Now;
e.Row["pdate"] = DateTime.Now.ToShortDateString();
e.Row["dr_qty"] = 0;
e.Row["dr_amt"] = 0;
e.Row["invtype"] = "I1";
}
private void toolStripTextBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
string inputstr = tbFind.Text.Trim();
if (inputstr == "")
{
bs.Filter = "";
tbFind.BackColor = Color.White;
}
else
{
string[] collist = new string[] { "projectName", "itemName", "memo", "serial" };
System.Text.StringBuilder filter = new StringBuilder();
foreach (var col in collist)
{
if (filter.Length > 0) filter.Append(" or ");
filter.Append(col + " like '%" + inputstr + "%'");
}
try
{
bs.Filter = filter.ToString();
tbFind.BackColor = Color.Lime;
tbFind.SelectAll();
tbFind.Focus();
}
catch
{
tbFind.BackColor = Color.Red;
}
}
}
}
private void autoColumnsSizeToolStripMenuItem_Click(object sender, EventArgs e)
{
dv1.AutoResizeColumns();
}
private void dv1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex < 0 || e.RowIndex < 0) return;
var col = dv1.Columns[e.ColumnIndex];
switch (col.DataPropertyName)
{
case "itemName":
var valuen = dv1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;
if (valuen != null)
{
string inputtext = valuen.ToString().Trim();
if (inputtext.isEmpty())
{
dv1.Rows[e.RowIndex].Cells["dvc_itemName"].Value = inputtext;
}
else
{
//검색을 실행해서 보여준다.
var SearchDT = taItem.GetSearch("%" + inputtext + "%", FCOMMON.info.Login.gcode);
if (SearchDT == null || SearchDT.Rows.Count < 1)
{
FCOMMON.Util.MsgE("검색 결과가 없습니다.");
return;
}
else
{
//검색된 결과를 표시해서 보여준다.
var f = new fLovItem("%" + inputtext + "%");
if(f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
dv1.Rows[e.RowIndex].Cells["dvc_item"].Value = f.item;
dv1.Rows[e.RowIndex].Cells["dvc_itemName"].Value = f.itemName;
}
}
}
}
break;
case "item":
var value = dv1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;
if (value != null)
{
int idx = (int)value;
if (idx != -1)
{
var item = this.taItem.GetbyIDX(idx);
if (item.Count == 1)
{
//1개만 찾았다면 그것을 사용한다.
var itemnameValue = item[0]["name"];
if (itemnameValue != null)
dv1.Rows[e.RowIndex].Cells["dvc_itemName"].Value = itemnameValue.ToString();
}
else
{
FCOMMON.Util.MsgE("해당 아이템이 존재하지 않습니다.");
dv1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = DBNull.Value;
}
}
}
break;
case "project":
var valuep = dv1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;
if (valuep != null)
{
int idx = (int)valuep;
if (idx != -1)
{
var item = this.taPrj.GetData(idx);
if (item.Count == 1)
{
//1개만 찾았다면 그것을 사용한다.
var itemnameValue = item[0]["name"];
if (itemnameValue != null)
dv1.Rows[e.RowIndex].Cells["dvc_projectName"].Value = itemnameValue.ToString();
}
else
{
FCOMMON.Util.MsgE("해당 프로젝트가 존재하지 않습니다.");
dv1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = DBNull.Value;
}
}
}
break;
case "projectName":
var valuepn = dv1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;
if (valuepn != null)
{
string inputtext = valuepn.ToString().Trim();
if (inputtext.isEmpty())
{
dv1.Rows[e.RowIndex].Cells["dvc_projectname"].Value = inputtext;
}
else
{
//검색을 실행해서 보여준다.
var SearchDT = this.taPrj.GetSearch("%" + inputtext + "%",FCOMMON.info.Login.gcode);
if (SearchDT == null || SearchDT.Rows.Count < 1)
{
FCOMMON.Util.MsgE("검색 결과가 없습니다.");
return;
}
else
{
//검색된 결과를 표시해서 보여준다.
var f = new fLovProject("%" + inputtext + "%");
if(f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
dv1.Rows[e.RowIndex].Cells["dvc_project"].Value = f.Index;
dv1.Rows[e.RowIndex].Cells["dvc_projectname"].Value = f.Title;
}
}
}
}
break;
}
}
private void toolStripLabel1_Click(object sender, EventArgs e)
{
//시작일(inventory 에 uid 가 내것인 데이터)
var dataList = FCOMMON.DBM.getDateList("inventoryUser", "uid='" + FCOMMON.info.Login.no + "'", true);
var f = new FCOMMON.fLovDateList(dataList);
if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
dtSD.Text = f.selectedDate;
}
}
private void toolStripLabel2_Click(object sender, EventArgs e)
{
var dataList = FCOMMON.DBM.getDateList("inventoryUser", "uid='" + FCOMMON.info.Login.no + "'", true);
var f = new FCOMMON.fLovDateList(dataList);
if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
dtED.Text = f.selectedDate;
btSearch.PerformClick();
}
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
var f = new Inventory.RepInvStockUser(this.tbName.Text.Trim());
f.MdiParent = this.MdiParent;
f.Show();
}
private void toolStripLabel3_Click(object sender, EventArgs e)
{
tbFind.Text = string.Empty;
btFind.PerformClick();
}
}
}

View File

@@ -71,9 +71,11 @@ namespace FCM0000
///입력된 데이터를 적용한다.
if (dr.pdate == "") dr.pdate = DateTime.Now.ToShortDateString();
dtPdate.Value = DateTime.Parse(dr.pdate);
dtPdate.Value = DateTime.Parse(dr.pdate);
// cmbRequest.Text = dr.userName;
// cmbRequest.Text = dr.userName;
tbPumIDX.Text = dr.item.ToString();
tbSID.Text = dr.sid;
tbSID.Tag = tbSID.Text;
tbPumIDX.Text = dr.item.ToString();
@@ -233,6 +235,13 @@ namespace FCM0000
FCOMMON.DBM.UpdateItemSID(int.Parse(tbPumIDX.Text), tbSID.Text);
}
if(cmbPlace.Text.Trim() == "")
{
FCOMMON.Util.MsgE("보관소를 입력하세요");
cmbPlace.Focus();
return false;
}
dr.itemName = tbPumName.Text;
dr.itemModel = tbPumModel.Text;
dr.item = int.Parse( tbPumIDX.Text );