Ejemplo n.º 1
0
        public override void OnBarcodeDataReceived(BarcodeDataReceivedEvent_ dataReceivedEvent)
        {
            IList <BarcodeDataReceivedEvent_.BarcodeData_> listBarcodeData = dataReceivedEvent.BarcodeData;

            foreach (BarcodeDataReceivedEvent_.BarcodeData_ barcodeData in listBarcodeData)
            {
                this.Activity.RunOnUiThread(() =>
                {
                    string data = barcodeData.Data;

                    if (etReceipt.HasFocus)
                    {
                        string barcode_toku_todo = data.Substring(1, 8);
                        if (data[0] != 'J')
                        {
                            ShowDialog("エラー", "受領書ではありません。", () => { etTodokesaki.RequestFocus(); });
                            return;
                        }

                        if (barcode_toku_todo != etTokuisaki.Text + etTodokesaki.Text)
                        {
                            ShowDialog("エラー", "納入先店舗が違います。", () => { });
                            return;
                        }

                        etReceipt.Text = data;
                        Confirm();
                    }
                });
            }
        }
Ejemplo n.º 2
0
        public void OnBarcodeDataReceived(BarcodeDataReceivedEvent_ dataReceivedEvent)
        {
            Fragment     localFragment = FragmentManager.FindFragmentById(Resource.Id.fragmentContainer);
            BaseFragment baseFragment  = localFragment as BaseFragment;

            ((BaseFragment)localFragment).OnBarcodeDataReceived(dataReceivedEvent);
        }
Ejemplo n.º 3
0
        public override void OnBarcodeDataReceived(BarcodeDataReceivedEvent_ dataReceivedEvent)
        {
            IList <BarcodeDataReceivedEvent_.BarcodeData_> listBarcodeData = dataReceivedEvent.BarcodeData;

            foreach (BarcodeDataReceivedEvent_.BarcodeData_ barcodeData in listBarcodeData)
            {
                this.Activity.RunOnUiThread(() =>
                {
                    string data = barcodeData.Data;
                    MbFileHelper mbFileHelper = new MbFileHelper();

                    if (mbFileHelper.HasExistMailBagData(data))
                    {
                        // 이미 스캔되었는지 확인
                        if (CheckMailBagData(data))
                        {
                            ShowDialog("報告", "既にスキャン済みです。", () => { });
                            return;
                        }

                        string btvTokuisaki  = data.Substring(1, 4);
                        string btvTodokesaki = data.Substring(5, 4);

                        // 해당 바코드가 토쿠이,토도케 값이 맞는지 확인.
                        if (tokuisakiCd != btvTokuisaki || todokesakiCd != btvTodokesaki)
                        {
                            ShowDialog("エラー", "納入先店舗が違います。", () => { });
                            return;
                        }

                        // 전송용DB에 해당 메일백에 대한 레코드 등록
                        InsertSndMailInfo(data);

                        // 메일백수 +1
                        int mail_bag_su = prefs.GetInt("mail_bag_su", 0) + 1;
                        editor.PutInt("mail_bag_su", mail_bag_su);
                        editor.Apply();

                        etMailBagNumber.Text = mail_bag_su.ToString();

                        // 최대 메일백수에 도달하면 메일백 납품완료
                        if (mail_bag_su == mailbackCnt)
                        {
                            editor.PutBoolean("mailBagFlag", true);
                            // ("   =メールバッグ=   ")
                            // ("メールバッグの")
                            // ("納品が完了しました。")
                            editor.PutString("menu_flg", "1");
                            editor.Apply();
                            StartFragment(FragmentManager, typeof(NohinCompleteFragment));
                        }
                    }
                    else
                    {
                        ShowDialog("エラー", "該当メールバッグはありません。", () => { });
                        return;
                    }
                });
            }
        }
Ejemplo n.º 4
0
        public override void OnBarcodeDataReceived(BarcodeDataReceivedEvent_ dataReceivedEvent)
        {
            IList <BarcodeDataReceivedEvent_.BarcodeData_> listBarcodeData = dataReceivedEvent.BarcodeData;

            foreach (BarcodeDataReceivedEvent_.BarcodeData_ barcodeData in listBarcodeData)
            {
                this.Activity.RunOnUiThread(() =>
                {
                    string densoSymbology = barcodeData.SymbologyDenso;
                    string data           = barcodeData.Data;
                    int barcodeDataLength = data.Length;

                    if (etSyukaDate.HasFocus)
                    {
                        // todo?
                    }
                    else if (etTokuisaki.HasFocus)
                    {
                        etTokuisaki.Text = data;
                        etTodokesaki.RequestFocus();
                    }
                    else if (etTodokesaki.HasFocus)
                    {
                        etTodokesaki.Text = data;
                        confirmButton.CallOnClick();
                    }
                });
            }
        }
