Example #1
0
 /// <summary>
 /// MachineVO로 선언한 vo에 각 text의 내용을 담아서 DAC단의 파라미터로 전달
 /// 결과를 Bool 타입으로 받아서 True/False시 확인/오류 메세지 출력
 /// 작성자: 최현호 / 작성일: 210210
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnEdit_Click(object sender, EventArgs e)
 {
     #region 등록 및 수정
     try
     {
         if (label1.Text == "설비정보 등록")
         {
             MachineVO vo = new MachineVO
             {
                 m_info    = txtMInfo.Text,
                 m_name    = txtMName.Text,
                 m_comment = txtComment.Text,
                 m_yn      = cbYN.Text,
             };
             bool result = service.CHH_MachineInsert(vo);
             if (result)
             {
                 MessageBox.Show(Properties.Resources.msgOK);
                 this.Close();
             }
             else
             {
                 MessageBox.Show(Properties.Resources.msgError);
             }
         }
         else if (label1.Text == "설비정보 수정")
         {
             MachineVO vo = new MachineVO
             {
                 m_id      = int.Parse(lblID.Text),
                 m_info    = txtMInfo.Text,
                 m_name    = txtMName.Text,
                 m_comment = txtComment.Text,
                 m_yn      = cbYN.Text,
                 m_uadmin  = LoginVO.user.Name,
                 m_udate   = DateTime.Now.ToShortDateString()
             };
             bool result = service.CHH_MachineUpdate(vo);
             if (result)
             {
                 MessageBox.Show(Properties.Resources.msgOK);
                 this.Close();
             }
             else
             {
                 MessageBox.Show(Properties.Resources.msgError);
             }
         }
     }
     catch (Exception err)
     {
         MessageBox.Show(err.Message);
     }
     #endregion
 }