Exemplo n.º 1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            view               = inflater.Inflate(Resource.Layout.fragment_nohin_mailBag_nohin, container, false);
            prefs              = PreferenceManager.GetDefaultSharedPreferences(Context);
            editor             = prefs.Edit();
            sndNohinMailHelper = new SndNohinMailHelper();
            mbFileHelper       = new MbFileHelper();

            tokuisakiCd  = prefs.GetString("tokuisaki_cd", "");
            todokesakiCd = prefs.GetString("todokesaki_cd", "");

            SetTitle("メールバック納品");
            SetFooterText(" F1:解除");

            TextView txtTokusakiName = view.FindViewById <TextView>(Resource.Id.txt_nohinMailBagNohin_tokuisakiNm);

            txtTokusakiName.Text = prefs.GetString("tokuisaki_nm", "");

            etMailBagNumber      = view.FindViewById <BootstrapEditText>(Resource.Id.et_nohinMailBagNohin_mailbagNumber);
            etMailBagNumber.Text = "0";

            List <SndNohinMail> mailList = sndNohinMailHelper.SelectAll();

            if (mailList.Count > 0)
            {
                etMailBagNumber.Text = mailList.Count.ToString();
            }

            // メールバッグ件数取得
            mailbackCnt = mbFileHelper.GetMailbackCount();

            BootstrapButton kaizoButton = view.FindViewById <BootstrapButton>(Resource.Id.btn_nohinMailBagNohin_kaizo);

            kaizoButton.Click += delegate {
                //menu_flg
                editor.PutString("menu_flg", "1");
                editor.Apply();
                StartFragment(FragmentManager, typeof(NohinMailBagPasswordFragment));
            };

            BootstrapButton muButton = view.FindViewById <BootstrapButton>(Resource.Id.btn_nohinMailBagNohin_mu);

            muButton.Click += delegate { CompleteMailNohin(); };

            if (mailbackCnt != 0)
            {
                muButton.Enabled = false;
            }

            return(view);
        }
Exemplo n.º 2
0
        private bool HasSendData()
        {
            SndNohinMailHelper         mailHelper         = new SndNohinMailHelper();
            SndNohinMailKaisyuHelper   mailKaisyuHelper   = new SndNohinMailKaisyuHelper();
            SndNohinMateHelper         mateHelper         = new SndNohinMateHelper();
            SndNohinWorkHelper         workHelper         = new SndNohinWorkHelper();
            SndNohinSyohinKaisyuHelper syohinKaisyuHelper = new SndNohinSyohinKaisyuHelper();

            mailList         = mailHelper.SelectAll();
            mailKaisyuList   = mailKaisyuHelper.SelectAll();
            mateList         = mateHelper.SelectAll();
            workList         = workHelper.SelectAll();
            syohinKaisyuList = syohinKaisyuHelper.SelectAll();

            int count = mailList.Count + mailKaisyuList.Count + mateList.Count + workList.Count + syohinKaisyuList.Count;

            return(count != 0);
        }
Exemplo n.º 3
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();
            }
        }
Exemplo n.º 4
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            view = inflater.Inflate(Resource.Layout.fragment_menu_main, container, false);
            LinearLayout layout = view.FindViewById <LinearLayout>(Resource.Id.linearLayout2);

            prefs  = PreferenceManager.GetDefaultSharedPreferences(Context);
            editor = prefs.Edit();

            mailHelper         = new SndNohinMailHelper();
            mailKaisyuHelper   = new SndNohinMailKaisyuHelper();
            mateHelper         = new SndNohinMateHelper();
            workHelper         = new SndNohinWorkHelper();
            syohinKaisyuHelper = new SndNohinSyohinKaisyuHelper();

            string menu_kbn = prefs.GetString("menu_kbn", "");

            if (menu_kbn == "0")
            {
                // 構内の場合
                LinearLayout konaiLayout = view.FindViewById <LinearLayout>(Resource.Id.konaiLayout);
                konaiLayout.Visibility = ViewStates.Visible;

                Button btnNyuka = view.FindViewById <Button>(Resource.Id.konaiNyuka);
                btnNyuka.Click += delegate { StartFragment(FragmentManager, typeof(NyukaMenuFragment)); };

                Button btnTsumikae = view.FindViewById <Button>(Resource.Id.konaiIdou);
                btnTsumikae.Click += delegate { StartFragment(FragmentManager, typeof(TsumikaeMenuFragment)); };

                Button btnMatehanRegist = view.FindViewById <Button>(Resource.Id.konaiMate);
                btnMatehanRegist.Click += delegate { StartFragment(FragmentManager, typeof(MatehanMenuFragment)); };

                Button btnIdouRegist = view.FindViewById <Button>(Resource.Id.konaiIdouRegist);
                btnIdouRegist.Click += delegate { StartFragment(FragmentManager, typeof(IdouRegistSelectFragment)); };
            }
            else if (menu_kbn == "1")
            {
                // ドライバの場合
                LinearLayout driverLayout = view.FindViewById <LinearLayout>(Resource.Id.driverLayout);
                driverLayout.Visibility = ViewStates.Visible;

                Button btnNyuka = view.FindViewById <Button>(Resource.Id.driverNyuka);
                btnNyuka.Click += delegate { StartFragment(FragmentManager, typeof(NyukaMenuFragment)); };

                Button btnTsumikae = view.FindViewById <Button>(Resource.Id.driverIdou);
                btnTsumikae.Click += delegate { StartFragment(FragmentManager, typeof(TsumikaeMenuFragment)); };

                Button btnTsumikomi = view.FindViewById <Button>(Resource.Id.driverTsumikomi);
                btnTsumikomi.Click += delegate { GotoTusumikomi(); };

                Button btnNohin = view.FindViewById <Button>(Resource.Id.driverNohin);
                btnNohin.Click += delegate { StartFragment(FragmentManager, typeof(NohinSelectFragment)); };

                Button btnDataSend = view.FindViewById <Button>(Resource.Id.driverSend);
                btnDataSend.Click += delegate {  DataSend();   };
            }
            else if (menu_kbn == "2")
            {
                // 管理者の場合
                LinearLayout managerLayout = view.FindViewById <LinearLayout>(Resource.Id.managerLayout);
                managerLayout.Visibility = ViewStates.Visible;

                Button btnNyuka = view.FindViewById <Button>(Resource.Id.btn_main_manager_nyuka);
                btnNyuka.Click += delegate { StartFragment(FragmentManager, typeof(NyukaMenuFragment)); };

                Button btnTsumikae = view.FindViewById <Button>(Resource.Id.btn_main_manager_tsumikae);
                btnTsumikae.Click += delegate { StartFragment(FragmentManager, typeof(TsumikaeMenuFragment)); };

                Button btnTsumikomi = view.FindViewById <Button>(Resource.Id.btn_main_manager_tsumikomi);
                btnTsumikomi.Click += delegate { GotoTusumikomi(); };

                Button btnNohin = view.FindViewById <Button>(Resource.Id.btn_main_manager_nohin);
                btnNohin.Click += delegate { StartFragment(FragmentManager, typeof(NohinSelectFragment)); };

                Button btnDataSend = view.FindViewById <Button>(Resource.Id.btn_main_manager_dataSend);
                btnDataSend.Click += delegate { DataSend(); };

                Button btnMatehanRegist = view.FindViewById <Button>(Resource.Id.btn_main_manager_matehanRegist);
                btnMatehanRegist.Click += delegate { StartFragment(FragmentManager, typeof(MatehanMenuFragment)); };

                Button btnMailBag = view.FindViewById <Button>(Resource.Id.btn_main_manager_mailBag);
                btnMailBag.Click += delegate { StartFragment(FragmentManager, typeof(MailMenuFragment)); };

                Button btnIdouRegist = view.FindViewById <Button>(Resource.Id.btn_main_manager_idousakiRegist);
                btnIdouRegist.Click += delegate { StartFragment(FragmentManager, typeof(IdouRegistSelectFragment)); };

                Button btnIdouNohin = view.FindViewById <Button>(Resource.Id.btn_main_manager_idousakiNohin);
                btnIdouNohin.Click += delegate { StartFragment(FragmentManager, typeof(IdouNohinSelectFragment)); };
            }

            SetTitle("業務メニュー");
            SetFooterText("");

            return(view);
        }
