private void btnWorkCancel_Click(object sender, EventArgs e)
        {
            //수정 시 여러개의 체크박스를 선택하는것을 막음
            dgvCustomerOrder.EndEdit();
            //string sb = string.Empty;
            int cnt = 0;

            //체크가 되었는지 확인
            foreach (DataGridViewRow item in dgvCustomerOrder.Rows)
            {
                if (Convert.ToBoolean(item.Cells[0].Value))
                {
                    cnt++;
                }
            }
            if (cnt == 1) //하나일 경우 PopUp창 띄움
            {
                OrderState_VO vo = new OrderState_VO();
                vo.SALES_WORK_ORDER_ID = dgvCustomerOrder.CurrentRow.Cells[8].Value.ToString();
                vo.WO_QTY_OUT          = Convert.ToInt32(dgvCustomerOrder.CurrentRow.Cells[6].Value);
                vo.ITEM_CODE           = dgvCustomerOrder.CurrentRow.Cells[1].Value.ToString();
                vo.FAC_CODE            = dgvCustomerOrder.CurrentRow.Cells[4].Value.ToString();

                if (MessageBox.Show("작업완료 하시겠습니까?", "제품이동", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    WorkOrderService service = new WorkOrderService();
                    Message          msg     = service.OrderMoveFac(vo);
                    if (msg.IsSuccess)
                    {
                        MessageBox.Show(msg.ResultMessage);
                        GetOrderInfo();
                    }
                    else
                    {
                        MessageBox.Show(msg.ResultMessage);
                        return;
                    }
                }
            }
            else
            {
                MessageBox.Show("하나의 항목씩만 가능합니다.");
                return;
            }
        }
        public Message OrderMoveFac(OrderState_VO vo)
        {
            List <WorkMOVE_VO> list = null;

            using (SqlCommand cmd = new SqlCommand())
            {
                cmd.Connection  = new SqlConnection(this.ConnectionString);
                cmd.CommandText = @"insert into INSTACK(INS_QTY, INS_TYP, INS_WRHS, ITEM_CODE, SALES_WORK_ORDER_ID) values(@INS_QTY, '출고', @INS_WRHS, @ITEM_CODE, @SALES_WORK_ORDER_ID);
                                    insert into INSTACK(INS_QTY, INS_TYP, INS_WRHS, ITEM_CODE, SALES_WORK_ORDER_ID) values(@INS_QTY, '입고', 'M_01', @ITEM_CODE, @SALES_WORK_ORDER_ID);
                                    update WORKORDER set WO_WORK_STATE = '제품이동' where SALES_WORK_ORDER_ID = @SALES_WORK_ORDER_ID;";
                cmd.Parameters.AddWithValue("@INS_QTY", vo.WO_QTY_OUT);
                cmd.Parameters.AddWithValue("@INS_WRHS", vo.FAC_CODE);
                cmd.Parameters.AddWithValue("@ITEM_CODE", vo.ITEM_CODE);
                cmd.Parameters.AddWithValue("@SALES_WORK_ORDER_ID", vo.SALES_WORK_ORDER_ID);
                cmd.Connection.Open();
                int    iResult = cmd.ExecuteNonQuery();
                string result;
                if (iResult > 0)
                {
                    result = "S02";
                }
                else
                {
                    result = "S00";
                }
                Message message = new Message();
                if (result == "S02")
                {
                    message.IsSuccess     = true;
                    message.ResultMessage = "완료 되었습니다.";
                }
                else if (result == "S0")
                {
                    message.IsSuccess     = true;
                    message.ResultMessage = "실패하였습니다.";
                }

                return(message);
            }
        }
        internal Message OrderMoveFac(OrderState_VO vo)
        {
            WorkOrderDAC dac = new WorkOrderDAC();

            return(dac.OrderMoveFac(vo));
        }