Ejemplo n.º 1
0
    /// <summary>
    /// 定义数据绑定方法
    /// </summary>
    protected override void BindData()
    {
        string strWhere = " where FS_PID=0";
        XYECOM.Business.FriendLinkSort fl = new XYECOM.Business.FriendLinkSort();

        if (XYECOM.Core.XYRequest.GetQueryString("FS_PID") != "")
        {
            strWhere = " where FS_PID=" + XYECOM.Core.XYRequest.GetQueryString("FS_PID");
            //this.title.InnerHtml = fl.GetFriendLinkName(XYECOM.Core.XYRequest.GetQueryInt("FS_PID",0)) + "链接类别列表";
            this.lnkAdd.Text = "返回";
            //this.lnkA.Visible = true;
        }
        this.page1.RecTotal = Function.GetRows("b_FriendLinkSort", "FS_ID", strWhere);
        DataTable dt = Function.GetPages(this.page1.PageSize, this.page1.CurPage, strWhere, "Order by FS_ID DESC", "b_FriendLinkSort", "FS_ID,FS_Name,FS_PID,FS_Alt", "FS_ID");

        if (dt.Rows.Count > 0)
        {
            this.gvlist.DataSource = dt;
            this.gvlist.DataBind();
        }
        else
        {
            this.gvlist.DataBind();
            this.lblMessage.Text = "没有相关信息";
        }
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 定义修改信息时的数据绑定事件
    /// </summary>
    /// <param name="id"></param>
    protected void BindData(int id)
    {
        string strWhere = "where FS_ID=" + id;
        XYECOM.Business.FriendLinkSort fl = new XYECOM.Business.FriendLinkSort();
        DataTable dt = fl.GetDataTable(strWhere, "");

        if (dt.Rows.Count > 0)
        {
            this.tbfltypename.Text = dt.Rows[0]["FS_Name"].ToString();
            this.tbfltypealt.Text = dt.Rows[0]["FS_Alt"].ToString();
        }
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 定义单击添加按钮事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btadd_Click(object sender, EventArgs e)
    {
        int fsid = 0;
        int rowAff = 0;
        XYECOM.Model.FriendLinkSortInfo fs = new XYECOM.Model.FriendLinkSortInfo();
        XYECOM.Business.FriendLinkSort flk = new XYECOM.Business.FriendLinkSort();
        fs.FS_Name = this.tbfltypename.Text;
        fs.FS_Alt = this.tbfltypealt.Text;

        if (Request.QueryString["Type"] != null)
        {
            if (int.Parse(Request.QueryString["Type"]) == 0)
            {
                fs.FS_PID = 0;
                rowAff = flk.Insert(fs, out fsid);
                if (rowAff >= 0)
                {
                    Alert("添加友情链接分类成功!", "FriendLinkList.aspx?FS_PID=" + fs.FS_PID, true);
                }
                else if (rowAff == -2)
                {
                    Alert("添加友情链接分类添加失败!", "FriendLinkList.aspx?FS_PID=" + fs.FS_PID, true);
                }
                else if (rowAff == -1)
                {
                    Alert("该友情链接分类名称已经存在,请重新输入!");
                }
            }
            else
            {
                fs.FS_ID = int.Parse(Request.QueryString["FS_ID"].ToString());
                fs.FS_PID = 0;
                rowAff = flk.Update(fs);
                if (rowAff >= 0)
                {
                    Alert("修改友情链接分类成功!", "FriendLinkList.aspx?FS_PID=0", true);
                }
                else
                {
                    Alert("修改友情链接分类失败,可选择重新操作!", "FriendLinkList.aspx", true);
                }
            }
        }
        else
        {
            fs.FS_PID = 0;
            rowAff = flk.Insert(fs, out fsid);
            if (rowAff >= 0)
            {
                Alert("添加友情链分类成功!","FriendLinkList.aspx",true);
            }
            else if (rowAff == -2)
            {
                Alert("添加友情链接分类失败!", "FriendLinkList.aspx", true);
            }
            else if (rowAff == -1)
            {
                Alert("该友情链接分类名称已经存在,请重新输入!");
            }
        }
    }
Ejemplo n.º 4
0
    /// <summary>
    /// 判断加载类别方法
    /// </summary>
    private void PostType()
    {
        XYECOM.Business.FriendLinkSort flk = new XYECOM.Business.FriendLinkSort();

        if (XYECOM.Core.XYRequest.GetQueryString("FS_ID") != "")
        {
            BindData(int.Parse(XYECOM.Core.XYRequest.GetQueryString("FS_ID")));
        }
    }
Ejemplo n.º 5
0
    /// <summary>
    /// 定义删除事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void lnkDel_Click(object sender, EventArgs e)
    {
        string ids = "";
        XYECOM.Business.FriendLinkSort fs = new XYECOM.Business.FriendLinkSort();
        foreach (GridViewRow row in this.gvlist.Rows)
        {
            if (((CheckBox)(row.FindControl("chkExport"))).Checked == true)
                ids += "," + this.gvlist.DataKeys[row.DataItemIndex].Value.ToString();
        }

        if (ids.IndexOf(",") == 0)
            ids = ids.Substring(1);

        int SonNum = fs.GetSonType(ids);
        if (SonNum <= 0)
        {
            int rowAff = fs.Delete(ids);

            if (rowAff >= 0)
            {
                Response.Redirect("FriendLinkList.aspx");
            }
            else
            {
                Alert("删除成功!","FriendLinkList.aspx");
            }
        }
        else
        {
            Alert("该类别下面还有子类别,请先删除子类别!");
        }
    }
Ejemplo n.º 6
0
    private void BindData(int flid)
    {
        string strWhere = "where FL_ID=" + flid;
        XYECOM.Business.FriendLink fl = new XYECOM.Business.FriendLink();
        XYECOM.Business.FriendLinkSort fls = new XYECOM.Business.FriendLinkSort();
        DataTable dt = fl.GetDataTable(strWhere, "");
        if (dt.Rows.Count > 0)
        {
            if (Convert.ToBoolean(dt.Rows[0]["FL_Type"]) == false)
            {
                this.rbtext.Checked = true;
                this.tblinkfont.Text = dt.Rows[0]["FL_Font"].ToString();
            }
            else
            {
                this.rbpic.Checked = true;
                if (dt.Rows[0]["Fl_Font"].ToString() != "Image")
                {
                    this.rbpicurl.Checked = true;
                    this.tbpicaddress.Text = dt.Rows[0]["FL_Font"].ToString();

                }
                else
                {
                    this.rbpicupload.Checked = true;
                }
            }

            this.tblinkrul.Text = dt.Rows[0]["FL_URL"].ToString();
            this.tblinkalt.Text = dt.Rows[0]["FL_Alt"].ToString();

            this.flsortid.Text = dt.Rows[0]["FS_ID"].ToString();
        }
    }