Пример #1
0
        protected void btnCreate_Click(object sender, EventArgs e)
        {
            string   strAuthor           = txtAuthor.Text.Trim();
            string   strPositionOfAuthor = txtPositionOfAuthor.Text.Trim();
            string   strCompany          = txtCompany.Text.Trim();
            string   strQuote            = txtQuote.Text.Trim();
            string   strRank             = txtRank.Text.Trim();
            DateTime dtDatePublished     = cldrPublished.SelectedDate;
            bool     boolIsActive        = chkIsActive.Checked;
            Guid     createdBy           = Guid.NewGuid();

            var proxy = new BusinessProxy();

            if (Id != null)
            {
                EntityPressReleaseQuotes pressReleaseQuote = proxy.GetPressReleaseQuote(Id);

                proxy.UpdatePressReleaseQuote(pressReleaseQuote.Id.ToString(), strAuthor, strPositionOfAuthor, strQuote, strRank, dtDatePublished, boolIsActive, strCompany);
            }
            else
            {
                proxy.CreatePressReleaseQuote(strAuthor, strPositionOfAuthor, strQuote, strRank, dtDatePublished, boolIsActive, createdBy, strCompany);
            }

            /*
             * txtAuthor.Text = "";
             * txtPositionOfAuthor.Text = "";
             * txtQuote.Text = "";
             * txtRank.Text = "";
             * chkIsActive.Checked = true;*/

            Response.Redirect("press-release-quotes.aspx");
        }