/// <summary> /// 부품등록 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void PartAdd_Click(object sender, MouseButtonEventArgs e) { try { using (ECOM001_05P frmPartRef = new ECOM001_05P()) { frmPartRef.ShowDialog(); if (null != frmPartRef.CurrPartRef) { EmsChkPlanInfo _item = new EmsChkPlanInfo() { EQP_ID = CurrentRst.EQP_ID, PART_ID = frmPartRef.CurrPartRef.PART_ID, PART_NM = frmPartRef.CurrPartRef.PART_NM, PART_SERIAL_NO = 0, ORG_INST_DT = DateTime.Now, QtyErrorAction = QtyErrorAction, IsNew = true }; ChkPlanInfoList.Add(_item); gridMain.Focus(); gridMain.CurrentColumn = gridMain.Columns.First(); gridMain.View.FocusedRowHandle = ChkPlanInfoList.Count - 1; } } } catch (Exception err) { this.BaseClass.Error(err); } }
/// <summary> /// 부품 참조 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPartRef_Click(object sender, MouseButtonEventArgs e) { try { DateTime now = DateTime.Now; using (ECOM001_05P frmPartRef = new ECOM001_05P(true)) { frmPartRef.ShowDialog(); if (frmPartRef.liEmsPartRef != null) { foreach (DataMembers.COM.EmsPartRef item in frmPartRef.liEmsPartRef) { // 부품참조 창에서 선택한 데이터와 중복되는 경우 DataMember에 추가하지 않는다. var isDuplicate = this.PartByEqpList.Where(p => p.PART_ID.Equals(item.PART_ID)).Count() > 0 ? true : false; if (isDuplicate == false) { EmsPartByEqp _item = new EmsPartByEqp() { PART_ID = item.PART_ID, PART_NM = item.PART_NM, LIFE_CLE = item.LIFE_CLE, PART_SERIAL_NO = 0, INST_DT = DateTime.Now, INST_QTY = 1, IsNew = true }; PartByEqpList.Add(_item); } } } gridPart.Focus(); gridPart.CurrentColumn = gridPart.Columns.First(); gridPart.View.FocusedRowHandle = PartByEqpList.Count - 1; } } catch (Exception err) { this.BaseClass.Error(err); } }