Ejemplo n.º 5
0
        public override void OnBarcodeDataReceived(BarcodeDataReceivedEvent_ dataReceivedEvent)
        {
            IList <BarcodeDataReceivedEvent_.BarcodeData_> listBarcodeData = dataReceivedEvent.BarcodeData;

            foreach (BarcodeDataReceivedEvent_.BarcodeData_ barcodeData in listBarcodeData)
            {
                string kamotsu_no = barcodeData.Data;

                // スキャン重複チェック
                if (kamotuList.FindIndex(x => x == kamotsu_no) != -1)
                {
                    Activity.RunOnUiThread(() => {
                        ShowDialog("報告", "同一の商品です。", () => { });
                    });
                    return;
                }

                if (menuFlag == 1) // 単品移動
                {
                    SettingTanpinMotoInfo(kamotsu_no);
                }
                else if (menuFlag == 2) // 全品移動
                {
                    SettingZenpinMotoInfo(kamotsu_no);
                }
                else if (menuFlag == 3) // マテハン移動
                {
                    SettingMateInfo(kamotsu_no);
                }
            }
        }
Ejemplo n.º 6
0
        public override void OnBarcodeDataReceived(BarcodeDataReceivedEvent_ dataReceivedEvent)
        {
            IList <BarcodeDataReceivedEvent_.BarcodeData_> listBarcodeData = dataReceivedEvent.BarcodeData;

            Activity.RunOnUiThread(async() => {
                // 最大個数チェック
                bool isMax = int.Parse(txtTotal.Text) + 1 > kosuMax;

                if (isMax)
                {
                    // 最大検品数を超えた場合
                    var result = await DialogAsync.Show(Activity, "警告", "検品数が" + kosuMax + "を超えています。続けますか?");
                    if (result.Value)
                    {
                        CountItem(listBarcodeData);
                    }
                    else
                    {
                        GoMantanPage();
                    }
                }
                else
                {
                    CountItem(listBarcodeData);
                }
            });
        }
Ejemplo n.º 7
0
        public override void OnBarcodeDataReceived(BarcodeDataReceivedEvent_ dataReceivedEvent)
        {
            IList <BarcodeDataReceivedEvent_.BarcodeData_> listBarcodeData = dataReceivedEvent.BarcodeData;

            foreach (BarcodeDataReceivedEvent_.BarcodeData_ barcodeData in listBarcodeData)
            {
                this.Activity.RunOnUiThread(() =>
                {
                    string densoSymbology = barcodeData.SymbologyDenso;
                    string data           = barcodeData.Data;

                    if (etKasidatuTarget.HasFocus)
                    {
                        try
                        {
                            if (data.Length > 0)
                            {
                                etKasidatuTarget.Text = data;

                                string vendorNm = WebService.RequestMate010(data);
                                if (vendorNm == "")
                                {
                                    ShowDialog("報告", "貸出先コードが見つかりません。", () => {
                                        etKasidatuTarget.Text = "";
                                        etKasidatuTarget.RequestFocus();
                                    });
                                }
                                else
                                {
                                    string message = "貸出日:" + etKasidatuDate.Text;
                                    message       += "\n" + "貸出先:" + etKasidatuTarget.Text;
                                    message       += "\n" + "貸出名:\n" + vendorNm;
                                    message       += "\n\n" + "よろしいですか?";

                                    ShowDialog("確認", message, () => {
                                        editor.PutString("vendor_cd", etKasidatuTarget.Text);
                                        editor.PutString("vendor_nm", vendorNm);
                                        editor.PutString("kasidasi_date", etKasidatuDate.Text.Replace("/", ""));

                                        editor.Apply();

                                        StartFragment(FragmentManager, typeof(MatehanWorkFragment));
                                    });
                                }
                            }
                        }
                        catch
                        {
                            ShowDialog("エラー", "貸出先コードが見つかりません。", () => { });
                        }
                    }
                });
            }
        }
Ejemplo n.º 8
0
        public override void OnBarcodeDataReceived(BarcodeDataReceivedEvent_ dataReceivedEvent)
        {
            IList <BarcodeDataReceivedEvent_.BarcodeData_> listBarcodeData = dataReceivedEvent.BarcodeData;

            foreach (BarcodeDataReceivedEvent_.BarcodeData_ barcodeData in listBarcodeData)
            {
                this.Activity.RunOnUiThread(() =>
                {
                    string data = barcodeData.Data;
                });
            }
        }
