Ejemplo n.º 1
0
        private void GetProductOUT()
        {
            ProductOUTService service = new ProductOUTService();

            dgvProductOUT.DataSource = null;
            dgvProductOUT.DataSource = service.GetProductOUTList();
        }
Ejemplo n.º 2
0
        private void btnMOVE_Click(object sender, EventArgs e)
        {
            dgvProductOUT.EndEdit();
            int cnt = 0;

            //체크가 되었는지 확인
            foreach (DataGridViewRow item in dgvProductOUT.Rows)
            {
                if (Convert.ToBoolean(item.Cells[0].Value))
                {
                    cnt++;
                }
            }
            if (cnt == 1)
            {
                ProductOUT_VO vo = new ProductOUT_VO();
                vo.SALES_WORK_ORDER_ID = dgvProductOUT.CurrentRow.Cells[1].Value.ToString();
                vo.SALES_COM_CODE      = dgvProductOUT.CurrentRow.Cells[5].Value.ToString();
                vo.ITEM_CODE           = dgvProductOUT.CurrentRow.Cells[6].Value.ToString();
                vo.WO_PLAN_QTY         = Convert.ToInt32(dgvProductOUT.CurrentRow.Cells[8].Value);
                vo.INS_QTY             = Convert.ToInt32(dgvProductOUT.CurrentRow.Cells[9].Value); //현재 창고 안의 재고수량
                vo.OUTed_QTY           = Convert.ToInt32(dgvProductOUT.CurrentRow.Cells[10].Value);
                vo.OUTing_QTY          = Convert.ToInt32(dgvProductOUT.CurrentRow.Cells[11].Value);
                if (vo.INS_QTY < vo.OUTing_QTY)
                {
                    MessageBox.Show("출고수량이 현 창고의 재고수량보다 많을 수 없습니다.");
                    return;
                }
                if (vo.WO_PLAN_QTY < vo.OUTed_QTY + vo.OUTing_QTY)
                {
                    MessageBox.Show("출고 수량이 주문수량을 초과합니다.");
                    return;
                }
                if (vo.OUTing_QTY == 0)
                {
                    MessageBox.Show("출고할 수량을 입력하여 주십시오.");
                    return;
                }

                ProductOUTService service = new ProductOUTService();
                Message           msg     = service.ProductOUT(vo, LoginInfo.UserInfo.LI_NAME);
                if (msg.IsSuccess)
                {
                    MessageBox.Show(msg.ResultMessage);
                    this.DialogResult = DialogResult.OK;
                    GetProductOUT();
                }
                else
                {
                    MessageBox.Show(msg.ResultMessage);
                    return;
                }
            }
            else
            {
                MessageBox.Show("하나의 항목씩만 가능");
                return;
            }
        }
        private void btnProductOUTCancel_Click(object sender, EventArgs e)
        {
            dgvProductOUTState.EndEdit();
            int cnt = 0;

            foreach (DataGridViewRow item in dgvProductOUTState.Rows)
            {
                if (Convert.ToBoolean(item.Cells[0].Value))
                {
                    cnt++;
                }
            }
            if (cnt == 1)
            {
                ProductOUT_VO vo = new ProductOUT_VO();
                vo.SALES_WORK_ORDER_ID = dgvProductOUTState.CurrentRow.Cells[1].Value.ToString();
                vo.SALES_COM_CODE      = dgvProductOUTState.CurrentRow.Cells[5].Value.ToString();       //고객사 창고
                vo.ITEM_CODE           = dgvProductOUTState.CurrentRow.Cells[6].Value.ToString();
                vo.WO_PLAN_QTY         = Convert.ToInt32(dgvProductOUTState.CurrentRow.Cells[8].Value); //주문수량
                vo.OUTed_QTY           = Convert.ToInt32(dgvProductOUTState.CurrentRow.Cells[9].Value); //출고된 수량

                if (vo.WO_PLAN_QTY == vo.OUTed_QTY)
                {
                    MessageBox.Show("이미 출고 완료된 상태입니다.");
                    return;
                }
                if (MessageBox.Show($"{vo.SALES_WORK_ORDER_ID} 출하 취소 하시겠습니까?", "출하취소", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    ProductOUTService service = new ProductOUTService();
                    Message           msg     = service.ProductOUTCancel(vo, LoginInfo.UserInfo.LI_NAME);
                    if (msg.IsSuccess)
                    {
                        MessageBox.Show(msg.ResultMessage);
                        this.DialogResult = DialogResult.OK;
                        GetProductOUTStateList();
                    }
                    else
                    {
                        MessageBox.Show(msg.ResultMessage);
                        return;
                    }
                }
            }
            else
            {
                MessageBox.Show("하나의 항목씩만 가능");
                return;
            }
        }
Ejemplo n.º 4
0
        public void Search(object sender, EventArgs e)
        {
            try
            {
                string id      = txtID.Text;
                string item    = txtITEM.Text;
                string company = txtCompany.Text;

                ProductOUTService service = new ProductOUTService();
                dgvProductOUT.DataSource = null;
                dgvProductOUT.DataSource = service.SearchProductOUT(id, item, company);
            }
            catch (Exception err)
            {
                _logging = new LoggingUtility(this.Name, Level.Info, 30);
            }
        }