Example #1
0
 //Add new promotion with exception handling
 protected void AddPromo_Click(object sender, EventArgs e)
 {
     try
     {
         PromoGridView.Visible = false;
         BusinessLogic.CreatePromoCode(PromoTB.Text, short.Parse(PromoDisc.Text), ValidSCal.SelectedDate, Convert.ToInt32(PromoDur.Text));
         Label6.Text    = "Promo Created!";
         PromoTB.Text   = "";
         PromoDisc.Text = "";
         PromoDur.Text  = "";
         PCalVal.Text   = "";
     }
     catch (Exception)
     {
         Label6.Text = "Please enter a unique Promo Code";
     }
 }