Ejemplo n.º 9
0
        public override void OnBarcodeDataReceived(BarcodeDataReceivedEvent_ dataReceivedEvent)
        {
            IList <BarcodeDataReceivedEvent_.BarcodeData_> listBarcodeData = dataReceivedEvent.BarcodeData;

            foreach (BarcodeDataReceivedEvent_.BarcodeData_ barcodeData in listBarcodeData)
            {
                Activity.RunOnUiThread(() =>
                {
                    string data = barcodeData.Data;

                    if (etCourse.HasFocus)
                    {
                        if (data.Length < 12)
                        {
                            ShowDialog("エラー", "コースNoがみつかりません。", () => { });
                            return;
                        }

                        string btvTmp        = data.Substring(0, 11);                // 配送日(8桁) + センター(3桁)
                        string btvHaisohDate = btvTmp.Substring(2, 4);               // 配送日(YYMMDD)
                        string btvCenterCd   = btvTmp.Substring(6, 3);               // センターコード(3桁)
                        string btvCourse     = data.Substring(11, data.Length - 11); // コース(桁可変)

                        try
                        {
                            string haiso_date = CommonUtils.GetDateYYYYMMDDwithSlash(btvHaisohDate);

                            TUMIKOMI010 result = WebService.RequestTumikomi010(souko_cd, kitaku_cd, syuka_date, btvCourse);

                            if (result.state == "03")
                            {
                                ShowDialog("エラー", "該当コースの積込みは完了しています。", () => { });
                                return;
                            }

                            editor.PutString("syuka_date", syuka_date);
                            editor.PutString("course", btvCourse);
                            editor.PutString("bin_no", result.bin_no);
                            editor.PutString("kansen_kbn", result.kansen_kbn);
                            editor.Apply();

                            ShowConfirmMessage();
                        }
                        catch
                        {
                            ShowDialog("エラー", "コースNoがみつかりません。", () => { });
                            return;
                        }
                    }
                });
            }
        }
Ejemplo n.º 10
0
        // TRG ボタン押した時
        public override void OnBarcodeDataReceived(BarcodeDataReceivedEvent_ dataReceivedEvent)
        {
            IList <BarcodeDataReceivedEvent_.BarcodeData_> listBarcodeData = dataReceivedEvent.BarcodeData;

            foreach (BarcodeDataReceivedEvent_.BarcodeData_ barcodeData in listBarcodeData)
            {
                this.Activity.RunOnUiThread(() =>
                {
                    if (carLabelInputMode == false) // 出荷ラベル
                    {
                        // 出荷ラベル確認処理
                        Thread.Sleep(1500);

                        Dictionary <string, string> param = GetProcParam(barcodeData.Data);
                        try
                        {
                            MTumikomiProc result = WebService.CallTumiKomiProc(kansen_kbn == "0" ? "060" : "310", param);

                            if (result.poMsg != "")
                            {
                                ShowDialog("エラー", result.poMsg, () => { });
                                return;
                            }

                            matehan     = result.poMatehan;
                            etKosu.Text = result.poKosuCnt;

                            //	正常登録
                            carLabelInputMode   = true;
                            _IdouButton.Enabled = false;
                            etCarLabel.SetBackgroundColor(Android.Graphics.Color.Yellow);
                            etKosu.SetBackgroundColor(Android.Graphics.Color.White);
                        }
                        catch
                        {
                            ShowDialog("エラー", "更新出来ませんでした。\n再度商品をスキャンして下さい。", () => { });
                            return;
                        }
                    }
                    else // 車両ラベル
                    {
                        // 作業ステータス更新・積込処理
                        etCarLabel.Text = barcodeData.Data;
                        UpdateSagyoStatus(barcodeData.Data);
                    }
                });
            }
        }
