コード例 #1
0
        private void DGV_Binding()
        {
            BORService service = new BORService();

            borList           = service.GetBORList();
            dgvBOR.DataSource = borList;
        }
コード例 #2
0
        /// <summary>
        /// 삭제
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void newBtns_btnDelete_Event(object sender, EventArgs e)
        {
            if (BOR_id == 0)
            {
                MessageBox.Show("선택된 항목이 없습니다");
                return;
            }

            try
            {
                BORService service = new BORService();
                bool       bResult = service.BORDelete(BOR_id);
                if (bResult)
                {
                    MessageBox.Show("선택항목이 삭제되었습니다");
                }
                else
                {
                    MessageBox.Show("삭제중 오류가 발생했습니다 다시 시도해주세요");
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }
コード例 #3
0
        /// <summary>
        /// 조회버튼
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSearch_Click(object sender, EventArgs e)
        {
            BOR_id           = m_id = bor_tattime = 0;
            product_id       = process_name = bor_yn = bor_comment = bor_uadmin = bor_udate =
                product_name = m_name = "";

            string pid   = "";
            int    mid   = 0;
            string pname = "";

            if (cboProduct.SelectedIndex > 0)
            {
                pid = cboProduct.SelectedValue.ToString();
            }
            if (cboMachine.SelectedIndex > 0)
            {
                mid = Convert.ToInt32(cboMachine.SelectedValue);
            }
            if (cboProcess.SelectedIndex > 0)
            {
                pname = cboProcess.Text;
            }
            try
            {
                BORService service = new BORService();
                borList = service.SearchBorList(pid, mid, pname);
                if (borList.Count == 0)
                {
                    MessageBox.Show("조회 결과가 없습니다.");
                    return;
                }
                dgvBOR.DataSource = borList;
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }
コード例 #4
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            if (cboProductName.SelectedIndex < 1 || cboMachine.SelectedIndex < 1 || cboProcessName.SelectedIndex < 1 ||
                txtTactTime.Text.Trim().Length < 1 || cboYN.SelectedIndex < 1)
            {
                MessageBox.Show("필수항목을 채워주세요");
                return;
            }
            try
            {
                if (headName == "BOR추가")
                {
                    BORVO bor = new BORVO
                    {
                        product_id   = cboProductName.SelectedValue.ToString(),
                        process_name = cboProcessName.Text,
                        m_id         = Convert.ToInt32(cboMachine.SelectedValue),
                        bor_tacttime = Convert.ToInt32(txtTactTime.Text),
                        bor_yn       = cboYN.Text,
                        bor_comment  = txtComment.Text,
                        bor_uadmin   = txtUadmin.Text
                    };

                    BORService service = new BORService();
                    bool       bResult = service.BORInsert(bor);
                    if (bResult)
                    {
                        MessageBox.Show("새로운 BOR를 등록하셨습니다");
                    }
                    else
                    {
                        MessageBox.Show("등록에 실패하셨습니다");
                    }
                }
                else if (headName == "BOR수정")
                {
                    BORVO bor = new BORVO
                    {
                        BOR_id       = bor_id,
                        product_id   = cboProductName.SelectedValue.ToString(),
                        process_name = cboProcessName.Text,
                        m_id         = Convert.ToInt32(cboMachine.SelectedValue),
                        bor_tacttime = Convert.ToInt32(txtTactTime.Text),
                        bor_yn       = cboYN.Text,
                        bor_comment  = txtComment.Text,
                        bor_uadmin   = txtUadmin.Text
                    };

                    BORService service = new BORService();
                    bool       bResult = service.BORUpdate(bor);
                    if (bResult)
                    {
                        MessageBox.Show("BOR항목을 수정하셨습니다");
                    }
                    else
                    {
                        MessageBox.Show("수정에 실패하셨습니다");
                    }
                }

                this.Close();
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }