Esempio n. 1
0
    protected void AddLog(string ids)
    {
        AgeType condition = new AgeType();
        AgeType value     = new AgeType();

        condition.AddConditon(" and id in(" + ids + ")");
        List <AgeType> list = TableOperate <AgeType> .Select(value, condition);

        if (list.Count > 0)
        {
            string deltitle = "";
            for (int i = 0; i < list.Count; i++)
            {
                deltitle += list[i].AgeName + ",";
            }
            deltitle = deltitle.TrimEnd(',');
            if (deltitle != "")
            {
                string logbrief = "管理员:【" + AdminMethod.AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "删除了【" + deltitle + "】的年龄段";
                Lognet.AddLogin(logbrief);
            }
        }
    }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string action = GetstringKey("action");



        int ID = GetIntKey("ID");

        AgeType condition = new AgeType();
        AgeType v         = new AgeType();

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

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

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

        AgeType condition2 = new AgeType();
        AgeType V2         = new AgeType();

        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 <AgeType> desOrderMdl = TableOperate <AgeType> .Select(V2, condition2, 1, strOrder);

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


        AgeType conditionU = new AgeType();

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

        AgeType conditionU2 = new AgeType();

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

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