Example #1
0
        public bool UpdateBOR(BorVO vo)
        {
            using (SqlCommand cmd = new SqlCommand())
            {
                string sql = "UpdateBOR";

                cmd.Connection  = new SqlConnection(this.ConnectionString);
                cmd.CommandText = sql;
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@bor_id", vo.bor_id);
                cmd.Parameters.AddWithValue("@bor_comment", vo.bor_comment);
                cmd.Parameters.AddWithValue("@bom_id", vo.bom_id);
                cmd.Parameters.AddWithValue("@bor_readytime", vo.bor_readytime);
                cmd.Parameters.AddWithValue("@bor_route", vo.bor_route);
                cmd.Parameters.AddWithValue("@bor_tacktime", vo.bor_tacktime);
                cmd.Parameters.AddWithValue("@bor_yn", vo.bor_yn);
                cmd.Parameters.AddWithValue("@m_id", vo.m_id);
                cmd.Connection.Open();

                var successRow = cmd.ExecuteNonQuery();
                cmd.Connection.Close();
                return(successRow > 0);
            }
        }
Example #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            int su = Convert.ToInt32(txtReadyTime.Text);

            if (su > 36)
            {
                txtReadyTime.Text = "";
                MessageBox.Show("36시간 보다 클 수 없습니다");
                return;
            }
            try
            {
                BorVO vo = new BorVO();
                if (cboP_Name.SelectedIndex == 0 || cboM_name.SelectedIndex == 0 ||
                    cboRoute.SelectedIndex == 0)
                {
                    MessageBox.Show("선택하지 않은 값이 있습니다");
                    this.DialogResult = DialogResult.None;
                    return;
                }
                else
                {
                    vo.bor_comment   = txtComment.Text;
                    vo.bor_readytime = Convert.ToInt32(txtReadyTime.Text);
                    vo.bor_tacktime  = Convert.ToInt32(txtTactTime.Text);
                    vo.m_id          = Convert.ToInt32(cboM_name.SelectedValue);
                    vo.bom_id        = Convert.ToInt32(cboP_Name.SelectedValue);
                    vo.bor_route     = cboRoute.SelectedValue.ToString();
                    vo.bor_yn        = cboYN.SelectedValue.ToString();
                    bool bResult = false;
                    if (mode == EditMode.Input)
                    {
                        bResult = R_survice.InsertBOR(vo);
                        if (bResult)
                        {
                            //      MessageBox.Show("등록성공");
                            this.DialogResult = DialogResult.OK;
                            return;
                        }
                        else if (!bResult)
                        {
                            //  MessageBox.Show("등록실패");
                            this.DialogResult = DialogResult.None;
                            return;
                        }
                    }
                    else if (mode == EditMode.Update)
                    {
                        vo.bor_id = Convert.ToInt32(lblID.Text);
                        bResult   = R_survice.UpdateBOR(vo);
                        if (bResult)
                        {
                            //  MessageBox.Show("수정성공");
                            this.DialogResult = DialogResult.OK;

                            return;
                        }
                        else if (!bResult)
                        {
                            // MessageBox.Show("수정실패");
                            this.DialogResult = DialogResult.None;
                            return;
                        }
                    }
                }
            }
            catch (NullReferenceException err)
            {
                MessageBox.Show("입력되지 않은값이 있습니다, 다시 확인해주세요", "입력확인", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.DialogResult = DialogResult.None;
                return;
            }
            catch (Exception err)
            {
                string str = err.Message;
            }
        }
Example #3
0
 public bool UpdateBOR(BorVO vo)
 {
     return(dac.UpdateBOR(vo));
 }
Example #4
0
 public bool InsertBOR(BorVO vo)
 {
     return(dac.InsertBOR(vo));
 }