Exemplo n.º 5
0
        private void DataSend()
        {
            SndNohinMailHelper         mailHelper         = new SndNohinMailHelper();
            SndNohinMailKaisyuHelper   mailKaisyuHelper   = new SndNohinMailKaisyuHelper();
            SndNohinMateHelper         mateHelper         = new SndNohinMateHelper();
            SndNohinWorkHelper         workHelper         = new SndNohinWorkHelper();
            SndNohinSyohinKaisyuHelper syohinKaisyuHelper = new SndNohinSyohinKaisyuHelper();

            List <SndNohinMail>         mailList         = mailHelper.SelectAll();
            List <SndNohinMailKaisyu>   mailKaisyuList   = mailKaisyuHelper.SelectAll();
            List <SndNohinMate>         mateList         = mateHelper.SelectAll();
            List <SndNohinWork>         workList         = workHelper.SelectAll();
            List <SndNohinSyohinKaisyu> syohinKaisyuList = syohinKaisyuHelper.SelectAll();

            int count = mailList.Count + mailKaisyuList.Count + mateList.Count + workList.Count + syohinKaisyuList.Count;

            if (count > 0)
            {
                new Thread(new ThreadStart(delegate
                {
                    Activity.RunOnUiThread(() =>
                    {
                        // 業務メニューに戻ってよろしいですか?
                        ShowDialog("警告", "納品情報を送信して業務メニューに戻ってよろしいですか?", () => {
                            ((MainActivity)this.Activity).ShowProgress("データ送信中");

                            foreach (SndNohinMail temp in mailList)
                            {
                                Dictionary <string, string> param = SetSendParam(temp);
                                var result = WebService.RequestSend010(param);
                            }

                            Log.Debug(TAG, "メールバックデータ送信完了");

                            foreach (SndNohinMailKaisyu temp in mailKaisyuList)
                            {
                                Dictionary <string, string> param = SetSendParam(temp);
                                var result = WebService.RequestSend010(param);
                            }

                            Log.Debug(TAG, "メールバック回収データ送信完了");

                            foreach (SndNohinMate temp in mateList)
                            {
                                Dictionary <string, string> param = SetSendParam(temp);
                                var result = WebService.RequestSend010(param);
                            }

                            Log.Debug(TAG, "マテハンデータ送信完了");

                            foreach (SndNohinWork temp in workList)
                            {
                                Dictionary <string, string> param = SetSendParam(temp);
                                var result = WebService.RequestSend010(param);
                            }

                            Log.Debug(TAG, "納品作業データ送信完了");

                            foreach (SndNohinSyohinKaisyu temp in syohinKaisyuList)
                            {
                                Dictionary <string, string> param = SetSendParam(temp);
                                var result = WebService.RequestSend010(param);
                            }

                            Log.Debug(TAG, "商品回収データ送信完了");
                        });
                    }
                                           );
                    Activity.RunOnUiThread(() =>
                    {
                        // 削除処理
                        mailHelper.DeleteAll();
                        mailKaisyuHelper.DeleteAll();
                        mateHelper.DeleteAll();
                        workHelper.DeleteAll();
                        syohinKaisyuHelper.DeleteAll();

                        //new MFileHelper().DeleteAll();
                        //new MbFileHelper().DeleteAll();
                    });
                    Activity.RunOnUiThread(() =>
                    {
                        ShowDialog("報告", "データ送信完了しました。", () => {
                            ((MainActivity)this.Activity).DismissDialog();
                            FragmentManager.PopBackStack();
                        });
                    });
                }
                                           )).Start();
            }
        }