public StockDetails(object sender, int barId) { InitializeComponent(); bar = barService.Find(barId); mainwindow = (MainWindow)sender; //Create initial lists List <Stock> barStocks = barService.GetAllStocks(bar.ID).ToList(); List <Ingredient> allIngredients = barService.GetAllIngredients().ToList(); Show_Stocks(barStocks); Show_Potential_Stocks(barStocks, allIngredients); }
public ReadBar(object sender, int barId) { InitializeComponent(); //Main window ref mainWindow = (MainWindow)sender; //Find bar readBar = barService.Find(barId); textbox_name.Text = readBar.Name; textbox_username.Text = readBar.Username; textbox_address.Text = readBar.Address.AddressName; textbox_email.Text = readBar.Email; textbox_phone.Text = readBar.PhoneNumber; textblock_city.Text = readBar.Address.Zipcode.CityName; fillCountryComboBox(); fillZipComboBox(); combobox_countries.SelectionChanged += combobox_countries_SelectionChanged; combobox_zipcodes.SelectionChanged += combobox_zipcodes_SelectionChanged; }
public ActionResult Index(int barId, string message) { using (ServiceHelper serviceHelper = new ServiceHelper()) { DrinkServiceClient drinkProxy = serviceHelper.GetDrinkServiceClient(); BarServiceClient barProxy = serviceHelper.GetBarServiceClient(); //Ambiguous reference her BarServiceRerefence.Bar foundBar = barProxy.Find(barId); DrinkServiceReference.Bar bar = new DrinkServiceReference.Bar(); bar.ID = foundBar.ID; bar.Name = foundBar.Name; Dictionary <int, DrinkViewModel> drinks = drinkProxy.GetAvailableDrinks(bar); ViewBag.barId = barId; ViewBag.BarName = bar.Name; ViewBag.Message = message; return(View(drinks)); } }