private void UpdateProductGridView(GridViewRowInfo currentRow) { try { long supplierId = Convert.ToInt64(currentRow.Cells["SupplierId"].Value); Supplier selectedSupplier = SupplierViewModel.GetEntity(supplierId); RgvProducts.DataSource = ProductViewModel.GetAllEntities(selectedSupplier); } catch (NullReferenceException) { } }
private Supplier GetSelectedSupplier(GridViewRowInfo currentRow) { long supplierId = (long)currentRow.Cells["SupplierId"].Value; return(SupplierViewModel.GetEntity(supplierId)); }