public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { view = inflater.Inflate(Resource.Layout.fragment_matehan_work, container, false); prefs = PreferenceManager.GetDefaultSharedPreferences(Context); editor = prefs.Edit(); // DB helper nohinMateHelper = new SndNohinMateHelper(); mateFileHelper = new MateFileHelper(); // コンポーネント初期化 SetTitle("貸出登録"); TextView vendorNm = view.FindViewById <TextView>(Resource.Id.txt_nohinKaisyuMatehan_vendorName); matehan1Nm = view.FindViewById <TextView>(Resource.Id.txt_nohinKaisyuMatehan_matehan1); matehan2Nm = view.FindViewById <TextView>(Resource.Id.txt_nohinKaisyuMatehan_matehan2); matehan3Nm = view.FindViewById <TextView>(Resource.Id.txt_nohinKaisyuMatehan_matehan3); matehan4Nm = view.FindViewById <TextView>(Resource.Id.txt_nohinKaisyuMatehan_matehan4); matehan1Su = view.FindViewById <BootstrapEditText>(Resource.Id.et_nohinKaisyuMatehan_matehan1); matehan2Su = view.FindViewById <BootstrapEditText>(Resource.Id.et_nohinKaisyuMatehan_matehan2); matehan3Su = view.FindViewById <BootstrapEditText>(Resource.Id.et_nohinKaisyuMatehan_matehan3); matehan4Su = view.FindViewById <BootstrapEditText>(Resource.Id.et_nohinKaisyuMatehan_matehan4); mateRental1 = view.FindViewById <TextView>(Resource.Id.matehanRental1); mateRental2 = view.FindViewById <TextView>(Resource.Id.matehanRental2); mateRental3 = view.FindViewById <TextView>(Resource.Id.matehanRental3); mateRental4 = view.FindViewById <TextView>(Resource.Id.matehanRental4); BootstrapButton button1 = view.FindViewById <BootstrapButton>(Resource.Id.btn_nohinKaisyuMatehan_confirm); button1.Click += delegate { ConfirmMatehanKaisyu(); }; vendorNm.Text = prefs.GetString("vendor_nm", ""); mate030List = WebService.RequestMate030(prefs.GetString("vendor_cd", "")); matehanList = new List <MateFile>(); foreach (MATE030 mate030 in mate030List) { string code_name = WebService.RequestMate040(mate030.matehan_cd); MateFile mateFile = new MateFile(); mateFile.matehan_cd = mate030.matehan_cd; mateFile.matehan_nm = code_name; matehanList.Add(mateFile); } SetMateVendorInfo(prefs.GetString("vendor_cd", "")); matehan1Su.RequestFocus(); return(view); }
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); }
private void InsertSndMat(string matehan_cd, string matesu) { // レコード作成用 値取得 SndNohinMate sndNohinMate = new SndNohinMate { wPackage = "02", wTerminalID = "432660068", wProgramID = "NOH", wSagyosyaCD = prefs.GetString("sagyousya_cd", "99999"), wSoukoCD = prefs.GetString("souko_cd", "108"), wHaisoDate = "0", wBinNo = prefs.GetString("bin_no", ""), wCourse = prefs.GetString("course", ""), wDriverCD = "", wTokuisakiCD = prefs.GetString("tokuisaki_cd", ""), wTodokesakiCD = prefs.GetString("todokesaki_cd", ""), wKanriNo = "", wVendorCd = prefs.GetString("vendor_cd", ""), wMateVendorCd = prefs.GetString("mate_vendor_cd", ""), wSyukaDate = prefs.GetString("haiso_date", ""), wButsuryuNo = "", wKamotuNo = "", wMatehan = matehan_cd, wMatehanSu = matesu, wHHT_no = "11101", wNohinKbn = "1", // 商品回収 wKaisyuKbn = "1", wTenkanState = "00", wSakiTokuisakiCD = "", wSakiTodokesakiCD = "", wNohinDate = prefs.GetString("nohin_date", ""), wNohinTime = prefs.GetString("nohin_time", "") }; SndNohinMateHelper nohinMateHelper = new SndNohinMateHelper(); nohinMateHelper.Insert(sndNohinMate); }
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); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { view = inflater.Inflate(Resource.Layout.fragment_nohin_kaisyu_matehan, container, false); prefs = PreferenceManager.GetDefaultSharedPreferences(Context); editor = prefs.Edit(); // DB helper nohinMateHelper = new SndNohinMateHelper(); mateFileHelper = new MateFileHelper(); // コンポーネント初期化 SetTitle("マテハン回収"); SetFooterText(""); _VendorNameTextView = view.FindViewById <TextView>(Resource.Id.txt_nohinKaisyuMatehan_vendorName); matehan1Nm = view.FindViewById <TextView>(Resource.Id.txt_nohinKaisyuMatehan_matehan1); matehan2Nm = view.FindViewById <TextView>(Resource.Id.txt_nohinKaisyuMatehan_matehan2); matehan3Nm = view.FindViewById <TextView>(Resource.Id.txt_nohinKaisyuMatehan_matehan3); matehan4Nm = view.FindViewById <TextView>(Resource.Id.txt_nohinKaisyuMatehan_matehan4); matehan1Su = view.FindViewById <BootstrapEditText>(Resource.Id.et_nohinKaisyuMatehan_matehan1); matehan2Su = view.FindViewById <BootstrapEditText>(Resource.Id.et_nohinKaisyuMatehan_matehan2); matehan3Su = view.FindViewById <BootstrapEditText>(Resource.Id.et_nohinKaisyuMatehan_matehan3); matehan4Su = view.FindViewById <BootstrapEditText>(Resource.Id.et_nohinKaisyuMatehan_matehan4); BootstrapButton _ConfirmButton = view.FindViewById <BootstrapButton>(Resource.Id.btn_nohinKaisyuMatehan_confirm); _ConfirmButton.Click += delegate { ConfirmMatehanKaisyu(); }; BootstrapButton _VendorSearchButton = view.FindViewById <BootstrapButton>(Resource.Id.vendorSearch); _VendorSearchButton.Click += delegate { editor.PutBoolean("kounaiFlag", false); editor.Apply(); StartFragment(FragmentManager, typeof(KosuVendorAllSearchFragment)); }; _VendorCdEditText = view.FindViewById <BootstrapEditText>(Resource.Id.et_nohinKaisyuMatehan_vendorCode); _VendorCdEditText.KeyPress += (sender, e) => { if (e.Event.Action == KeyEventActions.Down && e.KeyCode == Keycode.Enter) { e.Handled = true; matehanList = mateFileHelper.SelectByVendorCd(_VendorCdEditText.Text); if (matehanList.Count == 0) { ShowDialog("エラー", "ベンダーコードが存在しません。", () => { _VendorCdEditText.Text = motoVendorCd; _VendorCdEditText.RequestFocus(); }); return; } else { SetMateVendorInfo(_VendorCdEditText.Text); motoVendorCd = _VendorCdEditText.Text; _VendorNameTextView.Text = matehanList[0].vendor_nm; editor.PutString("mate_vendor_cd", _VendorCdEditText.Text); editor.PutString("mate_vendor_nm", matehanList[0].vendor_nm); editor.Apply(); } } else { e.Handled = false; } }; 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(); } }