static void room_availabilityEvent(Room sender, AvailabilityEventArgs e) { foreach (Room room in rooms) { room.RecievedUpdateListItem(roomListDictionary[sender.ID], sender.ID, sender.Name, e.availableForSending, e.availableForReceiving, sender.Enabled); } }
void sendAvailability(object sender, AvailabilityEventArgs e) { try { protocol.Send(e.Availability.AvailabilityName); } catch (Exception ex) { OnLog(new MessageEventArgs("Exception while trying to send command. " + ex.ToString())); } }
/* * Fire an event to notify the controller that the user wants to add stock for a given item. */ private void addAvailabilityButton_Click(object sender, EventArgs e) { if (productIdInput.SelectedItem == null || String.IsNullOrEmpty(quantityInput.Text) || String.IsNullOrEmpty(arrivalDateInput.Text)) { return; } int id = (int)productIdInput.SelectedItem; int quantity = int.Parse(quantityInput.Text); DateTime shipDate = Convert.ToDateTime(arrivalDateInput.Text); AvailabilityEventArgs args = new AvailabilityEventArgs(id, quantity, shipDate); availabilityButtonClicked.Invoke(this, args); }
void lyncx_AvailabilityChanged(object sender, AvailabilityEventArgs e) { sendAvailability(sender, e); }