// コンポーネント初期化 private void InitComponent() { etKaisyuLabel = view.FindViewById <BootstrapEditText>(Resource.Id.et_kaisyuLabel); etIdouTenpo = view.FindViewById <BootstrapEditText>(Resource.Id.et_idouTenpo); etIdouTenpo.Focusable = false; etIdouTokuisaki = view.FindViewById <BootstrapEditText>(Resource.Id.et_idouTokuisaki); etIdouTodokesaki = view.FindViewById <BootstrapEditText>(Resource.Id.et_idouTodokesaki); _ConfirmButton = view.FindViewById <BootstrapButton>(Resource.Id.btn_confirm); _ConfirmButton.Enabled = false; _ConfirmButton.Click += delegate { Confirm(); }; etKaisyuLabel.KeyPress += (sender, e) => { if (e.Event.Action == KeyEventActions.Down && e.KeyCode == Keycode.Enter) { e.Handled = true; CommonUtils.HideKeyboard(Activity); CheckKaisyuLabel(); } else { e.Handled = false; } }; etKaisyuLabel.RequestFocus(); }
// コンポーネント初期化 private void InitComponent() { prefs = PreferenceManager.GetDefaultSharedPreferences(Context); editor = prefs.Edit(); SetTitle("貸出登録"); BootstrapButton btnConfirm = view.FindViewById <BootstrapButton>(Resource.Id.btn_matehan_confirm); etKasidatuDate = view.FindViewById <BootstrapEditText>(Resource.Id.et_matehan_kasidatuDate); etKasidatuTarget = view.FindViewById <BootstrapEditText>(Resource.Id.et_matehan_kasidatuTarget); etKasidatuTarget.KeyPress += (sender, e) => { if (e.Event.Action == KeyEventActions.Down && e.KeyCode == Keycode.Enter) { e.Handled = true; CommonUtils.HideKeyboard(Activity); if (etKasidatuTarget.Text != "") { SearchBinNo(); } } else { e.Handled = false; } }; btnConfirm.Click += delegate { SearchBinNo(); }; etKasidatuDate.FocusChange += (sender, e) => { if (e.HasFocus) { etKasidatuDate.Text = etKasidatuDate.Text.Replace("/", ""); etKasidatuDate.SetSelection(etKasidatuDate.Text.Length); } else { try { etKasidatuDate.Text = CommonUtils.GetDateYYYYMMDDwithSlash(etKasidatuDate.Text); } catch { ShowDialog("エラー", "正しい日付を入力してください", () => { etKasidatuDate.Text = ""; etKasidatuDate.RequestFocus(); }); } } }; BootstrapButton btnSearch = view.FindViewById <BootstrapButton>(Resource.Id.btn_matehan_kasidasiSakiSearch); btnSearch.Click += delegate { SearchKasidasiSaki(); }; //etKasidatuDate.Text = "18/03/20"; etKasidatuDate.Text = DateTime.Now.ToString("yyyy/MM/dd"); etKasidatuTarget.RequestFocus(); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { SetTitle("入荷検品"); SetFooterText(""); view = inflater.Inflate(Resource.Layout.fragment_tsumikae_idou_matehan, container, false); prefs = PreferenceManager.GetDefaultSharedPreferences(Context); editor = prefs.Edit(); menuFlag = prefs.GetInt("menuFlag", 1); motoInfoList = JsonConvert.DeserializeObject <List <Ido> >(Arguments.GetString("motoInfo")); etMantanVendor = view.FindViewById <EditText>(Resource.Id.et_mantan_vendor); etMantanVendor.KeyPress += (sender, e) => { if (e.Event.Action == KeyEventActions.Down && e.KeyCode == Keycode.Enter) { e.Handled = true; CommonUtils.HideKeyboard(Activity); SetMatehanList(); } else { e.Handled = false; } }; txtVenderName = view.FindViewById <TextView>(Resource.Id.vendorName); txtVenderName.Text = prefs.GetString("vendor_nm", ""); BootstrapButton vendorSearchButton = view.FindViewById <BootstrapButton>(Resource.Id.vendorSearch); vendorSearchButton.Click += delegate { StartFragment(FragmentManager, typeof(KosuVendorAllSearchFragment)); }; // ベンダー別マテハンコード取得 string vendorCode = prefs.GetString("vendor_cd", ""); // prefs.GetString("vendor_cd", ""); etMantanVendor.Text = vendorCode; listView = view.FindViewById <ListView>(Resource.Id.lv_matehanList); listView.ItemClick += (object sender, ItemClickEventArgs e) => { SelectListViewItem(e.Position); }; SetMatehanList(); return(view); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { view = inflater.Inflate(Resource.Layout.fragment_kosu_mantan, container, false); prefs = PreferenceManager.GetDefaultSharedPreferences(Context); editor = prefs.Edit(); HideFooter(); kosuMenuflag = prefs.GetInt(Const.KOSU_MENU_FLAG, (int)Const.KOSU_MENU.TODOKE); // 画面区分 listView = view.FindViewById <ListView>(Resource.Id.lv_matehanList); listView.ItemClick += (object sender, ItemClickEventArgs e) => { SelectListViewItem(e.Position); }; txtVenderName = view.FindViewById <TextView>(Resource.Id.vendorName); txtVenderName.Text = prefs.GetString("vendor_nm", ""); etMantanVendor = view.FindViewById <BootstrapEditText>(Resource.Id.et_mantan_vendor); etMantanVendor.Text = prefs.GetString("vendor_cd", ""); BootstrapButton vendorSearchButton = view.FindViewById <BootstrapButton>(Resource.Id.vendorSearch); vendorSearchButton.Click += delegate { StartFragment(FragmentManager, typeof(KosuVendorAllSearchFragment)); }; etMantanVendor.KeyPress += (sender, e) => { if (e.Event.Action == KeyEventActions.Down && e.KeyCode == Keycode.Enter) { e.Handled = true; CommonUtils.HideKeyboard(Activity); SetMatehanList(); } else { e.Handled = false; } }; SetMatehanList(); return(view); }
protected void StartFragment(FragmentManager fm, Type fragmentClass, Bundle bundle) { BaseFragment fragment = null; try { fragment = (BaseFragment)Activator.CreateInstance(fragmentClass); fragment.Arguments = bundle; } catch { } CommonUtils.HideKeyboard(Activity); this.Activity.FragmentManager .BeginTransaction() .Replace(Resource.Id.fragmentContainer, fragment) //.Add(Resource.Id.fragmentContainer, fragment) .AddToBackStack(null) .Commit(); }
// コンポーネント初期化 private void InitComponent() { etTokuisakiCd = view.FindViewById <BootstrapEditText>(Resource.Id.et_tokuisakiCd); etTodokesakiCd = view.FindViewById <BootstrapEditText>(Resource.Id.et_todokesakiCd); etTodokesakiCd.KeyPress += (sender, e) => { if (e.Event.Action == KeyEventActions.Down && e.KeyCode == Keycode.Enter) { e.Handled = true; CommonUtils.HideKeyboard(Activity); Confirm(); } else { e.Handled = false; } }; txtTodokesakiNm = view.FindViewById <TextView>(Resource.Id.txt_todokesakiName); BootstrapButton btnConfirm = view.FindViewById <BootstrapButton>(Resource.Id.btn_confirm); btnConfirm.Click += delegate { Confirm(); }; }
public virtual bool OnBackPressed() { CommonUtils.HideKeyboard(Activity); return(true); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { view = inflater.Inflate(Resource.Layout.fragment_nohin_select, container, false); prefs = PreferenceManager.GetDefaultSharedPreferences(Context); editor = prefs.Edit(); SetTitle("納品検品"); SetFooterText(""); etTokuisaki = view.FindViewById <BootstrapEditText>(Resource.Id.et_nohinSelect_tokuisaki); etTokuisaki.Text = prefs.GetString("def_tokuisaki_cd", ""); etTodokesaki = view.FindViewById <BootstrapEditText>(Resource.Id.et_nohinSelect_todokesaki); etReceipt = view.FindViewById <BootstrapEditText>(Resource.Id.et_nohinSelect_receipt); BootstrapButton confirm = view.FindViewById <BootstrapButton>(Resource.Id.btn_nohinSelect_confirm); confirm.FocusChange += delegate { if (confirm.IsFocused) { CommonUtils.HideKeyboard(this.Activity); } }; confirm.Click += delegate { // 得意先チェック string tokui = etTokuisaki.Text; if (tokui == "") { ShowDialog("エラー", "得意先コードを入力してください。", () => { etTokuisaki.RequestFocus(); }); return; } // 届先チェック string todoke = etTodokesaki.Text; if (todoke == "") { ShowDialog("エラー", "届先コードを入力してください。", () => { etTodokesaki.RequestFocus(); }); return; } // 受領書チェック string jyuryo = etReceipt.Text; if (jyuryo == "") { ShowDialog("エラー", "受領書をスキャンしてください。", () => { etReceipt.RequestFocus(); }); return; } if (jyuryo[0] != 'J' || jyuryo.Length != 9) { ShowDialog("エラー", "受領書ではありません。", () => { etReceipt.RequestFocus(); }); return; } if (jyuryo.Substring(1, 4) != etTokuisaki.Text || jyuryo.Substring(5, 4) != etTodokesaki.Text) { ShowDialog("エラー", "納入先店舗が違います。", () => { etReceipt.RequestFocus(); }); return; } Confirm(); }; etReceipt.KeyPress += (sender, e) => { if (e.Event.Action == KeyEventActions.Down && e.KeyCode == Keycode.Enter) { e.Handled = true; CommonUtils.HideKeyboard(Activity); // 得意先チェック string tokui = etTokuisaki.Text; if (tokui == "") { ShowDialog("エラー", "得意先コードを入力してください。", () => { etTokuisaki.RequestFocus(); }); return; } // 届先チェック string todoke = etTodokesaki.Text; if (todoke == "") { ShowDialog("エラー", "届先コードを入力してください。", () => { etTodokesaki.RequestFocus(); }); return; } // 受領書チェック string jyuryo = etReceipt.Text; if (jyuryo == "") { ShowDialog("エラー", "受領書をスキャンしてください。", () => { etReceipt.RequestFocus(); }); return; } if (jyuryo[0] != 'J' || jyuryo.Length != 9) { ShowDialog("エラー", "受領書ではありません。", () => { etReceipt.RequestFocus(); }); return; } if (jyuryo.Substring(1, 4) != etTokuisaki.Text || jyuryo.Substring(5, 4) != etTodokesaki.Text) { ShowDialog("エラー", "納入先店舗が違います。", () => { etReceipt.RequestFocus(); }); return; } Confirm(); } else { e.Handled = false; } }; etTodokesaki.RequestFocus(); return(view); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { view = inflater.Inflate(Resource.Layout.fragment_login, container, false); prefs = PreferenceManager.GetDefaultSharedPreferences(Context); editor = prefs.Edit(); HideFooter(); loginHelper = new LoginHelper(); ((MainActivity)this.Activity).SupportActionBar.Title = "ログイン"; etSoukoCode = view.FindViewById <BootstrapEditText>(Resource.Id.soukoCode); etSoukoCode.FocusChange += delegate { if (!etSoukoCode.IsFocused) { ((MainActivity)this.Activity).ShowProgress("読み込み中"); new Thread(new ThreadStart(delegate { Activity.RunOnUiThread(() => { SetSoukoName(etSoukoCode.Text); }); Activity.RunOnUiThread(() => ((MainActivity)this.Activity).DismissDialog()); } )).Start(); } }; txtSoukoName = view.FindViewById <TextView>(Resource.Id.tv_login_soukoName); etDriverCode = view.FindViewById <BootstrapEditText>(Resource.Id.tantoCode); etDriverCode.KeyPress += (sender, e) => { if (e.Event.Action == KeyEventActions.Down && e.KeyCode == Keycode.Enter) { e.Handled = true; CommonUtils.HideKeyboard(Activity); var editText = (EditText)sender; Login(); } else { e.Handled = false; } }; btnLogin = view.FindViewById <BootstrapButton>(Resource.Id.loginButton); btnLogin.Click += delegate { Login(); }; btnLogin.FocusChange += delegate { if (btnLogin.IsFocused) { CommonUtils.HideKeyboard(this.Activity); } }; // 以前ログイン情報を設定する。 //SetLastLoginInfo(); LoadLastLoginFromDB(); // 担当者マスタ情報をロカールDBに保存する。 //SaveTantoMaster(); return(view); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { view = inflater.Inflate(Resource.Layout.fragment_tsumikomi_select, container, false); prefs = PreferenceManager.GetDefaultSharedPreferences(Context); editor = prefs.Edit(); // TITLE SETTING SetTitle("積込検品"); // PARAMETER SETTING souko_cd = prefs.GetString("souko_cd", ""); kitaku_cd = prefs.GetString("kitaku_cd", ""); syuka_date = prefs.GetString("syuka_date", ""); nohin_date = prefs.GetString("nohin_date", ""); course = prefs.GetString("course", ""); bin_no = prefs.GetString("bin_no", ""); kansen_kbn = prefs.GetString("kansen_kbn", ""); // ITEM EVENT SETTING etSyukaDate = view.FindViewById <BootstrapEditText>(Resource.Id.et_tsumikomiSelect_syukaDate); etSyukaDate.FocusChange += (sender, e) => { if (e.HasFocus) { etSyukaDate.Text = etSyukaDate.Text.Replace("/", ""); etSyukaDate.SetSelection(etSyukaDate.Text.Length); } else { if (etSyukaDate.Text != "") { try { etSyukaDate.Text = CommonUtils.GetDateYYYYMMDDwithSlash(etSyukaDate.Text); } catch { ShowDialog("エラー", "正しい日付を入力してください。", () => { etSyukaDate.Text = ""; etSyukaDate.RequestFocus(); }); } } } }; etCourse = view.FindViewById <BootstrapEditText>(Resource.Id.et_tsumikomiSelect_course); etCourse.KeyPress += (sender, e) => { if (e.Event.Action == KeyEventActions.Down && e.KeyCode == Keycode.Enter) { e.Handled = true; CommonUtils.HideKeyboard(Activity); Confirm(); } else { e.Handled = false; } }; btnConfirm = view.FindViewById <BootstrapButton>(Resource.Id.btn_tsumikomiSelect_confirm); btnConfirm.Click += delegate { Confirm(); }; // FIRST FOCUS etCourse.RequestFocus(); // DUMMY DATA //etSyukaDate.Text = "18/03/20"; etSyukaDate.Text = DateTime.Now.ToString("yyyy/MM/dd"); return(view); }
// CHECK INPUT AND MOVE TO NEXT FRAGMENT private void Confirm() { if (etSyukaDate.Text == "") { ShowDialog("エラー", "配送日を入力してください。", () => { etSyukaDate.RequestFocus(); }); return; } if (etCourse.Text == "") { ShowDialog("エラー", "コースNoを入力してください。", () => { etCourse.RequestFocus(); }); return; } ((MainActivity)this.Activity).ShowProgress("便情報を確認しています。"); new Thread(new ThreadStart(delegate { Activity.RunOnUiThread(() => { try { syuka_date = etSyukaDate.Text.Replace("/", ""); TUMIKOMI010 result = WebService.RequestTumikomi010(souko_cd, kitaku_cd, syuka_date, etCourse.Text); if (result == null) { ShowDialog("エラー", "コースNoがみつかりません。", () => { }); return; } else if (result.state == "03") { ShowDialog("エラー", "該当コースの積込みは完了しています。", () => { }); return; } bin_no = result.bin_no; kansen_kbn = result.kansen_kbn; List <TUMIKOMI020> todokeList = WebService.RequestTumikomi020(souko_cd, kitaku_cd, syuka_date, bin_no, etCourse.Text); if (todokeList.Count == 0) { ShowDialog("エラー", "表示データがありません。", () => { }); return; } editor.PutString("syuka_date", syuka_date); editor.PutString("course", etCourse.Text); editor.PutString("bin_no", bin_no); editor.PutString("kansen_kbn", kansen_kbn); editor.Apply(); ShowConfirmMessage(); CommonUtils.HideKeyboard(this.Activity); } catch { ShowDialog("エラー", "コースNoがみつかりません。", () => { }); } } ); Activity.RunOnUiThread(() => ((MainActivity)this.Activity).DismissDialog()); } )).Start(); }