장비목록의 line/team 을 다시 업데이트하는 기능 추가.

This commit is contained in:
chi
2021-03-22 15:07:50 +09:00
parent 35d6c64b99
commit d15737f654
8 changed files with 205 additions and 62 deletions

View File

@@ -42,6 +42,13 @@ namespace FEQ0000
this.dsEQ.EquipmentF.TableNewRow += Equipment_TableNewRow;
dvc_param.Visible = false;
}
else if (dataType == eTabletype.ING)
{
tableName = "EETGW_EquipmentIng";
this.dsEQ.EETGW_EquipmentIng.TableNewRow += Equipment_TableNewRow;
dvc_param.Visible = false;
}
else
{
@@ -136,7 +143,7 @@ namespace FEQ0000
{
this.taME.Update(this.dsEQ.EquipmentME);
}
else if(dataType == eTabletype.ING)
else if (dataType == eTabletype.ING)
{
this.taIng.Update(this.dsEQ.EETGW_EquipmentIng);
}
@@ -238,7 +245,7 @@ namespace FEQ0000
var f = new rpt_equipmentB(dataType, this.cmbDate.Text);
f.Show();
}
private void toolStripButton2_Click(object sender, EventArgs e)
{
@@ -366,7 +373,7 @@ namespace FEQ0000
private void applyToolStripMenuItem_Click(object sender, EventArgs e)
{
var f = new EQFilterApply( this.dataType == eTabletype.ING ? "I" : "E");
var f = new EQFilterApply(this.dataType == eTabletype.ING ? "I" : "E");
if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
var dlg = FCOMMON.Util.MsgQ("매크로를 적용 하시겠습니까?");
@@ -428,20 +435,20 @@ namespace FEQ0000
cmd.CommandText = "select * from common where grp ='07' and svalue <> '' and isnull(code,'') = ''";
var rdr = cmd.ExecuteReader();
while(rdr.Read())
while (rdr.Read())
{
string manu = rdr["svalue"].ToString();
cmd2.CommandText = "select code from common where grp ='06' and memo='"+manu+"'";
cmd2.CommandText = "select code from common where grp ='06' and memo='" + manu + "'";
var manu_data = cmd2.ExecuteScalar();
if (manu_data == null) continue;
var manu_code = manu_data.ToString();
cmd2.CommandText = "update common set code = '"+manu_code+"' where grp = '07' and isnull(code,'') = '' and svalue = '"+manu+"'";
cmd2.CommandText = "update common set code = '" + manu_code + "' where grp = '07' and isnull(code,'') = '' and svalue = '" + manu + "'";
cmd2.ExecuteNonQuery();
}
cmd.Dispose();
cn1.Close();
cn2.Close();
@@ -450,6 +457,103 @@ namespace FEQ0000
FCOMMON.Util.MsgI("ok");
}
private void toolStripButton1_Click_1(object sender, EventArgs e)
{
var dlg = FCOMMON.Util.MsgQ("Team/Part 정보를 서버의 정보로 변경 할까요?");
if (dlg != DialogResult.Yes) return;
this.prb1.Minimum = 0;
this.prb1.Value = 0;
var ucnt = 0;
var taLIne = new dsEQTableAdapters.LineCodeTableAdapter();
var dtLineCode = taLIne.GetData();
if (dataType == eTabletype.MOLD)
{
this.prb1.Maximum = this.dsEQ.EquipmentME.Count;
foreach (dsEQ.EquipmentMERow dr in this.dsEQ.EquipmentME)
{
if (this.prb1.Value < this.prb1.Maximum) this.prb1.Value += 1;
if (dr.RowState == DataRowState.Deleted || dr.RowState == DataRowState.Detached) continue;
var linedata = dtLineCode.Where(t => t.code == dr.linecode).FirstOrDefault();
if (linedata != null)
{
if (dr.lineP != linedata.part || dr.lineT != linedata.team)
{
dr.lineP = linedata.part;
dr.lineT = linedata.team;
dr.EndEdit();
ucnt += 1;
}
}
}
}
else if (dataType == eTabletype.FOL)
{
this.prb1.Maximum = this.dsEQ.EquipmentF.Count;
foreach (dsEQ.EquipmentFRow dr in this.dsEQ.EquipmentF)
{
if (this.prb1.Value < this.prb1.Maximum) this.prb1.Value += 1;
if (dr.RowState == DataRowState.Deleted || dr.RowState == DataRowState.Detached) continue;
var linedata = dtLineCode.Where(t => t.code == dr.linecode).FirstOrDefault();
if (linedata != null)
{
if (dr.lineP != linedata.part || dr.lineT != linedata.team)
{
dr.lineP = linedata.part;
dr.lineT = linedata.team;
dr.EndEdit();
ucnt += 1;
}
}
}
}
else if (dataType == eTabletype.ING)
{
this.prb1.Maximum = this.dsEQ.EETGW_EquipmentIng.Count;
foreach (dsEQ.EETGW_EquipmentIngRow dr in this.dsEQ.EETGW_EquipmentIng)
{
if (this.prb1.Value < this.prb1.Maximum) this.prb1.Value += 1;
if (dr.RowState == DataRowState.Deleted || dr.RowState == DataRowState.Detached) continue;
var linedata = dtLineCode.Where(t => t.code == dr.linecode).FirstOrDefault();
if (linedata != null)
{
if (dr.lineP != linedata.part || dr.lineT != linedata.team)
{
dr.lineP = linedata.part;
dr.lineT = linedata.team;
dr.EndEdit();
ucnt += 1;
}
}
}
}
else
{
this.prb1.Maximum = this.dsEQ.EquipmentB.Count;
foreach (dsEQ.EquipmentBRow dr in this.dsEQ.EquipmentB)
{
if (this.prb1.Value < this.prb1.Maximum) this.prb1.Value += 1;
if (dr.RowState == DataRowState.Deleted || dr.RowState == DataRowState.Detached) continue;
var linedata = dtLineCode.Where(t => t.code == dr.linecode).FirstOrDefault();
if (linedata != null)
{
if (dr.lineP != linedata.part || dr.lineT != linedata.team)
{
dr.lineP = linedata.part;
dr.lineT = linedata.team;
dr.EndEdit();
ucnt += 1;
}
}
}
}
FCOMMON.Util.MsgI($"{ucnt} 건의 자료가 변경 되었습니다. 적용하려면 '저장' 버튼을 누르세요");
}
}
}