예제 #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("존재하지 않는 팔레트 입니다.");
         }
     }
 }
예제 #2
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("작업을 시작해주세요");
            }
        }