190806 chi 품목정보에서 카테고리 없는 자료도 보이게 함
품목정보 정렬 기능 추가 190731 로그기록화면(beta)추가
This commit is contained in:
102
SubProject/FCM0000/Item/fItemAdd.cs
Normal file
102
SubProject/FCM0000/Item/fItemAdd.cs
Normal file
@@ -0,0 +1,102 @@
|
||||
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.Item
|
||||
{
|
||||
public partial class fItemAdd : FCOMMON.fBase
|
||||
{
|
||||
public int newIDX = -1;
|
||||
public fItemAdd()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
foreach (Control ctl in this.Controls)
|
||||
{
|
||||
if (ctl.GetType() == typeof(TextBox) || ctl.GetType() == typeof(ComboBox))
|
||||
{
|
||||
ctl.KeyDown += ctl_KeyDown;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ctl_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Enter)
|
||||
{
|
||||
Control ctl = sender as Control;
|
||||
string nm = ctl.Name.ToLower();
|
||||
string search = ctl.Text.Trim();
|
||||
SendKeys.Send("{TAB}");
|
||||
}
|
||||
}
|
||||
|
||||
private void fItemAdd_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void btOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(tbName.Text.Trim()=="")
|
||||
{
|
||||
FCOMMON.Util.MsgE("품명은 필수 입니다");
|
||||
return;
|
||||
}
|
||||
var pumName = tbName.Text.Trim();
|
||||
var pumModel = tbModel.Text.Trim();
|
||||
var searchKey = pumName + pumModel;
|
||||
var cnt = (int)(ta.ExistCheck(FCOMMON.info.Login.gcode, searchKey));
|
||||
if(cnt > 0)
|
||||
{
|
||||
FCOMMON.Util.MsgE("동일 품명 모델의 정보가 존재 합니다");
|
||||
return;
|
||||
}
|
||||
if (tbSupplyIdx.Text == "") tbSupplyIdx.Text = "-1";
|
||||
var newdr = this.dsMSSQL.Items.NewItemsRow();
|
||||
newdr.gcode = FCOMMON.info.Login.gcode;
|
||||
newdr.wdate = DateTime.Now;
|
||||
newdr.wuid = FCOMMON.info.Login.no;
|
||||
newdr.name = tbName.Text.Trim();
|
||||
newdr.sid = tbSid.Text.Trim();
|
||||
newdr.model = tbModel.Text.Trim();
|
||||
newdr.manu = tbManu.Text.Trim();
|
||||
newdr.supply = tbSupply.Text.Trim();
|
||||
newdr.supplyidx = int.Parse(tbSupplyIdx.Text.Trim());
|
||||
newdr.memo = tbMemo.Text.Trim();
|
||||
newdr.cate = "--";
|
||||
int price;
|
||||
int.TryParse(tbPrice.Text, out price);
|
||||
newdr.price = price;
|
||||
newdr.scale = 1;
|
||||
newdr.unit = tbUnit.Text.Trim();
|
||||
if (newdr.unit == "") newdr.unit = "EA";
|
||||
newdr.disable = false;
|
||||
newdr.import = "";
|
||||
this.dsMSSQL.Items.AddItemsRow(newdr);
|
||||
try
|
||||
{
|
||||
var cnt2 = ta.Update(dsMSSQL.Items);
|
||||
if (cnt2 == 0)
|
||||
{
|
||||
FCOMMON.Util.MsgE("추가 실패");
|
||||
}
|
||||
else
|
||||
{
|
||||
newIDX = (int)(ta.ReadIDX(FCOMMON.info.Login.gcode, searchKey));
|
||||
DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
}
|
||||
}
|
||||
catch (Exception eX)
|
||||
{
|
||||
FCOMMON.Util.MsgE(eX.Message);
|
||||
newIDX = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user