Ejemplo n.º 11
0
        public override void OnBarcodeDataReceived(BarcodeDataReceivedEvent_ dataReceivedEvent)
        {
            IList <BarcodeDataReceivedEvent_.BarcodeData_> listBarcodeData = dataReceivedEvent.BarcodeData;

            foreach (BarcodeDataReceivedEvent_.BarcodeData_ barcodeData in listBarcodeData)
            {
                this.Activity.RunOnUiThread(() =>
                {
                    string data = barcodeData.Data;

                    if (etKaisyuLabel.HasFocus)
                    {
                        etKaisyuLabel.Text = data;

                        bool result = CheckKaisyuLabel();
                        if (!result)
                        {
                            return;
                        }
                        else
                        {
                            etIdouTokuisaki.Enabled  = true;
                            etIdouTodokesaki.Enabled = true;
                            etIdouTokuisaki.RequestFocus();
                        }
                    }
                    else if (etIdouTokuisaki.HasFocus)
                    {
                        if (etKaisyuLabel.Text == "" || etIdouTenpo.Text == "")
                        {
                            ShowDialog("エラー", "回収ラベルを先に入力してください。", () => { etKaisyuLabel.RequestFocus(); });
                            return;
                        }

                        if (data.Length == 4)
                        {
                            etIdouTokuisaki.Text = data;
                            return;
                        }
                        else if (data.Length == 8)
                        {
                            //得意先チェック
                            string tokuisaki_cd  = data.Substring(0, 4);
                            string todokesaki_cd = data.Substring(4, 4);

                            int count = WebService.RequestKosu020(tokuisaki_cd, todokesaki_cd);
                            if (count == 0)
                            {
                                ShowDialog("エラー", "届先コードがみつかりません。", () => {  });
                                return;
                            }

                            TIDOU002 tidou002 = WebService.RequestTidou002(tokuisaki_cd, todokesaki_cd);

                            editor.PutString("tokuisaki_nm", tidou002.tokuisaki_rk);
                            editor.PutString("area_nm", tidou002.area_nm);
                            etIdouTokuisaki.Text  = tokuisaki_cd;
                            etIdouTodokesaki.Text = todokesaki_cd;

                            string msg = "移動先店舗:" + etIdouTenpo.Text + "\n";
                            msg       += "移動先得意先:" + etIdouTokuisaki.Text + "\n";
                            msg       += "移動先届先:" + etIdouTokuisaki.Text + "\n";
                            msg       += "" + tidou002.area_nm + "\n";

                            ShowDialog("確認", msg, () => {
                                new Thread(new ThreadStart(delegate {
                                    Activity.RunOnUiThread(async() =>
                                    {
                                        var result = await DialogAsync.Show(this.Activity, "", "入荷予定登録を行います。\n\nよろしいですか。");
                                        if (result == false)
                                        {
                                            return;
                                        }

                                        string terminal_id  = "432660068";
                                        string sagyousya_cd = "99999";
                                        string souko_cd     = prefs.GetString("souko_cd", "");
                                        string kitaku_cd    = prefs.GetString("kitaku_cd", "");
                                        string kaisyubi     = prefs.GetString("kaisyu_date", "");
                                        string haisoubi     = prefs.GetString("haisou_date", "");
                                        string kaisyu_label = etKaisyuLabel.Text;

                                        Dictionary <string, string> param = new Dictionary <string, string>
                                        {
                                            { "pPackage", "01" },
                                            { "pTerminalId", terminal_id },
                                            { "pProgramId", "TIDO" },
                                            { "pSagyosyaCd", sagyousya_cd },
                                            { "pSoukoCd", souko_cd },
                                            { "pKitakuCd", kitaku_cd },
                                            { "pKaisyuDate", kaisyubi },
                                            { "pHaisohDate", haisoubi },
                                            { "pKamotuNo", kaisyu_label },
                                            { "pTokuisakiCd", tokuisaki_cd },
                                            { "pTodokesakiCd", todokesaki_cd }
                                        };

                                        TIDOU010 tidou010 = WebService.RequestTidou010(param);

                                        if (tidou010.poRet == "0")
                                        {
                                            //	正常登録
                                            ShowDialog("報告", "登録しました", () => { FragmentManager.PopBackStack(); });
                                        }
                                        else if (tidou010.poRet == "1")
                                        {
                                            ShowDialog("報告", "登録済みです。", () => { });
                                        }
                                        else if (tidou010.poRet == "2")
                                        {
                                            ShowDialog("エラー", "回収対象の貨物がありません。", () => { });
                                        }
                                        else if (tidou010.poRet == "3")
                                        {
                                            ShowDialog("エラー", "店間移動ベンダーがセンターマスタに設定されていません。", () => { });
                                        }
                                        else if (tidou010.poRet == "4")
                                        {
                                            ShowDialog("エラー", "店間移動ベンダーがベンダーマスタに存在しません。", () => { });
                                        }
                                        else if (tidou010.poRet == "5")
                                        {
                                            ShowDialog("エラー", "店間移動先センターコードがセンターマスタに存在しません。", () => { });
                                        }
                                        else if (tidou010.poRet == "6")
                                        {
                                            ShowDialog("エラー", "店間移動先コースがコース割付マスタに存在しません。", () => { });
                                        }
                                        else if (tidou010.poRet == "7")
                                        {
                                            ShowDialog("エラー", "店間移動先コースがコースマスタに存在しません。", () => { });
                                        }
                                        else
                                        {
                                            ShowDialog("エラー", "入荷予定データ作成に失敗しました。", () => { });
                                        }
                                    });
                                }
                                                           )).Start();
                            });
                        }
                    }
                });
            }
        }
Ejemplo n.º 12
0
 public virtual void OnBarcodeDataReceived(BarcodeDataReceivedEvent_ dataReceivedEvent)
 {
     return;
 }
