Example #1
0
        private void MaterialReceiving_Load(object sender, EventArgs e)
        {
            dtpStartDate.Value = DateTime.Now;
            dtpEndDate.Value   = DateTime.Now.AddMonths(+1);

            //발주업체, 주문상태 콤보박스 바인딩
            OrderService          oService = new OrderService();
            MaterialLedgerService mService = new MaterialLedgerService();

            CompanyList    = new List <CompanyVO>();
            orderStateList = new List <OrderStateVO>();

            try
            {
                CompanyList = oService.GetCompanyAll("customer");
                ComboUtil.ComboBinding(cboCompany, CompanyList, "company_code", "company_name", "선택");

                orderStateList = mService.GetOrderState();
                ComboUtil.ComboBinding(cboOrderState, orderStateList, "state_code", "state_name", "선택");
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }

            SetDataGridWatingReceiving();
            SetDataGridResult();
        }
Example #2
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            //조회 버튼
            try
            {
                SupplierVO vo = new SupplierVO();
                vo.start_date = dtpStartDate.Value.ToShortDateString();
                vo.end_date   = dtpEndDate.Value.ToShortDateString();

                if (cboCompany.Text != "선택")
                {
                    vo.company_name = cboCompany.Text;
                }

                if (cboOrderState.Text != "선택")
                {
                    vo.order_state = cboOrderState.SelectedValue.ToString();
                }

                MaterialLedgerService service = new MaterialLedgerService();
                dt = service.GetWatingReceivingList(vo);

                dgvWatingList.DataSource = dt;
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Example #3
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            //입고처리 버튼
            //order_state = P_COMPLETE 로 바꾸고
            //warehouse에 insert
            //

            List <MaterialReceivingVO> list = new List <MaterialReceivingVO>();

            foreach (DataGridViewRow row in dgvMaterialReceiving.Rows)
            {
                bool isCellChecked = Convert.ToBoolean(row.Cells["chk"].EditedFormattedValue);
                if (isCellChecked)
                {
                    MaterialReceivingVO vo = new MaterialReceivingVO();
                    vo.order_serial     = row.Cells[1].Value.ToString();
                    vo.product_codename = row.Cells[4].Value.ToString();
                    vo.order_count      = Convert.ToInt32(row.Cells[7].Value);
                    vo.order_pdate      = row.Cells[8].Value.ToString().Trim();
                    vo.product_name     = row.Cells[5].Value.ToString().Trim();
                    vo.order_sdate      = row.Cells[8].Value.ToString().Trim();

                    list.Add(vo);
                }
            }

            if (MessageBox.Show("입고처리하시겠습니까?", "입고처리", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                try
                {
                    MaterialLedgerService service = new MaterialLedgerService();
                    bool result = service.AddMaterialQauntity(list);

                    if (result)
                    {
                        MessageBox.Show("성공적으로 입고처리가 완료되었습니다.", "입고처리", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        dgvMaterialReceiving.Rows.Clear();
                    }
                    else
                    {
                        MessageBox.Show("입고처리 실패하였습니다. 다시 시도하여 주십시오.", "입고처리", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                catch (Exception err)
                {
                    LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
                }
            }
            else
            {
                return;
            }
        }
        private void BtnCancel_Click(object sender, EventArgs e)
        {
            //입고취소 버튼
            List <MaterialReceivingVO> list = new List <MaterialReceivingVO>();

            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                bool isCellChecked = Convert.ToBoolean(row.Cells["chk"].EditedFormattedValue);
                if (isCellChecked)
                {
                    MaterialReceivingVO vo = new MaterialReceivingVO();
                    vo.order_serial     = row.Cells[1].Value.ToString();
                    vo.product_codename = row.Cells[4].Value.ToString();
                    vo.order_count      = Convert.ToInt32(row.Cells[7].Value);
                    vo.product_name     = row.Cells[5].Value.ToString();

                    list.Add(vo);
                }
            }

            MaterialLedgerService service = new MaterialLedgerService();

            if (MessageBox.Show("입고 취소하시겠습니까?", "입고취소", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                try
                {
                    bool result = service.CancelMaterial(list);

                    if (result)
                    {
                        MessageBox.Show("성공적으로 입고취소가 완료되었습니다.", "입고취소", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        SetBottomStatusLabel("성공적으로 입고취소가 완료되었습니다.");
                        btnSearch.PerformClick();
                    }
                    else
                    {
                        MessageBox.Show("입고취소 실패하였습니다. 다시 시도하여 주십시오.", "입고취소", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        SetBottomStatusLabel("입고취소 실패하였습니다. 다시 시도하여 주십시오.");
                    }
                }
                catch (Exception err)
                {
                    LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
                }
            }
            else
            {
                return;
            }
        }
        private void BtnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                MaterialSearchVO vo = new MaterialSearchVO();
                vo.startDate = dtpStartDate.Value.ToShortDateString();
                vo.endDate   = dtpEndDate.Value.ToShortDateString();

                if (cboCompany.Text != "선택")
                {
                    vo.company_name = cboCompany.Text;
                }
                if (cboFactory.Text != "선택")
                {
                    vo.factory_name = cboFactory.Text;
                }
                if (txtOrderSerial.Text != "")
                {
                    vo.order_serial = txtOrderSerial.Text;
                }
                if (txtProduct.Text != "")
                {
                    vo.product_name = txtProduct.Text;
                }

                //조회 버튼
                MaterialLedgerService service = new MaterialLedgerService();
                DataTable             dt      = service.GetMaterialInList(vo);
                SetDataGrid();
                dataGridView1.DataSource = dt;
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }