Example #1
0
        protected void btnCreate_Click(object sender, EventArgs e)
        {
            string   strClient                 = drpClient.SelectedValue;
            string   strAuthor                 = txtAuthor.Text.Trim();
            string   strPositionOfAuthor       = txtPositionOfAuthor.Text.Trim();
            string   strTestimonialDescription = txtTestimonial.Text.Trim();
            string   strRank               = txtRank.Text.Trim();
            DateTime dtDatePublished       = cldrPublished.SelectedDate;
            bool     boolIsActive          = chkIsActive.Checked;
            Guid     createdBy             = Guid.NewGuid();
            bool     boolIsShownOnHomePage = chkIsShownOnHomePage.Checked;

            var proxy = new BusinessProxy();

            if (Id != null)
            {
                EntityTestimonial testimonial = proxy.GetTestimonial(Id);

                proxy.UpdateTestimonial(testimonial.Id.ToString(), strClient, strAuthor, strPositionOfAuthor, strTestimonialDescription, strRank, dtDatePublished, boolIsActive, boolIsShownOnHomePage);
            }
            else
            {
                proxy.CreateTestimonial(strClient, strAuthor, strPositionOfAuthor, strTestimonialDescription, strRank, dtDatePublished, boolIsActive, createdBy, boolIsShownOnHomePage);
            }

            /*
             * drpClient.SelectedIndex = 0;
             * txtAuthor.Text = "";
             * txtPositionOfAuthor.Text = "";
             * txtTestimonial.Text = "";
             * txtRank.Text = "";
             * chkIsActive.Checked = true;*/

            Response.Redirect("testimonials.aspx");
        }