private void InitComponent() { SetTitle("メールバック回収"); SetFooterText(""); TextView tvTokuisaki = view.FindViewById <TextView>(Resource.Id.txt_nohinKaisyuMail_tokuisakiNm); tvTokuisaki.Text = prefs.GetString("tokuisaki_nm", ""); TextView tvTodokesaki = view.FindViewById <TextView>(Resource.Id.txt_nohinKaisyuMail_todokisakiNm); tvTodokesaki.Text = prefs.GetString("todokesaki_nm", ""); etKaisyuMail = view.FindViewById <EditText>(Resource.Id.et_nohinKaisyuMail_kaisyuMailbag); BootstrapButton btnConfirm = view.FindViewById <BootstrapButton>(Resource.Id.et_nohinKaisyuMail_Confirm); btnConfirm.Click += delegate { ConfirmMailBagKaisyu(); }; sndNohinMailKaisyuHelper = new SndNohinMailKaisyuHelper(); List <SndNohinMailKaisyu> temp = sndNohinMailKaisyuHelper.SelectAll(); if (temp.Count > 0) { etKaisyuMail.Text = temp.Count.ToString(); mail_bag = 0; } else { etKaisyuMail.Text = "0"; mail_bag = 0; } arrMailBag = new List <string>(); }
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); }
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); }
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(); } }