Example #1
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);
        }
Example #2
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();
            }
        }
Example #3
0
        public override bool OnKeyDown(Keycode keycode, KeyEvent paramKeyEvent)
        {
            if (keycode == Keycode.F1)
            {
                EditText et = new EditText(this.Activity);

                AlertDialog.Builder ad = new AlertDialog.Builder(this.Activity);
                ad.SetTitle("Password");
                ad.SetView(et);
                ad.SetPositiveButton("Submit", delegate
                {
                    // password テーブルからパスワード情報を取得する。

                    Toast.MakeText(this.Activity, "Submit Input: " + et.Text, ToastLength.Short).Show();

                    if (et.Text == "")
                    {
                        SndNohinWorkHelper sndNohinWorkHelper = new SndNohinWorkHelper();
                        sndNohinWorkHelper.DeleteAll();

                        editor.PutBoolean("nohinWorkEndFlag", true);
                        editor.Apply();
                        StartFragment(FragmentManager, typeof(NohinCompleteFragment));
                    }
                    else
                    {
                        ShowDialog("エラー", "パスワードが違います。", () => { });
                        return;
                    }
                });
                ad.Show();
            }
            else if (keycode == Keycode.Enter)
            {
                if (nohinWorkButton.Visibility == ViewStates.Visible)
                {
                    if (tsumikomiDataList.Count == ko_su)
                    {
                        Log.Debug(TAG, "MAIN NOHIN COMPLETE ");
                        editor.PutBoolean("nohinWorkEndFlag", true);
                        editor.Apply();
                        StartFragment(FragmentManager, typeof(NohinCompleteFragment));
                    }
                    else
                    {
                        nohinWorkButton.Visibility = ViewStates.Gone;
                        kaizoButton.Visibility     = ViewStates.Visible;

                        tvCase.Text     = "0";
                        tvOricon.Text   = "0";
                        tvFuteikei.Text = "0";
                        tvTc.Text       = "0";
                        tvIdo.Text      = "0";
                        tvMail.Text     = "0";
                        tvHansoku.Text  = "0";
                        tvSonota.Text   = "0";
                    }
                }
            }

            return(true);
        }
Example #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);
        }
Example #5
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            view   = inflater.Inflate(Resource.Layout.fragment_menu_nohin, container, false);
            prefs  = PreferenceManager.GetDefaultSharedPreferences(Context);
            editor = prefs.Edit();

            SetTitle("納品検品");
            SetFooterText("");

            bool isDone = prefs.GetBoolean("mailBagFlag", false);

            MbFileHelper mbFileHelper = new MbFileHelper();

            hasMailBagData = mbFileHelper.HasExistMailBagData();

            SndNohinWorkHelper sndNohinWorkHelper = new SndNohinWorkHelper();
            int nohinCount = sndNohinWorkHelper.SelectAll().Count;

            Button button1 = view.FindViewById <Button>(Resource.Id.btn_nohinMenu_mailNohin);

            button1.Click += delegate {
                if (prefs.GetBoolean("mailBagFlag", false))
                {
                    ShowDialog("報告", "メールバッグ納品処理は終了しています。", () => { });
                }
                else
                {
                    StartFragment(FragmentManager, typeof(NohinMailBagNohinFragment));
                }
            };

            Button button2 = view.FindViewById <Button>(Resource.Id.btn_nohinMenu_nohin);

            button2.Click += delegate {
                bool errorFlag = false;

                if (!prefs.GetBoolean("mailBagFlag", false))
                {
                    Log.Debug(TAG, "メールバッグ納品処理が終了していません。");
                    errorFlag = true;
                    ShowDialog("報告", "メールバッグ納品処理が終了していません。", () => { });
                }
                else if (prefs.GetBoolean("nohinWorkEndFlag", false))
                {
                    Log.Debug(TAG, "納品処理は終了しています。");
                    errorFlag = true;
                    ShowDialog("報告", "納品処理は終了しています。", () => { });
                }

                if (errorFlag == false)
                {
                    StartFragment(FragmentManager, typeof(NohinWorkFragment));
                }
            };

            Button button3 = view.FindViewById <Button>(Resource.Id.btn_nohinMenu_kaisyu); // 回収業務

            button3.Click += delegate {
                bool errorFlag = false;

                /*
                 * if (!prefs.GetBoolean("mailBagFlag", false))
                 * {
                 *  Log.Debug(TAG, "メールバッグ納品処理が終了していません。");
                 *  errorFlag = true;
                 *  CommonUtils.AlertDialog(view, "確認", "メールバッグ納品処理が終了していません。", () => { return; });
                 * }
                 * else
                 * if (!prefs.GetBoolean("nohinWorkEndFlag", false))
                 * {
                 *  Log.Debug(TAG, "納品処理が終了していません。");
                 *  errorFlag = true;
                 *  CommonUtils.AlertDialog(view, "確認", "納品処理が終了していません。", () => { return; });
                 * }
                 * else if (prefs.GetBoolean("kaisyuEndFlag", false))
                 * {
                 *  Log.Debug(TAG, "納品処理が終了していません。");
                 *  errorFlag = true;
                 *  CommonUtils.AlertDialog(view, "確認", "納品処理が終了していません。", () => { return; });
                 * }
                 */
                if (errorFlag == false)
                {
                    editor.PutBoolean("searchFlag", false);
                    editor.Apply();
                    StartFragment(FragmentManager, typeof(NohinKaisyuMenuFragment));
                }
            };

            Button button4 = view.FindViewById <Button>(Resource.Id.btn_nohinMenu_mailKaisyu);

            button4.Click += delegate {
                bool errorFlag = false;

                /*
                 * if (!prefs.GetBoolean("mailBagFlag", false))
                 * {
                 *  Log.Debug(TAG, "メールバッグ納品処理が終了していません。");
                 *  errorFlag = true;
                 *  CommonUtils.AlertDialog(view, "確認", "メールバッグ納品処理が終了していません。", () => { return; });
                 * } else
                 * if (!prefs.GetBoolean("kaisyuEndFlag", false))
                 * {
                 *  Log.Debug(TAG, "回収処理が終了していません。");
                 *  errorFlag = true;
                 *  CommonUtils.AlertDialog(view, "確認", "回収処理が終了していません。", () => { return; });
                 * }
                 * else if (prefs.GetBoolean("mailKaisyuEndFlag", false))
                 * {
                 *  Log.Debug(TAG, "メールバッグ回収処理は終了しています。");
                 *  errorFlag = true;
                 *  CommonUtils.AlertDialog(view, "確認", "メールバッグ回収処理は終了しています。", () => { return; });
                 * }
                 */
                if (errorFlag == false)
                {
                    StartFragment(FragmentManager, typeof(NohinMailBagKaisyuFragment));
                }
            };                                                                             // sagyou2

            return(view);
        }
Example #6
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();
            }
        }