Exemple #1
0
    private void BindData()
    {
        this.ddlImage.Items.Clear();
        this.ddlImage.Items.Add("--选择图片--");
        string path = base.Server.MapPath("../Private/" + base._Site.ID.ToString() + "/FriendshipLinks");

        if (!Directory.Exists(path))
        {
            Directory.CreateDirectory(path);
        }
        else
        {
            string[] fileList = Shove._IO.File.GetFileList(path);
            if (fileList != null)
            {
                for (int i = 0; i < fileList.Length; i++)
                {
                    this.ddlImage.Items.Add(fileList[i]);
                }
            }
        }
        long num2 = _Convert.StrToLong(Utility.GetRequest("id"), -1L);

        if (num2 < 0L)
        {
            PF.GoError(1, "参数错误", this.Page.GetType().BaseType.FullName);
        }
        else
        {
            this.tbID.Text = num2.ToString();
            DataTable table = new Tables.T_FriendshipLinks().Open("", "SiteID = " + base._Site.ID.ToString() + " and [ID] = " + num2.ToString(), "");
            if (table == null)
            {
                PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
            }
            else
            {
                this.tbName.Text      = table.Rows[0]["LinkName"].ToString();
                this.cbisShow.Checked = _Convert.StrToBool(table.Rows[0]["isShow"].ToString(), true);
                this.tbOrder.Text     = table.Rows[0]["Order"].ToString();
                this.tbUrl.Text       = table.Rows[0]["Url"].ToString();
                ControlExt.SetDownListBoxText(this.ddlImage, table.Rows[0]["LogoUrl"].ToString());
            }
        }
    }
Exemple #2
0
    private void BindExpertsInfo()
    {
        DataTable table = new Tables.T_ExpertsPredict().Open("", "ID=" + Utility.FilteSqlInfusion(this.hidID.Value), "");

        if ((table == null) || (table.Rows.Count == 0))
        {
            JavaScript.Alert(this.Page, "记录不存在!");
        }
        else
        {
            this.tbName.Text      = table.Rows[0]["Name"].ToString();
            this.cbisShow.Checked = _Convert.StrToBool(table.Rows[0]["ON"].ToString(), true);
            this.tbOldImage.Text  = table.Rows[0]["Url"].ToString().Trim();
            ControlExt.SetDownListBoxText(this.ddlImage, table.Rows[0]["Url"].ToString());
            if (table.Rows[0]["Url"].ToString().Trim() == "")
            {
                this.cbNoEditImage.Checked = false;
                this.cbNoEditImage.Visible = false;
            }
            this.tbDescription.Text         = table.Rows[0]["Description"].ToString();
            this.ddlLotteries.SelectedValue = table.Rows[0]["LotteryID"].ToString();
        }
    }