Exemple #1
0
        protected void btnCreate_Click(object sender, EventArgs e)
        {
            string   strTitle          = txtTitle.Text.Trim();
            string   strDescription    = txtDescription.Text.Trim();
            string   strNewsReleaseUrl = txtPressReleaseUrl.Text.Trim();
            DateTime dtDatePublished   = cldrPublished.SelectedDate;
            bool     boolIsActive      = chkIsActive.Checked;
            Guid     createdBy         = Guid.NewGuid();

            var proxy = new BusinessProxy();

            if (Id != null)
            {
                EntityPressReleases pressRelease = proxy.GetPressRelease(Id);

                proxy.UpdatePressRelease(pressRelease.Id.ToString(), strTitle, strDescription, strNewsReleaseUrl, dtDatePublished, boolIsActive);
            }
            else
            {
                proxy.CreatePressRelease(strTitle, strDescription, strNewsReleaseUrl, dtDatePublished, boolIsActive, createdBy);
            }

            /*
             * txtTitle.Text = "";
             * txtDescription.Text = "";
             * txtNewsReleaseUrl.Text = "";
             * chkIsActive.Checked = true;*/

            Response.Redirect("press-releases.aspx");
        }
Exemple #2
0
        public void GetPressRelease(string Id)
        {
            var proxy = new BusinessProxy();
            EntityPressReleases pressRelease = proxy.GetPressRelease(Id);

            txtTitle.Text              = pressRelease.Title;
            txtDescription.Text        = pressRelease.Description;
            txtPressReleaseUrl.Text    = pressRelease.PressReleaseFileURL;
            cldrPublished.SelectedDate = pressRelease.DatePublished;
            chkIsActive.Checked        = pressRelease.IsActive;
        }