private void buttonFUpdate_Click(object sender, EventArgs e) { try { string status = textBoxFStatus.Text; List <string> Tags = new List <string>(); for (int i = 0; i < checkedListBoxFTags.Items.Count; i++) { if (checkedListBoxFTags.GetItemChecked(i)) { Tags.Add(checkedListBoxFTags.GetItemText(checkedListBoxFTags.Items[i])); } } DateTime InputDate = UltilityConvert.ToDateMin(textBoxFInputDate.Text); DateTime ReleaseDate = UltilityConvert.ToDateMin(textBoxFReleaseDate.Text); Collection curFantasy = mFantasy.Update(textBoxFId.Text, textBoxFName.Text, textBoxFCategory.Text, textBoxFStatus.Text, textBoxFMemo.Text, textBoxFName2.Text, textBoxFName3.Text, UltilityConvert.ToInt(textBoxFLevel.Text), InputDate, ReleaseDate, Tags ); mFantasy.Save(); LoadcurFantasyItems(curFantasy.Category); curFantasyClear(); LoadcurFantasy(); UpdateRelatedFId(curFantasy); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void buttonCollectionAdd_Click(object sender, EventArgs e) { try { List <string> Tags = new List <string>(); for (int i = 0; i < checkedListBoxCTags.Items.Count; i++) { if (checkedListBoxCTags.GetItemChecked(i)) { Tags.Add(checkedListBoxCTags.GetItemText(checkedListBoxCTags.Items[i])); } } DateTime InputDate = UltilityConvert.ToDateMin(textBoxCInputDate.Text); DateTime ReleaseDate = UltilityConvert.ToDateMin(textBoxCReleaseDate.Text); Collection curCollection = mCollection.Add(textBoxCId.Text, textBoxCName.Text, textBoxCCategory.Text, textBoxCStatus.Text, textBoxCMemo.Text, textBoxCName2.Text, textBoxCName3.Text, UltilityConvert.ToInt(textBoxCLevel.Text), InputDate, ReleaseDate, Tags ); mCollection.Save(); LoadcurCollectionItems(curCollection.Category); curCollectionClear(); UpdateRelatedCId(curCollection); } catch (Exception ex) { MessageBox.Show(ex.Message); } }