<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head id="Head1" runat="server">
    <title>分類管理</title>
    <link href="../images/style/style.css"  type="text/css" rel="stylesheet">
    <script type="text/javascript" charset="gb2312" src="../images/js/common.js"></script>
    <script  type="text/javascript" charset="GB2312" src="/Office/style/1/js/Ajax.js"></script>
    <script type="text/javascript">
    function openWindow(url,width,height)
    {
    window.open(url,"_blank","height="+height+",width="+width+",top="+((screen.availHeight-height)/2)+",left="+((screen.availWidth-width)/2)+",toolbar=no,menubar=yes,scrollbars=yes, resizable=yes,location=no, status=no");
    }
    </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <table bgcolor="#c4d8ed" border="0" cellpadding="0" cellspacing="0" width="100%">
                <tbody>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <table align="center" border="1" cellpadding="4" cellspacing="1" class="toptable grid fixed">
                                <tbody>
                                    <tr>
                                        <td class="category" style="height: 17px; width: 190px;">
                                        </td>
                                        <td align="center" class="category" style="height: 17px">
                                            分類名:<asp:TextBox ID="TbKeyword" runat="server"></asp:TextBox>
                                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                            <asp:Button ID="BtSearch" runat="server" OnClick="BtSearch_Click" Text="搜索" />
                                            &nbsp;&nbsp;
                                            <input id="BtAdd" type="button" value="添加一級分類" onclick="openWindow('TypeEdit.aspx?parentid=0&depth=0&action=add',800,300)"/></td>
                                    </tr>
                                </tbody>
                            </table>
                          
                            <table align="center" border="1" cellpadding="4" cellspacing="1" class="toptable grid fixed"
                                style="color: #0000ff">
                                <tbody>
                                    <tr>
                                        <td align="center" colspan="6" style="height: 144px">
                                            <asp:GridView ID="gvList" runat="server" AutoGenerateColumns="False"                 BorderColor="#337FB2" BorderWidth="2px" CellPadding="4" Font-Size="Small" ForeColor="#333333"                                  Height="32%" OnRowDataBound="gvList_RowDataBound" Width="100%">
                                                <FooterStyle BackColor="#A6A1E0" Font-Bold="True" ForeColor="White" />
                                                <Columns>
                                                    <asp:BoundField HeaderText="選擇">
                                                        <ItemStyle Width="5%" />
                                                    </asp:BoundField>
                                                    <asp:BoundField DataField="Column_ID" HeaderText="編號">
                                                        <ItemStyle Width="10%" />
                                                    </asp:BoundField>
                                                    <asp:BoundField DataField="Column_Name" HeaderText="分類名稱" />
                                                    <asp:BoundField DataField="Column_Order" HeaderText="順序編號">
                                                        <ItemStyle Width="15%" />
                                                    </asp:BoundField>
                                                    <asp:BoundField HeaderText="子類數目" DataField="childsnNum" />
                                                    <asp:BoundField HeaderText="上移" />
                                                    <asp:BoundField HeaderText="下移" />
                                                    <asp:BoundField HeaderText="操作" />
                                                    <asp:BoundField HeaderText="查看子類" />
                                                </Columns>
                                                <RowStyle BackColor="White" Font-Bold="True" Font-Size="Small" ForeColor="#003399"
                                                    HorizontalAlign="Center" />
                                                <EditRowStyle BackColor="#999999" />
                                                <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
                                                <PagerStyle BackColor="#337FB2" ForeColor="White" HorizontalAlign="Center" VerticalAlign="Middle" />
                                                <HeaderStyle BackColor="#337FB2" Font-Size="12px" ForeColor="White" HorizontalAlign="Center"
                                                    VerticalAlign="Middle" />
                                                <AlternatingRowStyle BackColor="#E8F4FF" Font-Bold="True" Font-Size="Small" HorizontalAlign="Center" />
                                            </asp:GridView>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="center" style="height: 29px">
                                            <input id="checkallpri" class="nogrid" name="checkallpri" onclick="checkAll('action','checkallpri')"
                                                style="border-right: medium none; border-top: medium none; border-left: medium none;
                                                border-bottom: medium none" type="checkbox" /></td>
                                        <td colspan="5" style="height: 29px">
                                            &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<asp:Button ID="BtVerfly" runat="server" OnClick="BtVerfly_Click"
                                                Text="審核" />
                                            &nbsp; &nbsp;
                                            <asp:Button ID="BtDel" runat="server" OnClick="BtDel_Click" Text="刪除" />
                                            &nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<input id="Button1" type="button" value="返回" onclick="history.go(-2)"/><span class="t2"></span></td>
                                    </tr>
                                    <tr>
                                        <td colspan="6">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="6">
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                          
                        </td>
                        <td>
                        </td>
                    </tr>
                </tbody>
            </table>
        <br />  <br />
        </div>
        </form>
    </body>
    </html>

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using System.Data.SqlClient;

    namespace domain.UI.images.News
    {
        public partial class TypeList : domain.BLL.AdminPage
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                if (!Page.IsPostBack)
                {
                    AjaxFunction();
                    //Power(this.U_Account, this.MIDS[Convert.ToInt32(domain.BLL.ModelList.系統設置)]);
                    BindSortList();
                    if (this.GetRequest("columnid").Length > 0 && this.GetRequest("mark").Length < 1)
                    {
                        Move(Convert.ToInt32(this.GetRequest("direction")), this.GetRequest("columnid"), this.GetRequest("columnorder"));
                    }
                    ViewState["depth"] = this.GetRequest("depth").Length < 1 ? ("0") : (this.GetRequest("depth"));

                }
            }
            public override domain.BLL.RightClass Power(string U_Account, string M_ID)
            {
                domain.BLL.RightClass rc = base.Power(U_Account, M_ID);
                this.BtDel.Visible = rc.right_Delete;
                this.BtVerfly.Visible = rc.right_Verify;

                return rc;

            }
            public void AjaxFunction()
            {
                string IsAjax = GetRequest("IsAjax");
                if (IsAjax.Length > 0)
                {
                    string temp = "";
                    string State = GetRequest("State").ToLower();
                    State = State == "true" || State.Length < 1 ? ("0") : ("1");
                    string Gid = GetRequest("Gid");
                    string sql = "update newssort set bs_showindex=@bs_showindex where Column_ID=@Column_ID";
                    if (this.Db.GetState(sql, new SqlParameter[] { new SqlParameter("@bs_showindex", State), new SqlParameter("@Column_ID", Gid) }))
                    {
                        temp = "1";
                    }
                    else
                    {
                        temp = "0";
                    }
                    Response.Clear();
                    Response.Write(temp);
                    Response.End();
                }
            }
            /// <summary>
            /// 移動操作
            /// </summary>
            /// <param name="direction"></param>
            /// <param name="columnid"></param>
            public void Move(int direction, string columnid, string columnorder)
            {

                string sql = "";
                string message = "";
                switch (direction)
                {
                    case -1:
                        sql = string.Format("select top 2 Column_Name,Column_ID,Column_Order,(select count(*) from newssort a where a.parent_id=t.column_id) childsnNum from newssort t where Parent_ID='{0}'  and Column_Order<={1} order by Column_Order desc", columnid, columnorder);
                        message = "已經是該欄目的頂分類不能移動";
                        break;
                    case 1:
                        sql = string.Format("select top 2 Column_Name,Column_ID,Column_Order,(select count(*) from newssort a where a.parent_id=t.column_id) childsnNum from newssort t where Parent_ID='{0}'  and Column_Order>={1} order by Column_Order asc", columnid, columnorder);
                        message = "已經是該欄目的底分類不能移動";
                        break;
                    default:

                        break;

                }
                DataTable dt = this.Db.GetTable(sql);
                if (dt != null)
                {
                    if (dt.Rows.Count < 2)
                    {
                        this.ShowMessage(message, "history.go(-1)");
                    }
                    else
                    {

                        string selfid = Convert.ToString(dt.Rows[0]["Column_ID"] ?? "");
                        string selforder = Convert.ToString(dt.Rows[0]["Column_Order"] ?? "");
                        string otherid = Convert.ToString(dt.Rows[1]["Column_ID"] ?? "");
                        string otherorder = Convert.ToString(dt.Rows[1]["Column_Order"] ?? "");
                        ArrayList al = new ArrayList();
                        al.Add(string.Format("update [newssort] set [Column_Order]={0} where Column_ID='{1}'", otherorder, selfid));
                        al.Add(string.Format("update [newssort] set [Column_Order]={0} where Column_ID='{1}'", selforder, otherid));
                        if (this.Db.GetTranState(al))
                        {

                            Response.Redirect(Request.UrlReferrer.ToString().Length < 1 ? (Request.Url.ToString().IndexOf("?") >= 0 ? (Request.Url.ToString().IndexOf("mark=") >= 0 ? (System.Text.RegularExpressions.Regex.Replace(Request.Url.ToString(), "mark=[^&]*", "mark=0")) : (Request.Url.ToString() + "&mark=0")) : (Request.Url.ToString() + "?mark=0")) : (Request.UrlReferrer.ToString().IndexOf("?") >= 0 ? (Request.UrlReferrer.ToString().IndexOf("mark=") >= 0 ? (System.Text.RegularExpressions.Regex.Replace(Request.UrlReferrer.ToString(), "mark=[^&]*", "mark=0")) : (Request.UrlReferrer.ToString() + "&mark=0")) : (Request.UrlReferrer.ToString() + "?mark=0")));

                        }
                        else
                        {
                            this.ShowError("網絡連接錯誤請聯系系統管理員!!");
                        }

                    }
                }


            }
            /// <summary>
            /// /分類綁定
            /// </summary>
            public void BindSortList()
            {
                string parent_id = this.GetRequest("parentid");
                parent_id = parent_id.Length < 1 ? ("0") : (parent_id);
                string keys = Convert.ToString(ViewState["keys"]);
                string sql = string.Format("select Column_Name,Column_ID,Column_Order,Column_depth,parent_id,(select count(*) from newssort a where a.parent_id=t.column_id) childsnNum,bs_showindex from newssort t where Parent_ID='{0}'{1} order by Column_Order", parent_id, keys);
                this.gvList.DataSource = this.Db.GetTable(sql);
                this.gvList.DataBind();
            }
            /// <summary>
            /// 遞歸生成列表
            /// </summary>
            /// <param name="parentid"></param>
            public void BindSort(string parentid, string parentname)
            {
                DataTable dt = this.Db.GetTable(string.Format("select Column_Name,Column_ID from [newssort] where Parent_ID='{0}'", parentid));
                if (dt != null)
                {

                }
                else
                {

                }
            }

            protected void BtSearch_Click(object sender, EventArgs e)
            {
                string keys = this.TbKeyword.Text.Trim();
                keys = keys.Length < 1 ? ("") : (" and Column_name like '%" + keys + "%'");
                ViewState["keys"] = keys;
                this.BindSortList();
            }

            protected void BtVerfly_Click(object sender, EventArgs e)
            {

            }

            protected void BtDel_Click(object sender, EventArgs e)
            {
                //刪除沒有子類的欄目
                ArrayList al = this.GetSqls("delete from newssort  where Column_id='{0}' and not exists(select * from newssort where parent_id='{0}')");
                if (this.Db.GetTranState(al))
                {
                    this.ShowMessage("刪除成功?。?, "document.location=document.location.href");
                }
                else
                {
                    this.ShowError("沒有要刪除的數據或數據不存在??!請聯系系統管理員??!");
                }


            }

            protected void gvList_RowDataBound(object sender, GridViewRowEventArgs e)
            {
                if (e.Row.RowIndex != -1)
                {
                    DataRowView drv = e.Row.DataItem as DataRowView;
                    string column_id = Convert.ToString(drv["Column_ID"] ?? "");
                    string parent_id = Convert.ToString(drv["parent_id"] ?? "");
                    string column_order = Convert.ToString(drv["Column_Order"] ?? "");
                    string column_depth = Convert.ToString(drv["Column_depth"] ?? "");
                    string State = Convert.ToString(drv["bs_showindex"] ?? "").ToLower();
                    e.Row.Cells[0].Text = string.Format(this.CheckBoxString, column_id);
                    e.Row.Cells[5].Text = string.Format("<a href='" + Request.Path.ToString() + "?direction={0}&columnid={1}&columnorder={2}'>上移</a>", "-1", parent_id, column_order);
                    e.Row.Cells[6].Text = string.Format("<a href='" + Request.Path.ToString() + "?direction={0}&columnid={1}&columnorder={2}'>下移</a>", "1", parent_id, column_order);
                    // e.Row.Cells[7].Text = string.Format("<a href='EditSort.aspx?parentid={0}&depth={1}&action=add' target='_blank'>添加子類</a>&nbsp;<a href='EditSort.aspx?id={0}&action=update' target='_blank'>編輯該類</a>", Convert.ToString(drv["Column_ID"] ?? ""), column_depth);
                    e.Row.Cells[7].Text = string.Format("<a href='#' onclick=\"openWindow('TypeEdit.aspx?parentid={0}&depth={1}&action=add',800,300);return false;\">添加子類</a>&nbsp;<a href='#'  onclick=\"openWindow('EditSort.aspx?id={0}&action=upd',800,300);return false;\">編輯該類</a>", Convert.ToString(drv["Column_ID"] ?? ""), column_depth);
                    e.Row.Cells[8].Text = string.Format("<a href='"+Request.Path.ToString()+"?parentid={0}&depth={1}'>查看子類</a>&nbsp;{2}", Convert.ToString(drv["Column_ID"] ?? ""), column_depth, column_depth == "2" ? ("<a href='#' target='_blank' onclick='if(confirm(\"確認要操作么??\")){new Ajax().getData(document.location.href,\"IsAjax=true&Gid=" + column_id + "&State=" + State + "\",function(obj){if(obj.responseText==\"1\"){alert(\"操作成功?。");document.location=document.location.href;}else{alert(\"網絡鏈接異常?。≌埳院蛑卦嚕?!\")}})}return false;'>" + (State == "true" ? ("取消推薦") : ("<font color='red'>推薦</font>")) + "</a>") : (""));
                }

     

            }
        }
    }

    posted on 2009-06-03 15:10 sanmao 閱讀(170) 評論(0)  編輯  收藏

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     

    常用鏈接

    留言簿(5)

    隨筆分類

    隨筆檔案

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 日韩亚洲产在线观看| 91成年人免费视频| 亚洲国产精品无码第一区二区三区| 亚洲精品V欧洲精品V日韩精品| 黄网址在线永久免费观看| 69视频在线是免费观看| a级特黄毛片免费观看| 国内成人精品亚洲日本语音| 亚洲免费福利在线视频| 久久国产亚洲高清观看| 亚洲成在人线aⅴ免费毛片| 亚洲美女aⅴ久久久91| 亚洲国产精品婷婷久久| 亚洲国产精品无码专区| 中文字幕久久亚洲一区| 亚洲人成色77777在线观看大| 国产男女性潮高清免费网站| 成人毛片18女人毛片免费视频未 | 国产网站在线免费观看| 两个人的视频高清在线观看免费 | 2022年亚洲午夜一区二区福利| 在线播放亚洲第一字幕| 亚洲国产天堂久久综合| 伊人久久亚洲综合影院| 免费一级毛片在级播放| 亚洲av日韩av欧v在线天堂| 免费国产a国产片高清网站| 免费人成视频在线观看不卡| 四虎影视永久免费观看地址| 四虎国产精品免费久久影院| 一区国严二区亚洲三区| 亚洲国产小视频精品久久久三级 | 高潮毛片无遮挡高清免费视频| 国产亚洲综合一区二区三区| 国产成人不卡亚洲精品91| 337P日本欧洲亚洲大胆精品| 特级aa**毛片免费观看| 国产免费区在线观看十分钟| 鲁丝片一区二区三区免费| 91av视频免费在线观看| 中文字幕无码视频手机免费看|