Esempio n. 1
0
 private void lblPalSeq_TextChanged(object sender, EventArgs e)
 {
     if (lblPalSeq.Text.Length >= 4)
     {
         if (GlobalUsage.WorkOrderNo.Equals("설정안됨"))
         {
             MessageBox.Show("작업을 시작해주세요");
             return;
         }
         Pallet_MasterService service = new Pallet_MasterService();
         PalletGoodsVO        item    = service.GetPalletGoods(GlobalUsage.WorkOrderNo, lblBarcodeNo.Text, lblPalSeq.Text);
         if (item != null)
         {
             txtPalletNo.TextBoxText          = item.Pallet_No;
             txtBoxingGrade.TextBoxText       = item.Boxing_Grade_Code;
             txtBoxingGradeDatail.TextBoxText = item.Grade_Detail_Name;
             txtSize.TextBoxText = item.Size_Code;
             if (beforecode.Equals(lblBarcodeNo.Text))
             {
                 if (!txtBFour.TextBoxText.Contains(lblPalSeq.Text))
                 {
                     txtBFour.TextBoxText += ("/" + lblPalSeq.Text);
                 }
             }
             else
             {
                 txtBFour.TextBoxText = lblPalSeq.Text;
             }
         }
         else
         {
             MessageBox.Show("존재하지 않는 팔레트 입니다.");
         }
     }
 }
Esempio n. 2
0
        /// <summary>
        /// 팔레트 삭제
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("정말로 삭제하시겠습니까?", "팔레트삭제", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                Pallet_MasterService service = new Pallet_MasterService();
                if (service.IsPalletInput(txtPalletNo.TextBoxText, GlobalUsage.WorkOrderNo))
                {
                    Program.Log.WriteWarn($"{GlobalUsage.UserName}이(가) 이미 입고한 팔레트를 삭제하려함");
                    MessageBox.Show("이미 입고한 팔레트입니다.");
                    return;
                }

                if (service.DeletePallet(txtPalletNo.TextBoxText, GlobalUsage.WorkOrderNo))
                {
                    Program.Log.WriteInfo($"{GlobalUsage.UserName}이(가) 팔레트({txtPalletNo.TextBoxText}) 삭제에 성공함");
                    MessageBox.Show("팔레트 제거에 성공하였습니다.");
                    GetDatas();
                }
                else
                {
                    Program.Log.WriteInfo($"{GlobalUsage.UserName}이(가) 존재하지 않는 팔레트({txtPalletNo.TextBoxText})를 삭제하려함");
                    MessageBox.Show("팔레트 제거에 실패하였습니다.");
                }
            }
        }
