Пример #1
0
 protected void Button_First_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(ListBox1.SelectedValue))
     {
         ListItem li = new ListItem(ListBox1.SelectedItem.Text, ListBox1.SelectedValue);
         ListBox1.Items.Remove(li);
         ListBox1.Items.Insert(0, li);
     }
     else
     {
         InText.Alert("请选择要排序的友链!");
     }
 }
Пример #2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string sql = "";
            int    i   = 0;

            foreach (ListItem li in ListBox1.Items)  //循环遍历
            {
                i++;
                sql = " update t_friendlink set link_order=" + i.ToString() + " where id=" + li.Value;
                artBll.ExecuteSQLNonquery(sql);
            }

            this.CteateHTML(url + "index927_2.aspx", "/", "");//重新生成首页

            this.BindList();
            InText.Alert("保存成功!");
        }
Пример #3
0
 protected void Button_Before_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(ListBox1.SelectedValue))
     {
         if (ListBox1.SelectedIndex > 0)
         {
             ListItem li = new ListItem(ListBox1.SelectedItem.Text, ListBox1.SelectedValue);
             ListBox1.Items[ListBox1.SelectedIndex].Text      = ListBox1.Items[ListBox1.SelectedIndex - 1].Text;
             ListBox1.Items[ListBox1.SelectedIndex].Value     = ListBox1.Items[ListBox1.SelectedIndex - 1].Value;
             ListBox1.Items[ListBox1.SelectedIndex - 1].Text  = li.Text;
             ListBox1.Items[ListBox1.SelectedIndex - 1].Value = li.Value;
             ListBox1.SelectedValue = li.Value;
         }
     }
     else
     {
         InText.Alert("请选择要排序的友链!");
     }
 }
Пример #4
0
        //上传按钮
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            //http://localhost:5750/Upload.svc

            ServiceReference1.UploadClient      client  = new MyProject02.ServiceReference1.UploadClient();
            ServiceReference1.FileUploadMessage message = new ServiceReference1.FileUploadMessage();
            message.FileName = FileUpload1.FileName;
            message.SavePath = @"D:\kkk\";
            message.FileData = FileUpload1.FileContent;

            ServiceReference1.IUpload channel = client.ChannelFactory.CreateChannel();

            ServiceReference1.UploadResultMessage resultMessage = new MyProject02.ServiceReference1.UploadResultMessage();
            resultMessage = channel.UploadFile(message);

            if (resultMessage.UploadResult == "1")
            {
                InText.Alert("上传成功!");
            }
        }