protected void btnSubmit_Click(object sender, EventArgs e)
 {
     if (lbxDailyMotivators.SelectedIndex == -1)
     {
         DataLayer dl           = new DataLayer();
         DateTime  dtPostTime   = DateTime.Now;
         string    sYouTubeLink = "No Video.";
         if (tbxYouTubeLink.Text != "")
         {
             sYouTubeLink = tbxYouTubeLink.Text;
         }
         dl.AddDailyMotivator(dtPostTime, tbxTitle.Text, sYouTubeLink, rteBody.Value);
         Session["resultColor"]     = "#007700";
         Session["resultTitle"]     = "Daily Motivator Added";
         Session["resultMessage"]   = "Daily Motivator Added Successfuly";
         Session["resultReturnURL"] = "ManageDailyMotivator.aspx";
         Response.Redirect("Result.aspx");
     }
     else
     {
         if (cbxDeleteDailyMotivator.Checked)
         {
             DataLayer dl = new DataLayer();
             dl.DeleteDailyMotivator(Convert.ToInt32(lbxDailyMotivators.SelectedValue));
             Session["resultColor"]     = "#007700";
             Session["resultTitle"]     = "Daily Motivator Deleted";
             Session["resultMessage"]   = "Daily Motivator Deleted Successfuly";
             Session["resultReturnURL"] = "ManageDailyMotivator.aspx";
             Response.Redirect("Result.aspx");
         }
         else
         {
             DataLayer dl           = new DataLayer();
             string    sYouTubeLink = "No Video.";
             if (tbxYouTubeLink.Text != "")
             {
                 sYouTubeLink = tbxYouTubeLink.Text;
             }
             dl.UpdateDailyMotivator(Convert.ToInt32(lbxDailyMotivators.SelectedValue), tbxTitle.Text, sYouTubeLink, rteBody.Value);
             Session["resultColor"]     = "#007700";
             Session["resultTitle"]     = "Daily Motivator Updated";
             Session["resultMessage"]   = "Daily Motivator Updated Successfuly";
             Session["resultReturnURL"] = "ManageDailyMotivator.aspx";
             Response.Redirect("Result.aspx");
         }
     }
 }
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     if (lbxDailyMotivators.SelectedIndex == -1)
     {
         DataLayer dl = new DataLayer();
         DateTime dtPostTime = DateTime.Now;
         string sYouTubeLink = "No Video.";
         if (tbxYouTubeLink.Text != "")
         {
             sYouTubeLink = tbxYouTubeLink.Text;
         }
         dl.AddDailyMotivator(dtPostTime, tbxTitle.Text, sYouTubeLink, rteBody.Value);
         Session["resultColor"] = "#007700";
         Session["resultTitle"] = "Daily Motivator Added";
         Session["resultMessage"] = "Daily Motivator Added Successfuly";
         Session["resultReturnURL"] = "ManageDailyMotivator.aspx";
         Response.Redirect("Result.aspx");
     }
     else
     {
         if (cbxDeleteDailyMotivator.Checked)
         {
             DataLayer dl = new DataLayer();
             dl.DeleteDailyMotivator(Convert.ToInt32(lbxDailyMotivators.SelectedValue));
             Session["resultColor"] = "#007700";
             Session["resultTitle"] = "Daily Motivator Deleted";
             Session["resultMessage"] = "Daily Motivator Deleted Successfuly";
             Session["resultReturnURL"] = "ManageDailyMotivator.aspx";
             Response.Redirect("Result.aspx");
         }
         else
         {
             DataLayer dl = new DataLayer();
             string sYouTubeLink = "No Video.";
             if (tbxYouTubeLink.Text != "")
             {
                 sYouTubeLink = tbxYouTubeLink.Text;
             }
             dl.UpdateDailyMotivator(Convert.ToInt32(lbxDailyMotivators.SelectedValue), tbxTitle.Text, sYouTubeLink, rteBody.Value);
             Session["resultColor"] = "#007700";
             Session["resultTitle"] = "Daily Motivator Updated";
             Session["resultMessage"] = "Daily Motivator Updated Successfuly";
             Session["resultReturnURL"] = "ManageDailyMotivator.aspx";
             Response.Redirect("Result.aspx");
         }
     }
 }