Ejemplo n.º 13
0
        public override void OnBarcodeDataReceived(BarcodeDataReceivedEvent_ dataReceivedEvent)
        {
            IList <BarcodeDataReceivedEvent_.BarcodeData_> listBarcodeData = dataReceivedEvent.BarcodeData;

            foreach (BarcodeDataReceivedEvent_.BarcodeData_ barcodeData in listBarcodeData)
            {
                this.Activity.RunOnUiThread(() =>
                {
                    string sakikamotu_no = barcodeData.Data;

                    if (btvScnFlg > 0)
                    {
                        ShowDialog("エラー", "既にスキャン済みです", () => { });
                        return;
                    }

                    if (menuFlag == 1)
                    {
                        // 単品移動

                        // 移動先バーコードチェック
                        if (CheckScanNo(sakikamotu_no) == false)
                        {
                            return;
                        }

                        // 移動先マテハンの貨物リストを取得する。
                        List <IDOU010> idou010List = WebService.RequestIdou010(souko_cd, kitaku_cd, sakikamotu_no);

                        if (idou010List.Count == 0)
                        {
                            ShowDialog("報告", "表示データがありません", () => { });
                            return;
                        }

                        // 遷移先マテハン設定
                        foreach (IDOU010 idou010 in idou010List)
                        {
                            if (idou010.matehan.Substring(2) == idou010.matehan)
                            {
                                ShowDialog("エラー", "バラへの移動は出来ません", () => { });
                                return;
                            }

                            if (prefs.GetString("motomate_cd", "") == idou010.matehan)
                            {
                                ShowDialog("エラー", "同一のマテハンです", () => { });
                                return;
                            }

                            SetMatehan(idou010.bunrui, int.Parse(idou010.cnt));
                        }

                        sakiMatehanCd = idou010List[0].matehan;
                        sakiKamotsuNo = sakikamotu_no;
                        //sakikamotu_no
                        btnConfirm.Enabled = true;
                    }
                    else if (menuFlag == 2)
                    {
                        // 全品移動

                        // 移動先バーコードチェック
                        if (CheckScanNo(sakikamotu_no) == false)
                        {
                            return;
                        }

                        // 移動先マテハンの貨物リストを取得する。
                        List <IDOU020> idou020List = WebService.RequestIdou020(souko_cd, kitaku_cd, sakikamotu_no);

                        if (idou020List.Count == 0)
                        {
                            ShowDialog("報告", "表示データがありません", () => { });
                            return;
                        }

                        // 遷移先マテハン設定
                        foreach (IDOU020 idou020 in idou020List)
                        {
                            if (idou020.matehan.Substring(0, 2) == idou020.bara_matehan)
                            {
                                ShowDialog("エラー", "バラへの移動は出来ません", () => { });
                                return;
                            }

                            if (prefs.GetString("motomate_cd", "") == idou020.matehan)
                            {
                                ShowDialog("エラー", "同一のマテハンです", () => { });
                                return;
                            }

                            SetMatehan(idou020.bunrui, int.Parse(idou020.cnt));
                        }

                        sakiKamotsuNo      = sakikamotu_no;
                        btnConfirm.Enabled = true;
                    }

                    btnConfirm.Visibility = ViewStates.Visible;
                    btvScnFlg             = 1;
                });
            }
        }
Ejemplo n.º 14
0
        public override void OnBarcodeDataReceived(BarcodeDataReceivedEvent_ dataReceivedEvent)
        {
            IList <BarcodeDataReceivedEvent_.BarcodeData_> listBarcodeData = dataReceivedEvent.BarcodeData;

            foreach (BarcodeDataReceivedEvent_.BarcodeData_ barcodeData in listBarcodeData)
            {
                this.Activity.RunOnUiThread(() =>
                {
                    string data = barcodeData.Data;

                    // メールバッグ専用バーコード確認
                    if (data[0].ToString() != "M")
                    {
                        ShowDialog("エラー", ERR1, () => { });
                        return;
                    }
                    else
                    {
                        etMailBag.Text = data;
                    }

                    // メールバック登録処理
                    Dictionary <string, string> param = new Dictionary <string, string>
                    {
                        { "pTerminalID", prefs.GetString("terminal_id", "") },
                        { "pProgramID", "MBA" },
                        { "pSagyosyaCD", prefs.GetString("sagyousya_cd", "") },
                        { "pSoukoCD", prefs.GetString("souko_cd", "") },
                        { "pHaisoDate", prefs.GetString("haiso_date", "") },
                        { "pTokuisakiCD", data.Substring(1, 4) },
                        { "pTodokesakiCD", data.Substring(5, 4) },
                        { "pKanriNo", data },
                        { "pBinNo", prefs.GetString("bin_no", "") },
                    };

                    if (registFlg)
                    {
                         
                        {
                            // メールバック登録処理
                            Dictionary <string, string> result = WebService.RequestMAIL010(param);

                            switch (result["poRet"].ToString())
                            {
                            case "0":
                                //	登録解除
                                mail_back++;
                                mailBagSu.Text = "(" + mail_back + ")";
                                Vibrate();
                                break;

                            case "1":
                                //	該当コースが既に積込中以上のステータスのためエラー
                                ShowDialog("エラー", ERR3, () => etMailBag.Text = "");
                                break;

                            case "2":
                                //	該当コースが既に出発受付以上のステータスのためエラー
                                ShowDialog("エラー", ERR4, () => etMailBag.Text = "");
                                break;

                            case "3":
                                //	コース割付マスタに存在しないためエラー
                                ShowDialog("エラー", ERR5, () => etMailBag.Text = "");
                                Vibrate();
                                break;

                            case "9":
                                //	登録済
                                ShowDialog("エラー", ERR2, () => etMailBag.Text = "");
                                break;

                            default:
                                break;
                            }
                        }
                    }
                    else
                    {
                        // メールバック削除処理
                        Dictionary <string, string> result = WebService.RequestMAIL030(param);

                        switch (int.Parse(result["poRet"]))
                        {
                        case 0:
                            mail_back++;
                            mailBagSu.Text = "(" + mail_back + ")";
                            ShowDialog("報告", "登録されているメールバッグを取消しました。", () => etMailBag.Text = "");
                            break;

                        case 1:
                            ShowDialog("報告", "該当のメールバッグは未登録です。", () => etMailBag.Text = "");
                            break;

                        case 2:
                            ShowDialog("報告", "該当のメールバッグは出発点呼済です。", () => etMailBag.Text = "");
                            break;

                        case 3:
                            ShowDialog("報告", "マスタに存在しない店舗のメールバッグをスキャンしました。", () => etMailBag.Text = "");
                            break;

                        default:
                            break;
                        }
                    }
                });
            }
        }
