예제 #1
0
    private void UpdatePublish()
    {
        int newsID = Convert.ToInt32(lblNewsID.Text);

        if (newsID < 1)
        {
            return;
        }
        NewsPublish _NewsPublish = new NewsPublish();

        _NewsPublish.Delete(newsID);
        if (drpCate1.SelectedValue != "0")
        {
            _NewsPublish.NewsID = newsID;
            _NewsPublish.CateID = Convert.ToInt32(drpCate1.SelectedValue);
            _NewsPublish.Order  = Convert.ToInt32(drpOrder1.Text);
            _NewsPublish.Add();
        }

        if (drpCate2.SelectedValue != "0")
        {
            _NewsPublish.NewsID = newsID;
            _NewsPublish.CateID = Convert.ToInt32(drpCate2.SelectedValue);
            _NewsPublish.Order  = Convert.ToInt32(drpOrder2.Text);
            _NewsPublish.Add();
        }

        if (drpCate3.SelectedValue != "0")
        {
            _NewsPublish.NewsID = newsID;
            _NewsPublish.CateID = Convert.ToInt32(drpCate3.SelectedValue);
            _NewsPublish.Order  = Convert.ToInt32(drpOrder3.Text);
            _NewsPublish.Add();
        }


        if (drpCate4.SelectedValue != "0")
        {
            _NewsPublish.NewsID = newsID;
            _NewsPublish.CateID = Convert.ToInt32(drpCate4.SelectedValue);
            _NewsPublish.Order  = Convert.ToInt32(drpOrder4.Text);
            _NewsPublish.Add();
        }

        if (drpCate5.SelectedValue != "0")
        {
            _NewsPublish.NewsID = newsID;
            _NewsPublish.CateID = Convert.ToInt32(drpCate5.SelectedValue);
            _NewsPublish.Order  = Convert.ToInt32(drpOrder5.Text);
            _NewsPublish.Add();
        }
    }
예제 #2
0
    private void UpdatePublish()
    {
        int         newsID       = AppUtils.Request("id");
        NewsPublish _NewsPublish = new NewsPublish();

        _NewsPublish.Delete(newsID);
        if (drpCate1.SelectedValue != "0")
        {
            _NewsPublish.NewsID = newsID;
            _NewsPublish.CateID = Convert.ToInt32(drpCate1.SelectedValue);
            _NewsPublish.Order  = Convert.ToInt32(drpOrder1.Text);
            _NewsPublish.Add();
        }

        if (drpCate2.SelectedValue != "0")
        {
            _NewsPublish.NewsID = newsID;
            _NewsPublish.CateID = Convert.ToInt32(drpCate2.SelectedValue);
            _NewsPublish.Order  = Convert.ToInt32(drpOrder2.Text);
            _NewsPublish.Add();
        }

        if (drpCate3.SelectedValue != "0")
        {
            _NewsPublish.NewsID = newsID;
            _NewsPublish.CateID = Convert.ToInt32(drpCate3.SelectedValue);
            _NewsPublish.Order  = Convert.ToInt32(drpOrder3.Text);
            _NewsPublish.Add();
        }


        if (drpCate4.SelectedValue != "0")
        {
            _NewsPublish.NewsID = newsID;
            _NewsPublish.CateID = Convert.ToInt32(drpCate4.SelectedValue);
            _NewsPublish.Order  = Convert.ToInt32(drpOrder4.Text);
            _NewsPublish.Add();
        }

        if (drpCate5.SelectedValue != "0")
        {
            _NewsPublish.NewsID = newsID;
            _NewsPublish.CateID = Convert.ToInt32(drpCate5.SelectedValue);
            _NewsPublish.Order  = Convert.ToInt32(drpOrder5.Text);
            _NewsPublish.Add();
        }
    }