Example #1
0
 /// <summary>
 /// 입력 버튼 이벤드
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void Insert(object sender, EventArgs e)
 {
     try
     {
         if (((FrmMAIN)this.MdiParent).ActiveMdiChild == this)
         {
             FrmItemPopUp frm = new FrmItemPopUp();
             if (frm.ShowDialog() == DialogResult.OK)
             {
                 Search(null, null);
             }
         }
     }
     catch (Exception err)
     {
         this.Log.WriteError($"[[RECV {this.Name}]]:{err.Message}");
     }
 }
Example #2
0
 /// <summary>
 /// 업데이트 버튼 이벤드
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void Update(object sender, EventArgs e)
 {
     try
     {
         if (((FrmMAIN)this.MdiParent).ActiveMdiChild == this)
         {
             dgvitem.EndEdit();
             int    cnt  = 0;
             string code = "";
             //체크가 되었는지 확인
             foreach (DataGridViewRow item in dgvitem.Rows)
             {
                 if (Convert.ToBoolean(item.Cells[1].Value))
                 {
                     code = item.Cells[3].Value.ToString();
                     cnt++;
                 }
             }
             if (cnt < 1)
             {
                 MessageBox.Show("수정할 항목을 선택해주세요.");
                 return;
             }
             if (cnt != 1)
             {
                 MessageBox.Show("하나의 항목씩만 수정 가능 합니다.");
                 return;
             }
             else if (cnt == 1)
             {
                 FrmItemPopUp frm = new FrmItemPopUp(code);
                 if (frm.ShowDialog() == DialogResult.OK)
                 {
                     Search(null, null);
                 }
             }
         }
     }
     catch (Exception err)
     {
         this.Log.WriteError($"[[RECV {this.Name}]]:{err.Message}");
     }
 }