Esempio n. 3
0
 private void btnPalletPrint_Click(object sender, EventArgs e)
 {
     if (!GlobalUsage.WorkOrderNo.Equals("설정안됨"))
     {
         DateTime             now     = DateTime.Now;
         Random               rand    = new Random(now.Millisecond);
         Pallet_MasterService service = new Pallet_MasterService();
         if (string.IsNullOrEmpty(txtPalletNo.TextBoxText))
         {
             MessageBox.Show("팔래트 번호를 입력해주세요");
             return;
         }
         if (string.IsNullOrEmpty(txtBoxingGradeDetail.CodeText))
         {
             MessageBox.Show("등급을 찾기버튼으로 입력해주세요");
             return;
         }
         if (!service.IsExistPallet(txtPalletNo.TextBoxText, GlobalUsage.WorkOrderNo))
         { // 팔레트가 존재하지않으면
             // insert 시도
             bool IsSuccess = service.InsertPallet(
                 new VO.PalletVO()
             {
                 Pallet_No         = txtPalletNo.TextBoxText,
                 Barcode_No        = DateTime.Now.ToString("yyyyMMddHHmmss") + "B",
                 WorkOrderNo       = GlobalUsage.WorkOrderNo,
                 CurrentQty        = Convert.ToInt32(txtPrintPallet.TextBoxText),
                 Grade_Detail_Code = txtBoxingGradeDetail.CodeText,
                 Boxing_Grade_Code = txtBoxingGrade.TextBoxText,
                 Size_Code         = txtSizeCode.TextBoxText,
             }, GlobalUsage.UserID);
             if (IsSuccess)
             { // 성공
                 Program.Log.WriteInfo($"{GlobalUsage.UserName}이(가) 팔레트를 생성함");
                 MessageBox.Show("팔레트가 생성되었습니다.");
                 GetDatas();
             }
             else
             { // 실패
                 Program.Log.WriteInfo($"{GlobalUsage.UserName}이(가) 팔레트 생성에 실패함");
                 MessageBox.Show("팔레트 생성에 실패하였습니다.");
                 return;
             }
         }
         else
         { // 팔레트가 존재하면
             service.UpdatePallet(txtPalletNo.TextBoxText, Convert.ToInt32(txtPrintPallet.TextBoxText), GlobalUsage.WorkOrderNo, txtSizeCode.TextBoxText, GlobalUsage.UserID);
             GetDatas();
         }
         PrintPallet(txtPalletNo.TextBoxText, Convert.ToInt32(txtPrintPallet.TextBoxText));
     }
     else
     {
         Program.Log.WriteInfo($"{GlobalUsage.UserName}이(가) 작업을 시작하지 않고 팔레트 생성하려함");
         MessageBox.Show("작업을 시작해주세요");
     }
 }
Esempio n. 4
0
        private void SearchForm_Load(object sender, EventArgs e)
        {
            InitControlUtil.SetDGVDesign(dgvSearchResult);
            InitControlUtil.AddNewColumnToDataGridView(dgvSearchResult, "등급상세", "Grade_Detail_Name", true, 100, DataGridViewContentAlignment.MiddleLeft, true);
            InitControlUtil.AddNewColumnToDataGridView(dgvSearchResult, "팔레트번호", "Pallet_No", true, 100, DataGridViewContentAlignment.MiddleLeft, true);
            Pallet_MasterService service = new Pallet_MasterService();

            dgvSearchResult.DataSource = service.GetAll(GlobalUsage.WorkOrderNo);
            lblSearch.Text             = "팔레트 목록";
        }
Esempio n. 5
0
        private void txtPalletNo_searchclick(object sender, EventArgs e)
        {
            Pallet_MasterService service = new Pallet_MasterService();
            PalletTodayInVO      item    = service.GetPalletInfo(txtPalletNo.TextBoxText);

            txtPalletNo.TextBoxText          = item.Pallet_No;
            txtSize.TextBoxText              = item.Size_Code;
            txtBoxingGradeDatail.TextBoxText = item.Wc_Code;
            txtBoxingGrade.TextBoxText       = item.Boxing_Grade_Code;
        }