Ejemplo n.º 15
0
        public override void OnBarcodeDataReceived(BarcodeDataReceivedEvent_ dataReceivedEvent)
        {
            IList <BarcodeDataReceivedEvent_.BarcodeData_> listBarcodeData = dataReceivedEvent.BarcodeData;

            foreach (BarcodeDataReceivedEvent_.BarcodeData_ barcodeData in listBarcodeData)
            {
                string kamotu_no = barcodeData.Data;

                bool  isExist   = false;
                MFile tsumikomi = null;
                foreach (MFile temp in tsumikomiDataList)
                {
                    if (temp.kamotsu_no == kamotu_no)
                    {
                        isExist   = true;
                        tsumikomi = temp;
                        break;
                    }
                }

                new Thread(new ThreadStart(delegate {
                    Activity.RunOnUiThread(() =>
                    {
                        if (!isExist)
                        {
                            ShowDialog("エラー", "該当データがありません。", () => { });
                            return;
                        }

                        SndNohinWorkHelper sndNohinWorkHelper = new SndNohinWorkHelper();
                        if (sndNohinWorkHelper.SelectNohinWorkWithKamotu(kamotu_no).Count > 0)
                        {
                            ShowDialog("エラー", "登録済みです。", () => { });
                            return;
                        }

                        string tokuisaki_cd  = prefs.GetString("tokuisaki_cd", "");
                        string todokesaki_cd = prefs.GetString("todokesaki_cd", "");
                        string matehanCd     = tsumikomi.matehan;

                        List <MFile> mfileList = mFilehelper.SelectByMatehanCd(tokuisaki_cd, todokesaki_cd, matehanCd);

                        if (mfileList.Count > 0)
                        {
                            foreach (SndNohinWork temp in sndNohinWorkHelper.SelectAll())
                            {
                                if (mfileList[0].matehan == temp.wMatehan)
                                {
                                    ShowDialog("エラー", "登録済みです。", () => { });
                                    return;
                                }
                            }
                        }
                        else
                        {
                            // err?
                        }

                        tvmatehanNm.Text = mfileList[0].category_nm;

                        int idx      = tvTsumidai.Text.IndexOf('/');
                        int tsumidai = (int.Parse(tvTsumidai.Text.Substring(0, idx)) + 1);

                        // 総個数
                        idx   = tvAll.Text.IndexOf('/');
                        ko_su = int.Parse(tvAll.Text.Substring(0, idx)) + mfileList.Count;

                        if (ko_su <= tsumikomiDataList.Count)
                        {
                            // 画面の数字をカウントアップする
                            tvTsumidai.Text = tsumidai + "/" + matehanCnt;
                            tvAll.Text      = ko_su + "/" + tsumikomiDataList.Count;

                            switch (tsumikomi.bunrui)
                            {
                            case "01": tvCase.Text = (int.Parse(tvCase.Text) + mfileList.Count).ToString(); break;

                            case "02": tvOricon.Text = (int.Parse(tvOricon.Text) + mfileList.Count).ToString(); break;

                            case "03": tvSonota.Text = (int.Parse(tvSonota.Text) + mfileList.Count).ToString(); break;

                            case "04": tvIdo.Text = (int.Parse(tvIdo.Text) + mfileList.Count).ToString(); break;

                            case "05": tvMail.Text = (int.Parse(tvMail.Text) + mfileList.Count).ToString(); break;

                            case "06": tvSonota.Text = (int.Parse(tvSonota.Text) + mfileList.Count).ToString(); break;

                            case "07": tvFuteikei.Text = (int.Parse(tvFuteikei.Text) + mfileList.Count).ToString(); break;

                            case "08": tvSonota.Text = (int.Parse(tvSonota.Text) + mfileList.Count).ToString(); break;

                            case "09": tvHansoku.Text = (int.Parse(tvHansoku.Text) + mfileList.Count).ToString(); break;

                            case "T": tvTc.Text = (int.Parse(tvTc.Text) + mfileList.Count).ToString(); break;

                            default: tvSonota.Text = (int.Parse(tvSonota.Text) + mfileList.Count).ToString(); break;
                            }

                            if (ko_su == tsumikomiDataList.Count)
                            {
                                // レコード作成用 値取得
                                SndNohinWork sndNohinWork = new SndNohinWork
                                {
                                    wPackage          = "02",
                                    wTerminalID       = "432660068",                          //Handy: serialId
                                    wProgramID        = prefs.GetString("program_id", "NOH"), //JOB: program_id
                                    wSagyosyaCD       = prefs.GetString("sagyosya", ""),
                                    wSoukoCD          = mfileList[0].kenpin_souko,
                                    wHaisoDate        = mfileList[0].syuka_date,    // noh_syukaDate
                                    wBinNo            = mfileList[0].bin_no,        //JOB: noh_binNo
                                    wCourse           = mfileList[0].course,        //noh_course
                                    wDriverCD         = mfileList[0].driver_cd,     // noh_driverCd
                                    wTokuisakiCD      = mfileList[0].tokuisaki_cd,  // JOB: noh_tokuisakiCd
                                    wTodokesakiCD     = mfileList[0].todokesaki_cd, // JOB: noh_todokesakiCd
                                    wKanriNo          = "",                         // ""
                                    wVendorCd         = mfileList[0].vendor_cd,     //JOB: vendor_cd
                                    wMateVendorCd     = "",                         // ""
                                    wSyukaDate        = mfileList[0].syuka_date,    //JOB: haiso_date
                                    wButsuryuNo       = "",                         // ""
                                    wKamotuNo         = kamotu_no,                  //JOB: kamotu_no
                                    wMatehan          = mfileList[0].matehan,       // JOB: noh_matehan
                                    wMatehanSu        = matehanCnt.ToString(),      // JOB: tumiko_su
                                    wHHT_no           = "11101",
                                    wNohinKbn         = "0",
                                    wKaisyuKbn        = "",
                                    wTenkanState      = "00",
                                    wSakiTokuisakiCD  = "",
                                    wSakiTodokesakiCD = "",
                                    wNohinDate        = prefs.GetString("nohin_date", ""), //FIX:setFixLength(8, JOB: nohin_date)
                                    wNohinTime        = prefs.GetString("nohin_time", "")  //FIX:setFixLength(4, JOB: nohin_time)
                                };

                                SndNohinWorkHelper nohinWorkHelper = new SndNohinWorkHelper();
                                nohinWorkHelper.Insert(sndNohinWork);

                                editor.PutBoolean("nohinWorkEndFlag", true);
                                editor.Apply();

                                kaizoButton.Visibility     = ViewStates.Gone;
                                nohinWorkButton.Visibility = ViewStates.Visible;

                                return;
                            }
                        }
                    }
                                           );
                }
                                           )).Start();
            }
        }
