Example #1
0
 private void btnPromote_Click(object sender, EventArgs e)
 {
     if (JobOfferService.GetOfferById(Convert.ToInt32(lblId.Text)).Promoted)
     {
         btnPromote.BackColor = Color.White;
         btnPromote.ForeColor = Color.Black;
         JobOfferService.GetOfferById(Convert.ToInt32(lblId.Text)).Promoted = false;
     }
     else
     {
         JobOfferService.GetOfferById(Convert.ToInt32(lblId.Text)).Promoted = true;
         btnPromote.BackColor = Color.DarkSlateGray;
         btnPromote.ForeColor = Color.White;
         MessageBox.Show("Promoted");
     }
 }
Example #2
0
        public OfferComponent(JobOffer offer)
        {
            InitializeComponent();

            lblId.Text           = offer.Id.ToString();
            lblBusinessName.Text = offer.Business.Name;
            lblTitleJob.Text     = offer.Title;
            lblDescription.Text  = offer.Description;
            lblCategory.Text     = "Category: " + offer.Category.Name;
            lblAddress.Text      = offer.Address.City + " - " + offer.Address.Street + " -  No: " + offer.Address.PostalCode;
            if (JobOfferService.GetOfferById(Convert.ToInt32(lblId.Text)).Promoted)
            {
                btnPromote.BackColor = Color.White;
                btnPromote.ForeColor = Color.Black;
                JobOfferService.GetOfferById(Convert.ToInt32(lblId.Text)).Promoted = false;
            }
        }