private void BtnOK_Click(object sender, EventArgs e) { DataTable dt = dtgCode.DataSource as DataTable; if (bAdmin) { this.ReturnCodeValue = "testadmin"; this.ReturnNameValue = "관리자"; this.ReturnCodeNameValue = ReturnCodeValue + " : " + ReturnNameValue; this.Close(); return; } if (CommonFuction.IsNullOrWhiteSpace(dtgCode.CurrentRow)) { MessageBox.Show("선택된 항목이 없습니다."); return; } DataGridViewRow gRow = dtgCode.CurrentRow; this.ReturnCodeValue = gRow.Cells["code"].Value.ToString(); this.ReturnNameValue = gRow.Cells["name"].Value.ToString(); this.ReturnCodeNameValue = ReturnCodeValue + " : " + ReturnNameValue; this.Close(); }
/// <summary> /// 실제 Rack을 나타내는 컨트롤을 위치에 맞게 세팅해줌 /// </summary> public void DrawRacks() { if (MainDataSet != null) { //RackList = MainDataSet.Tables[1]; } tlpRack.Hide(); try { tlpRack.Controls.Clear(); foreach (DataRow x in RackList.Rows) { UserControls.RackControl NewCtrl = new UserControls.RackControl(); NewCtrl.RackControlClick += NewCtrl_Click; NewCtrl.ChangeRackName(x["EQUIPMENTID"] as string); NewCtrl.Dock = DockStyle.Fill; if (CommonFuction.IsNullOrWhiteSpace(x["DURABLEPRODUCTNAME"])) { x["DURABLEPRODUCTNAME"] = ""; } NewCtrl.ChangeMaskName((string)x["DURABLEPRODUCTNAME"]); tlpRack.Controls.Add(NewCtrl, (int)x["LOCATIONX"] - 1, (int)x["LOCATIONY"] - 1); if (CommonFuction.IsNullOrWhiteSpace(x["DURABLEID"])) { NewCtrl.ChangeRackState("empty"); } else if ((int)x["WARNINGUSEQTY"] <= (int)x["TOTUSEQTY"]) { NewCtrl.ChangeRackState("warning"); } else { if ((string)x["WORKSTATE"] == "WORKSTATE_USED" || (string)x["WORKSTATE"] == "WORKSTATE_USING") { NewCtrl.ChangeRackState("using"); } else { NewCtrl.ChangeRackState("stock"); } } } } catch (Exception e) { LogFactory.Log(e); } tlpRack.Show(); }
public string SetMaskDatas(string RackId) { DataSet ds = new DataSet(); ds = conn.CallSelectProcedure_ds(ProcedureName, new SqlParameter[] { new SqlParameter("rackid", RackId) }); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; lblDataMaskID.Text = dr["durableid"].ToString(); lblDataModelCode.Text = dr["durableproductid"].ToString(); lblDataModelName.Text = dr["durableproductname"].ToString(); lblDataRackID.Text = dr["equipmentid"].ToString(); lblDataInputInsp.Text = dr["inputresult"].ToString(); if (!CommonFuction.IsNullOrWhiteSpace(dr["inputdate"])) { lblDataInputDate.Text = dr["inputdate"].ToString(); } else { lblDataInputDate.Text = ""; } if (!CommonFuction.IsNullOrWhiteSpace(dr["usedate"])) { lblDataRecentUse.Text = dr["usedate"].ToString(); } else { lblDataRecentUse.Text = ""; } if ((int)dr["totuseqty"] > 0) { lblDataTotalUse.Text = dr["totuseqty"].ToString(); } else { lblDataTotalUse.Text = ""; } lblDataCleanInsp.Text = dr["cleanresult"].ToString(); lblDataDescription.Text = dr["description"].ToString(); } return(ds.Tables.Count.ToString()); }
/// <summary> /// Table Layout View 초기화 /// Rack의 배치 레이아웃에 맞춰 세팅해줌. /// </summary> public void Initialization() { try { if (MainDataSet != null) { RackDesign = MainDataSet.Tables[0]; if (Program.MaxX.Equals(0) && !CommonFuction.IsNullOrWhiteSpace(RackDesign.Rows[0]["MAX_X"])) { Program.MaxX = (int)RackDesign.Rows[0]["MAX_X"]; } if (Program.MaxY.Equals(0) && !CommonFuction.IsNullOrWhiteSpace(RackDesign.Rows[0]["MAX_Y"])) { Program.MaxY = (int)RackDesign.Rows[0]["MAX_Y"]; } } tlpRack.Hide(); tlpRack.ColumnCount = Program.MaxX + 1; tlpRack.RowCount = Program.MaxY + 1; tlpRack.ColumnStyles.Clear(); tlpRack.RowStyles.Clear(); for (var i = 0; i < tlpRack.ColumnCount; i++) { tlpRack.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, this.Size.Width / Program.MaxX)); } for (var i = 0; i < tlpRack.RowCount; i++) { tlpRack.RowStyles.Add(new RowStyle(SizeType.Absolute, this.Size.Height / Program.MaxY)); } tlpRack.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 1)); tlpRack.RowStyles.Add(new RowStyle(SizeType.Absolute, 1)); tlpRack.Show(); } catch (Exception ee) { LogFactory.Log(ee); } }
private void TxtText_KeyDown(object sender, KeyEventArgs e) { string sEqpId = (sender as TextBox).Text.ToString(); if (e.KeyCode == Keys.Enter) { if (CommonFuction.IsNullOrWhiteSpace(txt_EqpId)) { CustomMessageBox.Show(MessageBoxButtons.OK, "ERROR", txt_EqpId.ucLabelText + "를 입력하세요."); txt_EqpId.txtText.Focus(); } else { List <SqlParameter> Params = new List <SqlParameter>(); Params.Add(new SqlParameter("@eqp_id", sEqpId)); Params.Add(new SqlParameter("@equipmenttype", "EQUIPMENT_INSP")); QueryListEqp = null; QueryListEqp = DB.CallSelectProcedure_ds("[SelectEqpId]", Params); if (QueryListEqp.Tables[0].Rows.Count != 0) { DataRow row = QueryListEqp.Tables[0].Rows[0]; this.txt_EqpId.ucValue = row["EQUIPMENTID"].ToString(); this.txt_EqpName.ucValue = row["EQUIPMENTNAME"].ToString(); txt_MaskNum.Focus(); } else { CustomMessageBox.Show(MessageBoxButtons.OK, "ERROR", txt_EqpId.ucLabelText + "가 없습니다."); txt_EqpId.txtText.SelectAll(); return; } } } }
/// <summary> /// * 함 수 명 : Select_Mask_Info /// * 작 성 자 : 황지희 /// * 개 요 : 마스크 일련번호 바코드 스캐닝 후 정보 출력 /// </summary> private void Select_Mask_Info(object sender, KeyEventArgs e) { string sMaskNum = (sender as TextBox).Text.ToString(); if (e.KeyCode == Keys.Enter) { if (CommonFuction.IsNullOrWhiteSpace(sMaskNum)) { CustomMessageBox.Show(MessageBoxButtons.OK, "ERROR", "Mask 일련번호를 입력하세요."); return; } else { List <SqlParameter> Params = new List <SqlParameter>(); Params.Add(new SqlParameter("@durable_id", sMaskNum)); DataSet QueryList = DB.CallSelectProcedure_ds("selectMaskCleanInfo", Params); int iTot_Use_Qty, iUse_Qty = 0; if (QueryList.Tables[0].Rows.Count != 0) { DataRow row = QueryList.Tables[0].Rows[0]; // 2019-05-08 황지희 WORKSTATE상태가 RUN일 경우만 조회가능 if (row["STATE"].Equals("STATE_ACTIVE") && row["WORKSTATE"].Equals("WORKSTATE_USED")) { SetComboBox(sMaskNum); this.txt_MaskNum.ucValue = row["DURABLEID"].ToString(); this.txt_MaskProd.ucValue = row["DURABLEPRODUCTID"].ToString(); this.txt_MaskProdName.ucValue = row["DURABLEPRODUCTNAME"].ToString(); int.TryParse(row["TOTUSEQTY"].ToString(), out iTot_Use_Qty); int.TryParse(row["USEQTY"].ToString(), out iUse_Qty); this.txt_TotUse.ucValue = iTot_Use_Qty.ToString(); //누적사용횟수 this.txt_UseQty.ucValue = iUse_Qty.ToString(); //사용횟수 if (row["RACKID"].ToString() != null) { this.txt_Rack.txtText.Text = row["RACKID"].ToString(); } this.txt_Comment.ucValue = row["COMMENT"].ToString(); this.txt_Date.ucValue = row["USEDATE"].ToString(); //2019-05-16 Mask 사양정보 추가 this.txt_MaskProdInfo.ucValue = row["DESCRIPTION"].ToString(); //2019-08-23 적치대 추가 //this.mcbmRack.ucText = row["RACKID"].ToString(); this.mtxt_rack.ucValue = row["RACKID"].ToString(); this.cmb_InspResult.Focus(); } else if (row["STATE"].ToString().Equals("STATE_SCRAPPED")) { CustomMessageBox.Show(MessageBoxButtons.OK, "ERROR", "폐기상태입니다."); txt_MaskNum.txtText.SelectAll(); return; } else if (row["STATE"].ToString().Equals("STATE_TERMINATED")) { CustomMessageBox.Show(MessageBoxButtons.OK, "ERROR", "해당 일련번호는 종료상태입니다."); txt_MaskNum.txtText.SelectAll(); return; } else { CustomMessageBox.Show(MessageBoxButtons.OK, "ERROR", "생산정보 먼저 입력하세요."); txt_MaskNum.txtText.SelectAll(); return; } } else { CustomMessageBox.Show(MessageBoxButtons.OK, "ERROR", "해당 Mask 일련번호가 없습니다."); InitReset(); txt_MaskNum.Focus(); return; } } }//end if (key code) }
/// <summary> /// * 함 수 명 : Txt_MaskNum_KeyDown /// * 작 성 자 : 황지희 /// * 개 요 : Mask 일련번호 Enter로 정보 출력 /// </summary> private void Txt_MaskNum_KeyDown(object sender, KeyEventArgs e) { string sMaskNum = (sender as TextBox).Text.ToString(); if (e.KeyCode == Keys.Enter) { if (CommonFuction.IsNullOrWhiteSpace(sMaskNum)) { CustomMessageBox.Show(MessageBoxButtons.OK, "ERROR", txt_MaskNum.ucLabelText + "를 입력하세요."); return; } else { List <SqlParameter> Params = new List <SqlParameter>(); Params.Add(new SqlParameter("@durable_id", sMaskNum)); QueryList = null; QueryList = DB.CallSelectProcedure_ds("selectMaskCleanInfo", Params); int Limit_Use_Qty, Tot_Use_Qty = 0; if (QueryList.Tables[0].Rows.Count != 0) { DataRow row = QueryList.Tables[0].Rows[0]; //2019-05-08 황지희 상태가 ACTIVE, WORK상태가 WAIT, USING일 경우만 진행 가능 if (row["STATE"].Equals("STATE_ACTIVE") && row["WORKSTATE"].Equals("WORKSTATE_USING") || row["STATE"].Equals("STATE_ACTIVE") && row["WORKSTATE"].Equals("WORKSTATE_WAIT")) { this.txt_MaskNum.ucValue = row["DURABLEID"].ToString(); this.txt_ProdId.ucValue = row["DURABLEPRODUCTID"].ToString(); this.txt_ProdName.ucValue = row["DURABLEPRODUCTNAME"].ToString(); this.txt_TotUse.ucValue = row["TOTUSEQTY"].ToString(); this.txt_Rack.ucValue = row["RACKID"].ToString(); this.txt_Inputdate.ucValue = row["INPUTDATE"].ToString(); this.txt_RecentDate.ucValue = row["USEDATE"].ToString(); //DateTime Use_Date = DateTime.Parse(row["USEDATE"].ToString()); //this.txt_RecentDate.ucValue = Use_Date.ToString(); int.TryParse(row["LIMITUSEQTY"].ToString(), out Limit_Use_Qty); this.txt_LimitUse.ucValue = Limit_Use_Qty.ToString(); int.TryParse(row["TOTUSEQTY"].ToString(), out Tot_Use_Qty); this.txt_TotUse.ucValue = Tot_Use_Qty.ToString(); this.txt_CleanInsp.ucValue = row["CLEAN_RESULT_NAME"].ToString(); //세척검사결과 this.txt_IncomeInsp.ucValue = row["INPUT_RESULT_NAME"].ToString(); //수입검사결과 this.txt_Comment.ucValue = row["COMMENT"].ToString(); this.txt_MaskProdInfo.ucValue = row["DESCRIPTION"].ToString(); this.txt_NowUse.Focus(); //int.parse } else if (row["STATE"].ToString().Equals("STATE_SCRAPPED")) { CustomMessageBox.Show(MessageBoxButtons.OK, "ERROR", "해당 일련번호는 폐기상태입니다."); txt_MaskNum.txtText.SelectAll(); return; } else if (row["STATE"].ToString().Equals("STATE_TERMINATED")) { CustomMessageBox.Show(MessageBoxButtons.OK, "ERROR", "해당 일련번호는 종료상태입니다."); txt_MaskNum.txtText.SelectAll(); return; } else { CustomMessageBox.Show(MessageBoxButtons.OK, "ERROR", "세척검사화면에서 진행하세요."); txt_MaskNum.txtText.SelectAll(); return; } } else { CustomMessageBox.Show(MessageBoxButtons.OK, "ERROR", "해당 Mask 일련번호가 없습니다."); InitReset(); txt_MaskNum.Focus(); return; } } }//end if (key code) }
private void TxtText_KeyDown(object sender, KeyEventArgs e) { string sMaskNum = (sender as TextBox).Text.ToString(); if (e.KeyCode == Keys.Enter) { if (CommonFuction.IsNullOrWhiteSpace(sMaskNum)) { CustomMessageBox.Show(MessageBoxButtons.OK, "ERROR", txt_MaskNum.ucLabelText + "를 입력하세요."); return; } try { DataSet ds = new DataSet(); ds = conn.CallSelectProcedure_ds(ProcedureName3, new SqlParameter[] { new SqlParameter("durable_id", sMaskNum) }); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; if (dr["WORKSTATE"].Equals("WORKSTATE_WAIT") && dr["STATE"].Equals("STATE_ACTIVE")) { if (CustomMessageBox.Show(MessageBoxButtons.OKCancel, "", "상태 변경하시겠습니까?") == DialogResult.OK) { Dictionary <string, object> args = new Dictionary <string, object>(); args.Add("@DURABLEID", sMaskNum); args.Add("@WORKSTATE", "WORKSTATE_USING"); conn.CallNonSelectProcedure(ProcedureName4, conn.GetSqlParameters(args)); CustomMessageBox.Show(MessageBoxButtons.OK, "SAVE", "저장하였습니다."); txt_MaskNum.txtText.ResetText(); txt_MaskNum.Focus(); ResetRackStatus(true); } } else { CustomMessageBox.Show(MessageBoxButtons.OK, "ERROR", "해당 LOT의 상태를 변경할 수 없습니다."); txt_MaskNum.txtText.ResetText(); txt_MaskNum.Focus(); return; } } else { CustomMessageBox.Show(MessageBoxButtons.OK, "ERROR", "해당 MASK 일련번호가 없습니다."); txt_MaskNum.txtText.ResetText(); txt_MaskNum.Focus(); return; } } catch (Exception ee) { LogFactory.Log(ee); CustomMessageBox.Show(MessageBoxButtons.OK, "확인", "문제가 발생했습니다. 로그를 확인하세요."); } } }
//Data 조회 이벤트 private void SearchGrid(String name) { if (name.Equals("all")) { //전체인 경우 조회 List <SqlParameter> Params = new List <SqlParameter>(); Params.Add(new SqlParameter("@state", "")); DataSet QueryList = manager.CallSelectProcedure_ds("ManagerListBySelect", Params); if (QueryList.Tables.Count == 0) { MessageBox.Show("ERROR"); } else { dataGridView1.RowPostPaint += DataGridView1_RowPostPaint; dataGridView1.DataSource = QueryList.Tables[0]; for (int i = 0; i < QueryList.Tables[0].Rows.Count;) { //if (CommonFuction.IsNullOrWhiteSpace(QueryList.Tables[0].Rows[i]["DEFECTDATE"])) if (!QueryList.Tables[0].Rows[i]["state"].ToString().Equals("STATE_SCRAPPED") && !QueryList.Tables[0].Rows[i]["state"].ToString().Equals("STATE_TERMINATED")) { dataGridView1.Rows[i].Cells["DEFECTDATE"].Value = ""; dataGridView1.Rows[i].Cells["DEFECTDATE"] = new DataGridViewButtonCell(); dataGridView1.Rows[i].Cells["DEFECTDATE"].Value = "폐기"; dataGridView1.CellClick += DataGridView1_CellClick; } i += 1; } } } else if (name.Equals("defect")) { //폐기인 경우 조회 List <SqlParameter> Params = new List <SqlParameter>(); Params.Add(new SqlParameter("@state", "STATE_SCRAPPED,STATE_TERMINATED")); DataSet QueryList = manager.CallSelectProcedure_ds("ManagerListBySelect", Params); if (QueryList.Tables.Count == 0) { MessageBox.Show("ERROR"); } else { dataGridView1.RowPostPaint += DataGridView1_RowPostPaint; dataGridView1.DataSource = QueryList.Tables[0]; for (int j = 0; j < QueryList.Tables[0].Rows.Count;) { if (CommonFuction.IsNullOrWhiteSpace(QueryList.Tables[0].Rows[j]["DEFECTDATE"])) { dataGridView1.Rows[j].Cells["DEFECTDATE"] = new DataGridViewButtonCell(); dataGridView1.Rows[j].Cells["DEFECTDATE"].Value = "폐기"; dataGridView1.CellClick += DataGridView1_CellClick; } j += 1; } } } else if (name.Equals("active")) { //제공인 경우 조회 List <SqlParameter> Params = new List <SqlParameter>(); Params.Add(new SqlParameter("@state", "STATE_ACTIVE")); DataSet QueryList = manager.CallSelectProcedure_ds("ManagerListBySelect", Params); if (QueryList.Tables.Count == 0) { MessageBox.Show("ERROR"); } else { dataGridView1.RowPostPaint += DataGridView1_RowPostPaint; dataGridView1.DataSource = QueryList.Tables[0]; for (int t = 0; t < QueryList.Tables[0].Rows.Count;) { if (CommonFuction.IsNullOrWhiteSpace(QueryList.Tables[0].Rows[t]["DEFECTDATE"])) { dataGridView1.Rows[t].Cells["DEFECTDATE"] = new DataGridViewButtonCell(); dataGridView1.Rows[t].Cells["DEFECTDATE"].Value = "폐기"; dataGridView1.CellClick += DataGridView1_CellClick; } t += 1; } } } dataGridView1.MouseClick += DataGridView1_MouseClick; }