public SelectedProductPage(Prodcut product) { InitializeComponent(); // StartListening(); _product = product; GetProductState(_product); GetProductLevel(); Debug.WriteLine($"State Before Click {_product.State}"); }
void GetProductState(Prodcut product) { if (product.State) { StateImage.SvgPath = "Acriworks_DeviceSimulator.SVG.DeviceON.svg"; } else { StateImage.SvgPath = "Acriworks_DeviceSimulator.SVG.DeviceOFF.svg"; } }
public Task <int> SaveProdcutAsync(Prodcut product) { if (product.ID != 0) { return(database.UpdateAsync(product)); } else { return(database.InsertAsync(product)); } }
async void AddProductClicked(object sender, EventArgs e) { if (deviceName.Text == null) { await DisplayAlert("Error", "Please fill in all fields", "Ok"); } else { product = new Prodcut { Name = deviceName.Text, State = state, level = levelElement.SelectedIndex }; await App.Database.SaveProdcutAsync(product); await Navigation.PushAsync(new ListProductsPage()); } }
public Task <int> DeleteProdcutAsync(Prodcut product) { return(database.DeleteAsync(product)); }
public Task <List <Prodcut> > QueryProdcutAsync(Prodcut product) { return(database.QueryAsync <Prodcut>("SELECT * FROM [Prodcut] WHERE ID = ?", product.ID)); }
public void UpdateProductAsync(Prodcut product) { var Update = database.QueryAsync <Prodcut>("UPDATE Prodcut WHERE ID = ?", product.ID); }