private void BtnEndDiscount_Click(object sender, EventArgs e) { MasterForm master = (this.Parent.Parent as MasterForm); try { if (DBItem.DeleteDiscount((int)this.nudItemID.Value)) { this.dtpDiscountFrom.ResetText(); this.dtpDiscountTo.ResetText(); this.nudDiscountPrice.ResetText(); master.SetStatus("Discount has ended successfully."); } } catch (Exception ex) { master.SetStatus("Error! Failed to end discount: " + ex.Message); } }