private void submitBtn_Click(object sender, RoutedEventArgs e) { string customerIDStr = customerIDTxt.Text.Trim(); string title = titleTxt.Text.Trim(); string desc = descTxt.Text.Trim(); int customerID; bool success = int.TryParse(customerIDStr, out customerID); if (!success) { errorLbl.Text = "Customer ID must be a number!"; } else if (deptComboBox.SelectedItem == null) { errorLbl.Text = "Please input all field!"; } else { string department = (string)((ComboBoxItem)deptComboBox.SelectedValue).Content; FeedbackMediator mediator = new FeedbackMediator(); FeedbackFactory factory = new FeedbackFactory(); Feedback feedback = mediator.addFeedback(factory.createNewFeedback(customerID, department, title, desc)); if (feedback == null) { MessageBox.Show("Add feedback failed!"); } else { MessageBox.Show("Add feedback success!"); } } }
void Awake() { if (singleton == null) { feedbackFactory = new Factory <TileBase>(); Prototype_InitAtHand(); singleton = this; } else { Debug.LogError("Only one GridFeedbackManager, delete this on " + transform.name); Destroy(this); } }
public IToolContext <IToolOptions> CreateContext <T>(T options) where T : class, IToolOptions { if (FeedbackFactory == null) { throw new ArgumentException("Feedback factory must be set.", nameof(FeedbackFactory)); } var progressVisualizerFactory = FeedbackFactory.CreateProgressVisualizer(options); var lineLogger = FeedbackFactory.CreateLineLogger(options); var contentLogger = FeedbackFactory.CreateContentLogger(options); IToolContext <IToolOptions> context; if (TryCreateContextInternal(options, progressVisualizerFactory, lineLogger, contentLogger, out context)) { return(context); } return(null); }
public void add(int reservationID, string description, string type) { Feedback f = FeedbackFactory.create(reservationID, description, type); FeedbackRepository.add(f); }