Exemplo n.º 1
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            try
            {
                Joke jokeOBJ = Factory.CreateJoke();
                CUD.AddJoke(AssignValues(jokeOBJ));

                alertexit1.Checked   = false;
                alertexit2.Checked   = true;
                SysMessage.InnerText = "Joke creation successful!";
            } catch (Exception ex)
            {
                alertexit1.Checked      = true;
                alertexit2.Checked      = false;
                SysMessageErr.InnerText = "Joke creation failed";
                SysDetails.InnerText    = ex.Message;
            }
        }
Exemplo n.º 2
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                Joke newJoke = Factory.CreateJoke();
                CUD.UpdateJoke(SetValue(newJoke));

                alertexit1.Checked   = false;
                alertexit2.Checked   = true;
                SysMessage.InnerText = "Joke update successful!";
            } catch (Exception ex)
            {
                alertexit1.Checked      = true;
                alertexit2.Checked      = false;
                SysMessageErr.InnerText = "Joke update failed";
                SysDetails.InnerText    = ex.Message;
            }
        }