Beispiel #1
0
        private void GotoTusumikomi()
        {
            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)
            {
                ShowDialog("警告", "未送信データが存在します。\n削除して業務を続行しますか?", () => {
                    mailHelper.DeleteAll();
                    mailKaisyuHelper.DeleteAll();
                    mateHelper.DeleteAll();
                    workHelper.DeleteAll();
                    syohinKaisyuHelper.DeleteAll();

                    editor.PutBoolean("mailBagFlag", false);
                    editor.PutBoolean("nohinWorkEndFlag", false);
                    editor.PutBoolean("mailKaisyuEndFlag", false);
                    editor.Apply();

                    StartFragment(FragmentManager, typeof(TsumikomiSelectFragment));
                });
            }
            else
            {
                StartFragment(FragmentManager, typeof(TsumikomiSelectFragment));
            }
        }
        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);
        }
Beispiel #3
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);
        }
Beispiel #4
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();
            }
        }