public ItemCatalog.ItemCatalog returnCatalog(string file) { ItemCatalog.ItemCatalog catalog = new ItemCatalog.ItemCatalog(); catalog = new ItemCatalog.ItemCatalog { items = client.getItems(file) }; return(catalog); }
public ItemCatalog.Items createNewItem(string id, string author, string title, string genre, double price, string publishdate, string filename) { ItemCatalog.Items newitem = new ItemCatalog.Items(id, author, title, genre, price, publishdate); ItemCatalog.ItemCatalog catalog = new ItemCatalog.ItemCatalog(); catalog = new ItemCatalog.ItemCatalog { items = client.getItems(filename) }; client.createNewItem(filename, catalog, newitem); return(newitem); }
public void editButtonFunc(string filename, int index) { ItemCatalog.ItemCatalog catalog = business.returnCatalog(filename); ItemCatalog.Items item = business.returnItems(filename)[index]; create.Visibility = Visibility.Hidden; if (edit.Content.Equals("Edit Book")) { edit.Content = "Save Book"; author.Text = item.author; title.Text = item.title; genre.Text = item.genre; price.Text = item.price.ToString(); publishdate.Text = item.publish_date; author.IsReadOnly = false; title.IsReadOnly = false; genre.IsReadOnly = false; price.IsReadOnly = false; publishdate.IsReadOnly = false; } else if (edit.Content.Equals("Save Book")) { create.Visibility = Visibility.Visible; if (author.Text.Length == 0 || title.Text.Length == 0 || genre.Text.Length == 0 || price.Text.Length == 0 || publishdate.Text.Length == 0) { MessageBox.Show("Please fill in the gaps!"); } else { edit.Content = "Edit Book"; item.author = author.Text; item.title = title.Text; item.genre = genre.Text; item.price = double.Parse(price.Text); item.publish_date = publishdate.Text; business.editItem(filename, catalog, item, index); author.IsReadOnly = true; title.IsReadOnly = true; genre.IsReadOnly = true; price.IsReadOnly = true; publishdate.IsReadOnly = true; } } }
public System.Threading.Tasks.Task createNewItemAsync(string xml, ItemCatalog.ItemCatalog catalog, ItemCatalog.Items newbook) { return(base.Channel.createNewItemAsync(xml, catalog, newbook)); }
public void createNewItem(string xml, ItemCatalog.ItemCatalog catalog, ItemCatalog.Items newbook) { base.Channel.createNewItem(xml, catalog, newbook); }
public System.Threading.Tasks.Task editItemAsync(string xml, ItemCatalog.ItemCatalog catalog, ItemCatalog.Items book, int index) { return(base.Channel.editItemAsync(xml, catalog, book, index)); }
public void editItem(string xml, ItemCatalog.ItemCatalog catalog, ItemCatalog.Items book, int index) { base.Channel.editItem(xml, catalog, book, index); }
public void editItem(string file, ItemCatalog.ItemCatalog catalog, ItemCatalog.Items item, int index) { client.editItem(file, catalog, item, index); }