Example #1
0
        protected void bnInsert_Click(object sender, System.EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    MyContent content = new MyContent(appEnv.GetConnection());
                    Account   account = new Account(appEnv.GetConnection());
                    content.Insert(Convert.ToInt32(lbContentID.Text),
                                   Convert.ToInt32(lbVersion.Text) + 1,
                                   0,
                                   tbHeadline.Text, tbSource.Text,
                                   Convert.ToInt32(lbBylineNum.Text),
                                   tbTeaser.Text, tbBody.Text, tbTagline.Text,
                                   Convert.ToInt32(lbEditorNum.Text),
                                   Convert.ToInt32(lbApproverNum.Text),
                                   account.GetAccountID(User.Identity.Name),
                                   Convert.ToInt32(lbStatusNum.Text));
                }
                catch (Exception err)
                {
                    Page_Error("The following error occured: " + err.Message);
                }

                Response.Redirect("AutList.aspx");
            }
        }
Example #2
0
        protected void bnReturn_Click(object sender, System.EventArgs e)
        {
            try
            {
                int       code;
                MyContent content = new MyContent(appEnv.GetConnection());
                Account   account = new Account(appEnv.GetConnection());

                content.Insert(cid, Convert.ToInt32(dr["Version"]) + 1, 0,
                               dr["Headline"].ToString(), dr["Source"].ToString(),
                               Convert.ToInt32(dr["Byline"]),
                               dr["Teaser"].ToString(), dr["Body"].ToString(),
                               dr["TagLine"].ToString(),
                               Convert.ToInt32(dr["Editor"]), 0,
                               account.GetAccountID(User.Identity.Name),
                               (code = StatusCodes.RequiresEditing));

                new Distribution(appEnv.GetConnection()).Remove(cid, ver);

                EmailAlert ea = new EmailAlert(Context, code, Convert.ToInt32(dr["Editor"]));
                ea.Send();
            }
            catch (Exception err)
            {
                Page_Error("The following error occured: " + err.Message);
            }

            Response.Redirect("DeployList.aspx");
        }
Example #3
0
        protected void bnWithdraw_Click(object sender, System.EventArgs e)
        {
            try
            {
                int       code;
                MyContent content = new MyContent(appEnv.GetConnection());
                Account   account = new Account(appEnv.GetConnection());

                DataRow dr = dt.Rows[0];

                content.Insert(cid, Convert.ToInt32(dr["Version"]) + 1, 0,
                               dr["Headline"].ToString(), dr["Source"].ToString(),
                               Convert.ToInt32(dr["Byline"]),
                               dr["Teaser"].ToString(), dr["Body"].ToString(),
                               dr["TagLine"].ToString(), 0,
                               Convert.ToInt32(dr["Approver"]),
                               account.GetAccountID(User.Identity.Name),
                               (code = StatusCodes.AwaitingEdit));

                EmailAlert ea = new EmailAlert(Context, code, 0);
                ea.Send();
            }
            catch (Exception err)
            {
                Page_Error("The following error occured: " + err.Message);
            }

            Response.Redirect("EdList.aspx");
        }
Example #4
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (IsPostBack)
            {
                Page.Validate();

                if (Page.IsValid)
                {
                    try
                    {
                        MyContent content = new MyContent(appEnv.GetConnection());
                        Account   account = new Account(appEnv.GetConnection());
                        content.Insert(tbHeadline.Text, tbSource.Text, account.GetAccountID(User.Identity.Name),
                                       tbTeaser.Text, tbBody.Text, tbTagline.Text);
                    }
                    catch (Exception err)
                    {
                        Page_Error("The following error occured: " + err.Message);
                    }

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