// GET: Products/Details/5 public async Task <IActionResult> Details(int?id) { if (!id.HasValue) { return(NotFound()); } var product = await productComponent.GetProduct(id.Value); if (product == null) { return(NotFound()); } return(View(product)); }
static void Main(string[] args) { String connectionString = "Data Source=localhost;Initial Catalog=Products;Integrated Security=True;Encrypt=True;TrustServerCertificate=True"; using (ProductComponent component = ProductComponentFactory.GetProductComponent(connectionString)) { Product product = component.GetProduct(1); } }
private void LoadProductByProductCode(string productCode) { ProductComponent productComp = new ProductComponent(); _product = productComp.GetProduct(productCode); ProductCodeTextBox.Text = _product.ProductCode; ProductNameTextBox.Text = _product.Name; DensityTextBox.Text = _product.Density.ToString(); TargetWeightTextBox.Text = _product.TargetWeight.ToString(); UpperLimitTextBox.Text = _product.UpperLimit.ToString(); LowerLimitTextBox.Text = _product.LowerLimit.ToString(); DribblePointTextBox.Text = _product.DribblePoint.ToString(); ExpectedFillTimeTextBox.Text = _product.ExpectedFillTime.ToString(); }
private void LoadProductByProductCode(string productCode) { ProductComponent productComp = new ProductComponent(); _currentProduct = productComp.GetProduct(productCode); }
public async Task <JsonResult> GetProduct(int id) { var product = await productComponent.GetProduct(id); return(Json(product)); }