/// <summary> /// 선택된 장보 복사후 추가 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AddItem_Click(object sender, RoutedEventArgs e) { EmsChkPlanInfo target = gridMain.SelectedItem as EmsChkPlanInfo; if (null == target) { return; } EmsChkPlanInfo cpy = new EmsChkPlanInfo() { EQP_ID = target.EQP_ID, PART_ID = target.PART_ID, PART_NM = target.PART_NM, PART_SERIAL_NO = 0, ORG_INST_DT = new DateTime(target.ORG_INST_DT.Year, target.ORG_INST_DT.Month, target.ORG_INST_DT.Day), IsNew = true }; int idx = ChkPlanInfoList.IndexOf(target); if (idx == ChkPlanInfoList.Count - 1) { ChkPlanInfoList.Add(cpy); } else { ChkPlanInfoList.Insert(idx, cpy); } }
/// <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); } }