Ejemplo n.º 16
0
        public override void OnBarcodeDataReceived(BarcodeDataReceivedEvent_ dataReceivedEvent)
        {
            foreach (BarcodeDataReceivedEvent_.BarcodeData_ barcodeData in dataReceivedEvent.BarcodeData)
            {
                string data = barcodeData.Data;

                new Thread(new ThreadStart(delegate {
                    Activity.RunOnUiThread(async() =>
                    {
                        if (data[0].ToString() != "M")
                        {
                            ShowDialog("エラー", "メールバッグではありません。", () => { });
                            Log.Debug(TAG, "MAIN BAG KAISYU INPUT_ERR1:" + data);
                            return;
                        }

                        string btvTokuisaki  = data.Substring(1, 4);
                        string btvTodokesaki = data.Substring(5, 4);

                        // スキャン済みチェック
                        SndNohinMailHelper sendMailHelper = new SndNohinMailHelper();
                        List <SndNohinMail> result        = sendMailHelper.Select(btvTokuisaki, btvTodokesaki, data);
                        if (result.Count != 0)
                        {
                            return;
                        }

                        // 納品メールバッグ重複チェック
                        MbFileHelper mbFileHelper = new MbFileHelper();
                        bool hasData = mbFileHelper.HasExistMailBagData(data);
                        if (true)
                        {
                            var resultYn = await DialogAsync.Show(Activity, "", "回収メールバッグと納入メールバッグが同じですよろしいですか?");

                            if (!resultYn.Value)
                            {
                                return;
                            }
                        }

                        string btvKey1 = btvTokuisaki + btvTodokesaki;
                        string btvKey2 = prefs.GetString("tokuisaki_cd", "") + prefs.GetString("todokesaki_cd", "");

                        if (btvKey1 != btvKey2)
                        {
                            ShowDialog("エラー", "納入先店舗が違います。", () => { });
                            Log.Debug(TAG, "納入先店舗が違います  btvKey1 :" + btvKey1 + "  btvKey2 :" + btvKey2);
                            return;
                        }

                        int idx = arrMailBag.FindIndex(x => x == data);
                        if (idx == -1)
                        {
                            arrMailBag.Add(data);
                            mail_bag++;

                            etKaisyuMail.Text = mail_bag.ToString();
                        }
                        else
                        {
                            ShowDialog("報告", "既にスキャン済みです。", () => { });
                            Log.Debug(TAG, "既にスキャン済みです。 data :" + data);
                            return;
                        }
                    });
                }
                                           )).Start();
            }
        }
