Ejemplo n.º 1
0
 private void btnAddRating_Click(object sender, EventArgs e)
 {
     if (cboDeliveryBoy.SelectedItem != null)
     {
         DeliveryBoyRating deliveryBoyRating = new DeliveryBoyRating()
         {
             DeliveryBoy = cboDeliveryBoy.SelectedItem.ToString(),
             Rating      = numRating.Value
         };
         DeliveryBoyRatingService.AddNewRating(deliveryBoyRating);
         ratingsDataGridView.DataSource = null;
         ratingsDataGridView.DataSource = DeliveryBoyRatingService.GetRatings();
         ratingsDataGridView.Refresh();
         MessageBox.Show("Rating is successfully added.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         MessageBox.Show("Delivery boy is not selected.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 2
0
 private void DeliveryBoyRatingForm_Load(object sender, EventArgs e)
 {
     ratingsDataGridView.DataSource = DeliveryBoyRatingService.GetRatings();
 }