Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Area   condition = new Area();
        Area   value     = new Area();
        string title     = GetstringKey("name");

        if (title != "")
        {
            condition.AreaName = "%" + title + "%";
            condition.AddAttach("AreaName", "like");
        }
        condition.ExhibitionID = AdminMethod.ExhibitionID;
        m_tableManageList      = TableOperate <Area> .SelectByPage(value, condition, "order by  OrderID asc", PageSize, PageIndex, ref Count);

        DataBind();
        name.Value = title;
    }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string action = GetstringKey("action");



        int ID = GetIntKey("ID");

        Area condition = new Area();
        Area v         = new Area();

        if (ID == 0)
        {
            Response.Write("");
            return;
        }

        condition.ID = ID;
        Area myView = TableOperate <Area> .GetRowData(v, condition);

        if (myView.ID == 0)
        {
            Response.Write("");
            return;
        }

        Area condition2 = new Area();
        Area V2         = new Area();

        condition2.AddConditon(" and ID<>'" + condition.ID + "'");
        condition2.ExhibitionID = AdminMethod.ExhibitionID;
        string strOrder = string.Empty;

        condition2.OrderID = myView.OrderID;
        if (action == "up")
        {
            //向上,现在是时间越早越在上面
            condition2.AddAttach("OrderID", "<");
            strOrder = " order by OrderID  DESC"; //时间从大到小
        }
        else
        {
            condition2.AddAttach("OrderID", ">");
            strOrder = " order by OrderID ASC";
        }


        List <Area> desOrderMdl = TableOperate <Area> .Select(V2, condition2, 1, strOrder);

        if (desOrderMdl.Count != 1)
        {
            Response.Write("");
            return;
        }


        Area conditionU = new Area();

        conditionU.ID      = myView.ID;
        conditionU.OrderID = desOrderMdl[0].OrderID;
        TableOperate <Area> .Update(conditionU);

        Area conditionU2 = new Area();

        conditionU2.ID      = desOrderMdl[0].ID;
        conditionU2.OrderID = myView.OrderID;
        TableOperate <Area> .Update(conditionU2);

        Response.StatusCode = 200;
        Response.Write(conditionU2.ID);
    }