Ejemplo n.º 17
0
        public override void OnBarcodeDataReceived(BarcodeDataReceivedEvent_ dataReceivedEvent)
        {
            IList <BarcodeDataReceivedEvent_.BarcodeData_> listBarcodeData = dataReceivedEvent.BarcodeData;

            foreach (BarcodeDataReceivedEvent_.BarcodeData_ barcodeData in listBarcodeData)
            {
                this.Activity.RunOnUiThread(() =>
                {
                    string kamotu_no = barcodeData.Data;

                    if (kamotu_no.Length > 0)
                    {
                        string label_flg = prefs.GetString("label_flg", "0");
                        int btvLen       = int.Parse(kamotu_no[0].ToString());

                        //*** バーコードが納品する届先のものかを確認
                        string btvTokuisaki  = "";
                        string btvTodokesaki = "";

                        if (btvLen == 7)   // 店間移動
                        {
                            btvTokuisaki  = kamotu_no.Substring(1, 4);
                            btvTodokesaki = kamotu_no.Substring(5, 4);
                        }
                        else
                        {
                            btvTokuisaki  = kamotu_no.Substring(9, 4);
                            btvTodokesaki = kamotu_no.Substring(13, 4);
                        }

                        if (btvTokuisaki != prefs.GetString("tokuisaki_cd", "") ||
                            btvTodokesaki != prefs.GetString("todokesaki_cd", ""))
                        {
                            ShowDialog("エラー", "納入先店舗が違います。", () => { });
                            return;
                        }

                        //*** スキャンデータチェック
                        if (ItemCheck(kamotu_no) == -1)
                        {
                            if (label_flg == "0")
                            {
                                ShowDialog("報告", "登録済みです。", () => { });
                                return;
                            }
                            else
                            {
                                ShowDialog("報告", "未登録です。", () => { });
                                return;
                            }
                        }

                        switch (btvLen)
                        {
                        case 5:     // mail
                            if (label_flg == "0")
                            {
                                txtMailSu.Text = (int.Parse(txtMailSu.Text) + 1).ToString();
                            }
                            else
                            {
                                txtMailSu.Text = (int.Parse(txtMailSu.Text) - 1).ToString();
                            }

                            break;

                        case 6:     // mail
                            if (label_flg == "0")
                            {
                                txtHazaiSu.Text = (int.Parse(txtHazaiSu.Text) + 1).ToString();
                            }
                            else
                            {
                                txtHazaiSu.Text = (int.Parse(txtHazaiSu.Text) - 1).ToString();
                            }

                            break;

                        case 7:     // idou
                            if (label_flg == "0")
                            {
                                txtIdouSu.Text = (int.Parse(txtIdouSu.Text) + 1).ToString();
                            }
                            else
                            {
                                txtIdouSu.Text = (int.Parse(txtIdouSu.Text) - 1).ToString();
                            }

                            break;

                        case 8:     // 返品数
                            if (label_flg == "0")
                            {
                                txtHenpinSu.Text = (int.Parse(txtHenpinSu.Text) + 1).ToString();
                            }
                            else
                            {
                                txtHenpinSu.Text = (int.Parse(txtHenpinSu.Text) - 1).ToString();
                            }

                            break;

                        default:
                            if (label_flg == "0")
                            {
                                txtSonotaSu.Text = (int.Parse(txtSonotaSu.Text) + 1).ToString();
                            }
                            else
                            {
                                txtSonotaSu.Text = (int.Parse(txtSonotaSu.Text) - 1).ToString();
                            }
                            break;
                        }

                        txtSougoSu.Text = (int.Parse(txtMailSu.Text) + (int.Parse(txtHazaiSu.Text) + int.Parse(txtIdouSu.Text)
                                                                        + int.Parse(txtHenpinSu.Text) + int.Parse(txtSonotaSu.Text))).ToString();
                    }
                });
            }
        }