コード例 #1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            //유효값 확인
            bool bWO      = txtWOcode.Text.Trim().Length > 0;
            bool bQTY     = txtPlanQTY.Text.Trim().Length > 0;
            bool bWorkSEQ = txtWorkSEQ.Text.Trim().Length > 0;

            if (!(bWO || bQTY || bWorkSEQ))
            {
                MessageBox.Show("필수값을 입력해주세요.", "필수값 입력 확인", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }


            //전달 vo 생성
            WORKORDERInsert_VO vo = new WORKORDERInsert_VO();

            vo.WO_Code             = txtWOcode.Text;
            vo.ITEM_CODE           = cboItem.SelectedValue.ToString();
            vo.FCLTS_CODE          = cboFC.SelectedValue.ToString();
            vo.WO_PLAN_DATE        = dtpPlanDate.Value.ToShortDateString();
            vo.WO_PLAN_STARTTIME   = dtpPlanStart.Value.ToShortDateString();
            vo.WO_PLAN_ENDTIME     = dtpPlanEnd.Value.ToShortDateString();
            vo.WO_PLAN_QTY         = int.Parse(txtPlanQTY.Text.Trim());
            vo.WO_WORK_SEQ         = int.Parse(txtWorkSEQ.Text.Trim());
            vo.WO_LAST_MDFR        = LoginInfo.UserInfo.LI_ID;
            vo.WO_LAST_MDFY        = DateTime.Now.ToShortDateString();
            vo.SALES_WORK_ORDER_ID = cboWO.Text;
            vo.PLAN_ID             = cboPlanID.Text;
            vo.WO_REMARK           = txtRemark.Text.Trim();

            //서비스호출
            WorkOrderINService service = new WorkOrderINService();

            if (service.InsertWorkOrder(vo))
            {
                MessageBox.Show("등록되었습니다.", "등록 확인", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
            else
            {
                MessageBox.Show("등록에 실패하였습니다.", "등록 실패", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }