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)); } }
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(); } }