示例#1
0
        public override void OnResume()
        {
            base.OnResume();

            string vendorCd  = prefs.GetString("vendor_cd", "");
            string vendor_nm = prefs.GetString("vendor_nm", "");

            var searchFlag = prefs.GetBoolean("searchFlag", false);

            if (searchFlag) // `ベンダー検索画面からの場合
            {
                _VendorCdEditText.Text   = vendorCd;
                _VendorNameTextView.Text = vendor_nm;
            }
            else
            {
                _VendorCdEditText.Text   = prefs.GetString("mate_vendor_cd", "");
                _VendorNameTextView.Text = prefs.GetString("mate_vendor_nm", "");
            }

            matehanList = mateFileHelper.SelectByVendorCd(_VendorCdEditText.Text);
            SetMateVendorInfo(prefs.GetString("mate_vendor_cd", ""));
            motoVendorCd = _VendorCdEditText.Text;

            matehan1Su.RequestFocus();
        }
示例#2
0
        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);
        }