protected void btnCreate_Click(object sender, EventArgs e) { string strTitle = txtTitle.Text.Trim(); string strDescription = txtDescription.Text.Trim(); string strNewsReleaseUrl = txtNewsReleaseUrl.Text.Trim(); DateTime dtDatePublished = cldrPublished.SelectedDate; bool boolIsActive = chkIsActive.Checked; bool boolIsSecure = chkIsSecure.Checked; Guid createdBy = Guid.NewGuid(); var proxy = new BusinessProxy(); if (Id != null) { EntityNewsReleases newsRelease = proxy.GetNewsRelease(Id); proxy.UpdateNewsRelease(newsRelease.Id.ToString(), strTitle, strDescription, strNewsReleaseUrl, dtDatePublished, boolIsActive, boolIsSecure); } else { proxy.CreateNewsRelease(strTitle, strDescription, strNewsReleaseUrl, dtDatePublished, boolIsActive, boolIsSecure, createdBy); } /* * txtTitle.Text = ""; * txtDescription.Text = ""; * txtNewsReleaseUrl.Text = ""; * chkIsActive.Checked = true;*/ Response.Redirect("news-releases.aspx"); }