Esempio n. 6
0
        private void btnUnload_Click(object sender, EventArgs e)
        {
            if (!GlobalUsage.WorkOrderNo.Equals("설정안됨"))
            {
                // 검사
                if (dgvBoxing.SelectedRows.Count < 1)
                {
                    Program.Log.WriteInfo($"{GlobalUsage.UserName}이(가) 언로딩하려 했지만 대차를 선택하지 않음");
                    MessageBox.Show("대차를 선택해주세요");
                    return;
                }

                // 팔레트 수량 검사
                Pallet_MasterService pservice = new Pallet_MasterService();
                List <PalletGoodsVO> list     = pservice.GetPalletGoods(GlobalUsage.WorkOrderNo);
                int goodcnt    = Convert.ToInt32(dgvBoxing.SelectedRows[0].Cells[7].Value) * Convert.ToInt32(dgvBoxing.SelectedRows[0].Cells[8].Value);
                int inablecnt  = 0;
                int loadingqty = Convert.ToInt32(dgvBoxing.SelectedRows[0].Cells[5].Value);

                list.ForEach((item) => { inablecnt += (goodcnt - item.Contain_Qty); });

                if (loadingqty > inablecnt)
                {
                    int cnt = ((loadingqty - inablecnt) / goodcnt);
                    if (((loadingqty - inablecnt) % goodcnt) != 0)
                    {
                        cnt++;
                    }
                    MessageBox.Show($"팔래트가 {cnt}개 부족합니다.");
                    return;
                }

                // 포장
                GV_HistoryService service = new GV_HistoryService();
                if (service.UpdateUnload(GlobalUsage.WorkOrderNo, GlobalUsage.UserID, dgvBoxing.SelectedRows[0].Cells[0].Value.ToString(), null, GlobalUsage.WcCode, Convert.ToInt32(dgvBoxing.SelectedRows[0].Cells[5].Value), GlobalUsage.ItemCode, Convert.ToInt64(dgvBoxing.SelectedRows[0].Cells[9].Value), Convert.ToInt32(dgvBoxing.SelectedRows[0].Cells[10].Value.ToString())))
                {
                    Program.Log.WriteInfo($"{GlobalUsage.UserName}이(가) 대차({dgvBoxing.SelectedRows[0].Cells[0].Value.ToString()}) 언로딩에 성공함");
                    GlobalUsage.Prd_Qty = Convert.ToInt32(dgvBoxing.SelectedRows[0].Cells[5].Value);
                    GlobalUsage.Out_Qty = Convert.ToInt32(dgvBoxing.SelectedRows[0].Cells[5].Value);
                    GetDatas();
                }
                else
                {
                    Program.Log.WriteInfo($"{GlobalUsage.UserName}이(가) 대차({dgvBoxing.SelectedRows[0].Cells[0].Value.ToString()}) 언로딩에 실패함");
                    MessageBox.Show("언로딩에 실패하였습니다.");
                }
            }
            else
            {
                Program.Log.WriteInfo($"{GlobalUsage.UserName}이(가) 대차({ dgvBoxing.SelectedRows[0].Cells[0].Value.ToString()})를 언로딩 하려했으나 작업을 시작하지 않음");
                MessageBox.Show("작업을 시작해주세요");
            }
        }
Esempio n. 7
0
        /// <summary>
        /// 팔레트 바코드 출력
        /// </summary>
        /// <param name="palletno"></param>
        /// <param name="count"></param>
        public void PrintPallet(string palletno, int count)
        {
            Program.Log.WriteInfo($"{GlobalUsage.UserName}이(가) 팔레트({palletno}) 바코드 {count}개를 인쇄함");
            Pallet_MasterService service = new Pallet_MasterService();
            DataTable            table   = service.GetPalletToDT(palletno, GlobalUsage.WorkOrderNo, count);

            if (table != null)
            {
                BarcodeReport rpt = new BarcodeReport();
                rpt.DataSource = table;

                ReportPreview frm = new ReportPreview(rpt);
            }
        }
