Example #1
0
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            Supplier supplier = await context.Suppliers.FindAsync(id);

            if (supplier == null)
            {
                return(HttpNotFound());
            }

            SupplierDetailsViewModel model = new SupplierDetailsViewModel(supplier);

            return(View(model));
        }
 public SupplierDetailsPage(int id)
 {
     InitializeComponent();
     BindingContext = model = new SupplierDetailsViewModel();
     model.Id       = id;
 }