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); }
public bool Insert(MateFile file) { try { using (var connection = new SQLiteConnection(System.IO.Path.Combine(folder, dbFileName))) { connection.Insert(file); return(true); } } catch (SQLiteException ex) { Log.Info("SQLiteEx", ex.Message); return(false); } }
/// <summary> /// メニューファイルを読み込む /// </summary> /// <returns></returns> bool loadMenu() { nodes = new Dictionary <string, int>(); foreach (var nodekey in Params.Nodenames.Keys) { if (menuFile.delNodes.Contains(nodekey)) { nodes.Add(nodekey, 1); } else if (menuFile.showNodes.Contains(nodekey)) { nodes.Add(nodekey, 2); } else { nodes.Add(nodekey, 0); } } masks = new Dictionary <string, bool>(); foreach (var slotkey in Params.Slotnames.Keys) { if (menuFile.maskItems.Contains(slotkey)) { masks.Add(slotkey, true); } else { masks.Add(slotkey, false); } } addItems = new List <ModelFile>(); foreach (var target in menuFile.addItems) { if (Params.Slotnames.Keys.Contains(target[1])) { ModelFile model = new ModelFile(); if (model.LoadFile(target[0])) { model.category = menuFile.category; model.slotname = target[1]; if (Params.AttachPoints.ContainsKey(target[1])) { //手持ちアイテム model.addItemType = ModelFile.AddItemType.handItem; model.attachSlot = MenuFile.AttachBoneString; model.attachName = Params.AttachPoints[target[1]]; } else if (target.Length == 4 && target[2] == MenuFile.AttachBoneString) { //ボーンにアタッチ model.addItemType = ModelFile.AddItemType.attachBone; model.attachSlot = MenuFile.AttachBoneString; model.attachName = target[3]; } else if (target.Length == 5 && target[2] == MenuFile.AttachString) { //アタッチ model.addItemType = ModelFile.AddItemType.attach; model.attachSlot = target[3]; model.attachName = target[4]; } addItems.Add(model); } } } mateFiles = new List <MateFile>(); foreach (var target in menuFile.materials) { if (Params.Slotnames.Keys.Contains(target[0])) { int matno; if (int.TryParse(target[1], out matno)) { MateFile mate = new MateFile(); if (mate.LoadFile(target[2])) { mate.matno = matno; mate.category = menuFile.category; mate.slotname = target[0]; mateFiles.Add(mate); } } } } resourceFiles = new List <MenuFile>(); foreach (var target in menuFile.resources) { MenuFile menu = new MenuFile(); if (menu.LoadFile(target[1])) { menu.resourceName = target[0]; resourceFiles.Add(menu); } } delItems = new Dictionary <string, bool>(); foreach (var slot in Params.Slotnames.Keys) { // 削除アイテムのチェック bool exists = false; foreach (var target in menuFile.items) { if (target.Contains(slot) && target.Contains("_del")) { exists = true; break; } } delItems.Add(slot, exists); } scrollPos = Vector2.zero; wearMpnsCombo.SelectedItemIndex = 0; foreach (var category in wearMpns) { if (category.text == menuFile.category) { break; } wearMpnsCombo.SelectedItemIndex++; } return(true); }