Esempio n. 8
0
        private void btnIn_Click(object sender, EventArgs e)
        {
            if (!GlobalUsage.WorkOrderNo.Equals("설정안됨"))
            {
                //검사
                Pallet_MasterService service = new Pallet_MasterService();
                if (!service.IsExistPallet(txtPalletNo.TextBoxText, GlobalUsage.WorkOrderNo))
                {
                    Program.Log.WriteInfo($"{GlobalUsage.UserName}이(가) 존재하지 않는 팔레트({txtPalletNo.TextBoxText})를 입고하려함");
                    MessageBox.Show("팔레트 번호를 확인해주세요");
                    return;
                }
                if (string.IsNullOrEmpty(txtBFour.TextBoxText))
                {
                    MessageBox.Show("순서코드를 입력해주세요");
                    return;
                }

                // 입고
                List <string> seqs      = new List <string>(txtBFour.TextBoxText.Split('/'));
                bool          isSuccess = service.InputPallet(GlobalUsage.UserID, GlobalUsage.WorkOrderNo, txtPalletNo.TextBoxText, seqs);
                if (!isSuccess)
                {
                    Program.Log.WriteInfo($"{GlobalUsage.UserName}이(가) 팔레트를 입고하려했지만 작업지시번호({GlobalUsage.WorkOrderNo})와 팔레트번호({txtPalletNo.TextBoxText})가 일치하는 포장이력이 존재하지 않음");
                    MessageBox.Show("포장이력이 존재하지 않은 팔레트입니다.");
                    return;
                }
                Program.Log.WriteInfo($"{GlobalUsage.UserName}이(가) 작업지시번호({GlobalUsage.WorkOrderNo})와 팔레트번호({txtPalletNo.TextBoxText})에 대해 팔레트 {seqs.Count}개를 입고함");
                GetDatas();
                lblBarcodeNo.Text = "";
            }
            else
            {
                Program.Log.WriteInfo($"{GlobalUsage.UserName}이(가) 팔레트를 입고하려했지만 작업을 시작하지 않음");
                MessageBox.Show("작업을 시작해주세요");
            }
        }
Esempio n. 9
0
        /// <summary>
        /// 팔레트 바코드 재발행
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnBarcodeRecreate(object sender, EventArgs e)
        {
            if (!GlobalUsage.WorkOrderNo.Equals("설정안됨"))
            {
                Pallet_MasterService service = new Pallet_MasterService();
                if (!service.IsExistPallet(txtPalletNo.TextBoxText, GlobalUsage.WorkOrderNo))
                {
                    Program.Log.WriteInfo($"{GlobalUsage.UserName}이(가) 존재하지 않는 팔레트({txtPalletNo.TextBoxText})의 바코드를 재발행하려함");
                    MessageBox.Show("팔레트 번호를 확인해주세요");
                    GetDatas();
                    return;
                }
                if (service.IsPalletInput(txtPalletNo.TextBoxText, GlobalUsage.WorkOrderNo))
                {
                    Program.Log.WriteWarn($"{GlobalUsage.UserName}이(가) 이미 입고한 팔레트를 재발행하려함");
                    MessageBox.Show("이미 입고한 팔레트입니다.");
                    return;
                }

                string barcodeno = DateTime.Now.ToString("yyyyMMddHHmmss") + "B";
                if (!service.UpdateBarcodeNo(txtPalletNo.TextBoxText, GlobalUsage.WorkOrderNo, barcodeno))
                {
                    Program.Log.WriteInfo($"{GlobalUsage.UserName}이(가) 팔레트({txtPalletNo.TextBoxText})의 바코드를 {barcodeno}로재발행 하려했지만 실패함");
                    MessageBox.Show("바코드 재발행에 실패했습니다.");
                    return;
                }

                GetDatas();
                PrintPallet(txtPalletNo.TextBoxText, Convert.ToInt32(txtCurrentQty.TextBoxText));
            }
            else
            {
                Program.Log.WriteInfo($"{GlobalUsage.UserName}이(가) 작업을 시작하지 않아 팔레트 재발행에 실패함");
                MessageBox.Show("작업을 시작해주세요");
            }
        }
Esempio n. 10
0
        private void GetDatas()
        {
            Pallet_MasterService service = new Pallet_MasterService();

            dgvPalletList.DataSource = service.GetAll(GlobalUsage.WorkOrderNo);
        }
Esempio n. 11
0
        private void GetDatas()
        {
            Pallet_MasterService service = new Pallet_MasterService();

            dgvInPallet.DataSource = service.GetPalletTodayIn(GlobalUsage.WorkOrderNo);
        }
Esempio n. 12
0
        private void GetSearch()
        {
            Pallet_MasterService service = new Pallet_MasterService();

            dgvPalletList.DataSource = service.GetAllByDateTime(GlobalUsage.WorkOrderNo, dtpFromdate.Value, dtpTodate.Value);
        }