Exemplo n.º 1
0
    public void MyBind()
    {
        B_DownServer bdownserver = new B_DownServer();

        GridView1.DataSource = bdownserver.GetDownServerAll();// GetAuthorPage(0, 0, 10);
        GridView1.DataBind();
    }
Exemplo n.º 2
0
    private void DeleteKeyWords(string SId)
    {
        B_DownServer bdownserver = new B_DownServer();

        if (bdownserver.DeleteByID(SId))
        {
            HttpContext.Current.Response.Write("<script language=javascript> alert('删除成功!');window.document.location.href='DownServerManage.aspx';</script>");
        }
    }
Exemplo n.º 3
0
    private void InItModify(int Dsid)
    {
        B_DownServer bdownerver  = new B_DownServer();
        M_DownServer mdownserver = bdownerver.GetDownServerByid(Dsid);

        TxtServerName.Text         = mdownserver.ServerName;
        TxtServerLogo.Text         = mdownserver.ServerLogo;
        TxtServerUrl.Text          = mdownserver.ServerUrl;
        DropShowType.SelectedValue = mdownserver.ShowType.ToString();
        EBtnModify.Visible         = true;
        EBtnSubmit.Visible         = false;
    }
Exemplo n.º 4
0
    protected void EBtnSubmit_Click(object sender, EventArgs e)
    {
        B_DownServer bdownserver = new B_DownServer();
        M_DownServer mdownserver = new M_DownServer();

        mdownserver.ServerID   = bdownserver.Max() + 1;
        mdownserver.ServerName = TxtServerName.Text.ToString();
        mdownserver.ServerLogo = TxtServerLogo.Text.ToString();
        mdownserver.ServerUrl  = TxtServerUrl.Text.ToString();
        mdownserver.ShowType   = Convert.ToInt32(DropShowType.SelectedValue);
        if (bdownserver.Add(mdownserver))
        {
            Response.Write("<script language=javascript> alert('添加成功!');window.document.location.href='DownServerManage.aspx';</script>");
            //Page.Response.Redirect("DownServerManage.aspx");
        }
    }
Exemplo n.º 5
0
 private void Serverlist()
 {
     if (this.SetDownFiled.SelectedValue == "1")
     {
         this.downserver.Visible = true;
         B_DownServer downdll  = new B_DownServer();
         DataTable    downlist = downdll.GetDownServerAll();
         downlist.DefaultView.Sort      = "ServerID";
         this.serverlist.DataSource     = downlist;
         this.serverlist.DataTextField  = "ServerName";
         this.serverlist.DataValueField = "ServerID";
         this.serverlist.DataBind();
         this.serverlist.Items.Insert(0, new ListItem("请选择服务器", ""));
         for (int i = 0; i < this.Type.Items.Count; i++)
         {
             if (this.Type.Items[i].Value != "SmallFileType")
             {
                 this.Type.Items[i].Enabled = false;
             }
             else
             {
                 int          FieldID = DataConverter.CLng(base.Request.QueryString["FieldID"]);
                 int          ModelID = DataConverter.CLng(base.Request.QueryString["ModelID"]);
                 M_ModelField field   = this.bll.GetModelByID(ModelID.ToString(), FieldID);
                 string       content = field.Content;
                 this.ChkFileSize.Enabled               = false;
                 this.TxtFileSizeField.Enabled          = false;
                 this.TxtMaxFileSizes.Text              = this.bll.GetFieldContent(content, 0, 1);
                 this.TxtUploadFileTypes.Text           = this.bll.GetFieldContent(content, 1, 1);
                 this.DivSmallFileType.Style["display"] = "";
                 this.tbSearch.Style["display"]         = "none";
                 this.DivTextType.Style["display"]      = "none";
                 this.Type.Items[i].Selected            = true;
             }
         }
     }
 }
Exemplo n.º 6
0
    protected void btndelete_Click(object sender, EventArgs e)
    {
        B_DownServer bdownserver = new B_DownServer();
        int          i = 0, flag = 0; string sid = "";

        //int f = GridView1.Rows.Count;//测试用OnClientClick="return confirm('确定要删除选中的服务器吗?')"
        for (i = 0; i < GridView1.Rows.Count; i++)
        {
            CheckBox cbox  = (CheckBox)GridView1.Rows[i].Cells[0].FindControl("SelectCheckBox");
            bool     check = cbox.Checked;
            if (((CheckBox)GridView1.Rows[i].Cells[0].FindControl("SelectCheckBox")).Checked)//check
            {
                sid = GridView1.DataKeys[GridView1.Rows[i].RowIndex].Value.ToString();
                if (bdownserver.DeleteByID(sid))
                {
                    flag++;
                }
            }
        }
        if (flag > 0)
        {
            Response.Write("<script language=javascript> alert('批量删除成功!');window.document.location.href='DownServerManage.aspx';</script>");
        }
    }