장비목록 통합작업

This commit is contained in:
chi
2021-03-30 11:06:43 +09:00
parent 1efe0fa04e
commit d7a6cb25c5
34 changed files with 9131 additions and 3443 deletions

View File

@@ -16,6 +16,7 @@ namespace FEQ0000
{
public enum eTabletype
{
ALL,
MOLD,
FOL,
BUMP,
@@ -57,6 +58,14 @@ namespace FEQ0000
this.dsEQ.EETGW_EquipmentOther.TableNewRow += Equipment_TableNewRow;
dvc_param.Visible = false;
}
else if (dataType == eTabletype.ALL)
{
tableName = "EETGW_Equipment";
this.dsEQ.EETGW_EquipmentOther.TableNewRow += Equipment_TableNewRow;
dvc_param.Visible = false;
panel1.Visible = true; //필터창보이게
}
else
{
@@ -65,6 +74,7 @@ namespace FEQ0000
dvc_param.Visible = true;
}
this.FormClosed += fEquipment_FormClosed;
}
void fEquipment_FormClosed(object sender, FormClosedEventArgs e)
@@ -83,6 +93,7 @@ namespace FEQ0000
else if (dataType == eTabletype.FOL) dtList = taDateList.GetDateListF();
else if (dataType == eTabletype.ING) dtList = taDateList.GetDateListIng();
else if (dataType == eTabletype.OTHER) dtList = taDateList.GetDateListOther();
else if (dataType == eTabletype.ALL) dtList = taDateList.GetDateListAll();
else dtList = taDateList.GetDateListME();
this.cmbDate.Items.Clear();
@@ -111,21 +122,29 @@ namespace FEQ0000
var lcList = DatabaseManager.getEQGroupLiist("linecode", this.tableName);
var manuList = DatabaseManager.getEQGroupLiist("manu", this.tableName);
var typeList = DatabaseManager.getEQGroupLiist("type", this.tableName);
var plantList = DatabaseManager.getEQGroupLiist("plant", this.tableName);
var grp2List = DatabaseManager.getEQGroupLiist("grp2", this.tableName);
cmbGrp.Items.Add("-- All --");
cmbLine.Items.Add("-- All --");
cmbManu.Items.Add("-- All --");
cmbType.Items.Add("-- All --");
cmbPlant.Items.Add("-- All --");
cmbCate.Items.Add("-- All --");
foreach (var item in grpList) this.cmbGrp.Items.Add(item);
foreach (var item in lcList) this.cmbLine.Items.Add(item);
foreach (var item in manuList) this.cmbManu.Items.Add(item);
foreach (var item in typeList) this.cmbType.Items.Add(item);
foreach (var item in plantList) this.cmbPlant.Items.Add(item);
foreach (var item in grp2List) this.cmbCate.Items.Add(item);
if (this.cmbGrp.Items.Count > 0) cmbGrp.SelectedIndex = 0;
if (this.cmbLine.Items.Count > 0) cmbLine.SelectedIndex = 0;
if (this.cmbManu.Items.Count > 0) cmbManu.SelectedIndex = 0;
if (this.cmbType.Items.Count > 0) cmbType.SelectedIndex = 0;
if (this.cmbPlant.Items.Count > 0) cmbPlant.SelectedIndex = 0;
if (this.cmbCate.Items.Count > 0) cmbCate.SelectedIndex = 0;
//if (this.dataType == eTabletype.ING)
// dvc_param.HeaderText = "RCS Flag";
@@ -157,10 +176,15 @@ namespace FEQ0000
{
this.taIng.Update(this.dsEQ.EETGW_EquipmentIng);
}
else if(dataType == eTabletype.OTHER)
else if (dataType == eTabletype.OTHER)
{
this.taOther.Update(this.dsEQ.EETGW_EquipmentOther);
}
else if (dataType == eTabletype.ALL)
{
taAll.Update(this.dsEQ.EETGW_Equipment);
}
else
{
this.taF.Update(this.dsEQ.EquipmentF);
@@ -192,6 +216,7 @@ namespace FEQ0000
else if (dataType == eTabletype.MOLD) dRows = this.dsEQ.EquipmentME.Select(filter);
else if (dataType == eTabletype.ING) dRows = this.dsEQ.EETGW_EquipmentIng.Select(filter);
else if (dataType == eTabletype.OTHER) dRows = this.dsEQ.EETGW_EquipmentOther.Select(filter);
else if (dataType == eTabletype.ALL) dRows = this.dsEQ.EETGW_Equipment.Select(filter);
else dRows = this.dsEQ.EquipmentF.Select(filter);
int cnt = 0;
@@ -235,6 +260,7 @@ namespace FEQ0000
else if (dataType == eTabletype.BUMP) this.bsB.Filter = filter;
else if (dataType == eTabletype.ING) this.bsIng.Filter = filter;
else if (dataType == eTabletype.OTHER) this.bsOther.Filter = filter;
else if (dataType == eTabletype.ALL) this.bsAll.Filter = filter;
else this.bsF.Filter = filter;
if (key.isEmpty()) this.tbFilter.BackColor = Color.White;
@@ -258,8 +284,22 @@ namespace FEQ0000
private void toolStripButton4_Click(object sender, EventArgs e)
{
var f = new rpt_equipmentB(dataType, this.cmbDate.Text);
f.Show();
if(this.dataType == eTabletype.ALL)
{
if(this.dsEQ.EETGW_Equipment.Count < 1)
{
FCOMMON.Util.MsgE("자료가 없습니다. 자료를 조회하고 시도하세요");
return;
}
var f = new rpt_equipmentAll(this.dsEQ.EETGW_Equipment,this.grp2name);
f.Show();
}
else
{
var f = new rpt_equipmentB(dataType, this.cmbDate.Text);
f.Show();
}
}
private void toolStripButton2_Click(object sender, EventArgs e)
@@ -274,6 +314,7 @@ namespace FEQ0000
RefreshDate();
}
string grp2name = string.Empty;
private void toolStripButton6_Click(object sender, EventArgs e)
{
if (cmbDate.SelectedIndex < 0)
@@ -283,10 +324,12 @@ namespace FEQ0000
}
this.grp2name = this.cmbCate.Text;
//select query
string newSQL = "select * from {0}";
string newWhere = string.Empty;
string newWhere = "pdate = '{1}'";
if (cmbGrp.SelectedIndex != 0 && !cmbGrp.Text.isEmpty())
{
if (!newWhere.isEmpty()) newWhere += " and ";
@@ -312,6 +355,16 @@ namespace FEQ0000
if (!newWhere.isEmpty()) newWhere += " and ";
newWhere += string.Format("(asset like '%{0}%' or model like '%{0}%' or serial like '%{0}%')", tbSearch.Text);
}
if (this.cmbPlant.SelectedIndex > 0 && !this.cmbPlant.Text.isEmpty())
{
if (!newWhere.isEmpty()) newWhere += " and ";
newWhere += "[plant]='" + cmbPlant.Text + "'";
}
if (this.cmbCate.SelectedIndex > 0 && !this.cmbCate.Text.isEmpty())
{
if (!newWhere.isEmpty()) newWhere += " and ";
newWhere += "[grp2]='" + cmbCate.Text + "'";
}
if (radexpn.Checked)
{
if (!newWhere.isEmpty()) newWhere += " and ";
@@ -322,18 +375,30 @@ namespace FEQ0000
if (!newWhere.isEmpty()) newWhere += " and ";
newWhere += string.Format("isnull([except],0) = 1");
}
if (radioButton1.Checked) //yes
{
if (!newWhere.isEmpty()) newWhere += " and ";
newWhere += string.Format("isnull([ing],0) = 1");
}
if (radioButton3.Checked) //no
{
if (!newWhere.isEmpty()) newWhere += " and ";
newWhere += string.Format("isnull([ing],0) = 0");
}
string CommandText = newSQL;
if (!newWhere.isEmpty()) CommandText += " where " + newWhere;
switch (dataType)
{
case eTabletype.MOLD:
//select command
if (this.taME.Adapter.SelectCommand == null)
this.taME.Adapter.SelectCommand = new System.Data.SqlClient.SqlCommand();
this.taME.Adapter.SelectCommand.CommandText = string.Format(CommandText, "equipmentME");
this.taME.Adapter.SelectCommand.CommandText = string.Format(CommandText, "equipmentME", this.cmbDate.Text);
this.dsEQ.EquipmentME.Clear();
taME.Fill(this.dsEQ.EquipmentME, this.cmbDate.Text);
this.dsEQ.EquipmentME.AcceptChanges();
@@ -344,7 +409,7 @@ namespace FEQ0000
//select command
if (this.taB.Adapter.SelectCommand == null)
this.taB.Adapter.SelectCommand = new System.Data.SqlClient.SqlCommand();
this.taB.Adapter.SelectCommand.CommandText = string.Format(CommandText, "equipmentB");
this.taB.Adapter.SelectCommand.CommandText = string.Format(CommandText, "equipmentB", this.cmbDate.Text);
this.dsEQ.EquipmentB.Clear();
taB.Fill(this.dsEQ.EquipmentB, this.cmbDate.Text);
this.dsEQ.EquipmentB.AcceptChanges();
@@ -355,7 +420,7 @@ namespace FEQ0000
//select command
if (this.taF.Adapter.SelectCommand == null)
this.taF.Adapter.SelectCommand = new System.Data.SqlClient.SqlCommand();
this.taF.Adapter.SelectCommand.CommandText = string.Format(CommandText, "equipmentF");
this.taF.Adapter.SelectCommand.CommandText = string.Format(CommandText, "equipmentF",this.cmbDate.Text);
this.dsEQ.EquipmentF.Clear();
taF.Fill(this.dsEQ.EquipmentF, this.cmbDate.Text);
this.dsEQ.EquipmentF.AcceptChanges();
@@ -366,18 +431,37 @@ namespace FEQ0000
//select command
if (this.taIng.Adapter.SelectCommand == null)
this.taIng.Adapter.SelectCommand = new System.Data.SqlClient.SqlCommand();
this.taIng.Adapter.SelectCommand.CommandText = string.Format(CommandText, "EETGW_EquipmentIng");
this.taIng.Adapter.SelectCommand.CommandText = string.Format(CommandText, "EETGW_EquipmentIng", this.cmbDate.Text);
this.dsEQ.EETGW_EquipmentIng.Clear();
taIng.Fill(this.dsEQ.EETGW_EquipmentIng, this.cmbDate.Text);
this.dsEQ.EETGW_EquipmentIng.AcceptChanges();
dv.DataSource = bsIng;
bn.BindingSource = bsIng;
break;
case eTabletype.ALL:
CommandText = string.Format(CommandText, "EETGW_Equipment", this.cmbDate.Text);
var cmd = new System.Data.SqlClient.SqlCommand(CommandText, this.taAll.Connection);
var da = new System.Data.SqlClient.SqlDataAdapter(cmd);
dsEQ.EETGW_Equipment.Clear();
da.Fill(this.dsEQ.EETGW_Equipment);
dsEQ.EETGW_Equipment.AcceptChanges();
////select command
//if (this.taAll.Adapter.SelectCommand == null)
// this.taAll.Adapter.SelectCommand = new System.Data.SqlClient.SqlCommand();
//this.taAll.Adapter.SelectCommand.CommandText = string.Format(CommandText, "EETGW_Equipment");
//this.dsEQ.EETGW_Equipment.Clear();
//taAll.Fill(this.dsEQ.EETGW_Equipment, this.cmbDate.Text);
//this.dsEQ.EETGW_Equipment.AcceptChanges();
dv.DataSource = bsAll;
bn.BindingSource = bsAll;
break;
case eTabletype.OTHER:
//select command
if (this.taOther.Adapter.SelectCommand == null)
this.taOther.Adapter.SelectCommand = new System.Data.SqlClient.SqlCommand();
this.taOther.Adapter.SelectCommand.CommandText = string.Format(CommandText, "EETGW_EquipmentOther");
this.taOther.Adapter.SelectCommand.CommandText = string.Format(CommandText, "EETGW_Equipment");
this.dsEQ.EETGW_EquipmentOther.Clear();
taOther.Fill(this.dsEQ.EETGW_EquipmentOther, this.cmbDate.Text);
this.dsEQ.EETGW_EquipmentOther.AcceptChanges();
@@ -507,11 +591,12 @@ namespace FEQ0000
var linedata = dtLineCode.Where(t => t.code == dr.linecode).FirstOrDefault();
if (linedata != null)
{
if (dr.lineP != linedata.part || dr.lineT != linedata.team || dr.plant != linedata.plant)
if (dr.grp2 != linedata.grp2 || dr.lineP != linedata.part || dr.lineT != linedata.team || dr.plant != linedata.plant)
{
dr.lineP = linedata.part;
dr.lineT = linedata.team;
dr.plant = linedata.plant;
dr.grp2 = linedata.grp2;
dr.EndEdit();
ucnt += 1;
}
@@ -528,11 +613,12 @@ namespace FEQ0000
var linedata = dtLineCode.Where(t => t.code == dr.linecode).FirstOrDefault();
if (linedata != null)
{
if (dr.lineP != linedata.part || dr.lineT != linedata.team || dr.plant != linedata.plant)
if (dr.grp2 != linedata.grp2 || dr.lineP != linedata.part || dr.lineT != linedata.team || dr.plant != linedata.plant)
{
dr.lineP = linedata.part;
dr.lineT = linedata.team;
dr.plant = linedata.plant;
dr.grp2 = linedata.grp2;
dr.EndEdit();
ucnt += 1;
}
@@ -549,11 +635,12 @@ namespace FEQ0000
var linedata = dtLineCode.Where(t => t.code == dr.linecode).FirstOrDefault();
if (linedata != null)
{
if (dr.lineP != linedata.part || dr.lineT != linedata.team || dr.plant != linedata.plant)
if (dr.grp2 != linedata.grp2 || dr.lineP != linedata.part || dr.lineT != linedata.team || dr.plant != linedata.plant)
{
dr.lineP = linedata.part;
dr.lineT = linedata.team;
dr.plant = linedata.plant;
dr.grp2 = linedata.grp2;
dr.EndEdit();
ucnt += 1;
}
@@ -570,11 +657,34 @@ namespace FEQ0000
var linedata = dtLineCode.Where(t => t.code == dr.linecode).FirstOrDefault();
if (linedata != null)
{
if (dr.lineP != linedata.part || dr.lineT != linedata.team || dr.plant != linedata.plant)
if (dr.grp2 != linedata.grp2 || dr.lineP != linedata.part || dr.lineT != linedata.team || dr.plant != linedata.plant)
{
dr.lineP = linedata.part;
dr.lineT = linedata.team;
dr.plant = linedata.plant;
dr.grp2 = linedata.grp2;
dr.EndEdit();
ucnt += 1;
}
}
}
}
else if (dataType == eTabletype.ALL)
{
this.prb1.Maximum = this.dsEQ.EETGW_Equipment.Count;
foreach (dsEQ.EETGW_EquipmentRow dr in this.dsEQ.EETGW_Equipment)
{
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.grp2 != linedata.grp2 || dr.lineP != linedata.part || dr.lineT != linedata.team || dr.plant != linedata.plant)
{
dr.lineP = linedata.part;
dr.lineT = linedata.team;
dr.plant = linedata.plant;
dr.grp2 = linedata.grp2;
dr.EndEdit();
ucnt += 1;
}
@@ -591,11 +701,12 @@ namespace FEQ0000
var linedata = dtLineCode.Where(t => t.code == dr.linecode).FirstOrDefault();
if (linedata != null)
{
if (dr.lineP != linedata.part || dr.lineT != linedata.team || dr.plant != linedata.plant)
if (dr.grp2 != linedata.grp2 || dr.lineP != linedata.part || dr.lineT != linedata.team || dr.plant != linedata.plant)
{
dr.lineP = linedata.part;
dr.lineT = linedata.team;
dr.plant = linedata.plant;
dr.grp2 = linedata.grp2;
dr.EndEdit();
ucnt += 1;
}