Example #1
0
        protected void btnok_Click(object sender, EventArgs e)
        {
            String content = "NT_ID='" + XYECOM.Core.Utils.AppendComma(this.ListBox2.SelectedValue) +"'";
            XYECOM.Business.News news = new XYECOM.Business.News();

            if (this.ListBox1.SelectedItem.Selected.Equals(true) || this.ListBox2.SelectedItem.Selected.Equals(true))
            {
                if (this.rbtone.Checked == true)
                {
                    String strwhere = "where NT_ID=" + "'" + XYECOM.Core.Utils.AppendComma(this.ListBox1.SelectedValue) + "'";
                    news.MoveNews(strwhere, content);
                    this.lblMessage.Text = "�����ɹ�";
                }
                if (this.rbtmany.Checked == true)
                {
                    String strwhere = "where " + XYECOM.Business.Utils.GetNewsChannelQueryWhere(Core.MyConvert.GetInt32(this.ListBox1.SelectedValue));
                    news.MoveNews(strwhere, content);
                    this.lblMessage.Text = "�����ɹ�";
                }
            }
        }
Example #2
0
        protected void btnOKToTopic_ServerClick(object sender, EventArgs e)
        {
            //�õ�Ҫ�������ŵ�����id
            string newsIds = XYECOM.Core.XYRequest.GetString("ids");

            //�õ���ѡ���value�����б�ѡר���id
            string j = "";
            foreach (RepeaterItem item in this.rptList.Items)
            {
                HtmlInputCheckBox cb = (HtmlInputCheckBox)item.FindControl("cbsel");
                if (cb.Checked)
                {

                    j = "," + cb.Value.ToString() + j;

                }
            }
            if (j == "")
            {
                Response.Write("<script>alert('��ѡ���й�ר�⣡');</script>");
                return;
            }
            if (j.IndexOf(',') == 0)
            {
                j = j.Substring(1);
            }

            //�Ѵ�ű�ѡ������id���ַ���ת��Ϊ����
            string[] arr1 = newsIds.Split(',');
            //���һ��һ��Ҫ�޸�ר�����ŵ�����
            int newsidsCount = arr1.Length;

            //����һ����������¼һ�����ijɹ�������
            int count = 0;

            XYECOM.Business.News newsBLL = new XYECOM.Business.News();
            NewsInfo newsInfo = null;

            for (int i = 0; i < arr1.Length; i++)
            {
                //���������ŵ�ר������޸�
                newsInfo = newsBLL.GetItem(long.Parse(arr1[i]));

                if (newsInfo == null) continue;

                newsInfo.TopicType = j;
                int num = newsBLL.Update(newsInfo);
                if (num > 0)
                {
                    count = count + 1;
                }

            }
            //���Ҫ�޸�ר�����ŵ���������һ���޸ijɹ�������˵����������ɹ�
            if (newsidsCount == count)
            {

                Response.Write("<script>parent.CloseTopicType();parent.ClearSelect();parent.alertmsg('��������ɹ���');</script>");

            }
            else
            {
                Response.Write("<script>parent.CloseTopicType();parent.alertmsg('��������ʧ�ܣ�');</script>");
            }
        }