Ejemplo n.º 1
0
    private void GetParam(HttpContext context)
    {
        HttpRequest requset = context.Request;
        var         ID      = int.Parse(requset["ID"]);
        var         X       = double.Parse(requset["X"]);
        var         Y       = double.Parse(requset["Y"]);

        View_Light view_Light = new View_Light();
        View_Light V          = new View_Light();

        V.ID          = ID;
        view_Light.ID = ID;
        view_Light.X  = X;
        view_Light.Y  = Y;
        View_Light hot = TableOperate <View_Light> .GetRowData(V);//查询是否存在

        if (hot.ID > 0)
        {
            int mes = TableOperate <View_Light> .Update(view_Light);

            if (mes > 0)
            {
                Response.Write("\"errcode\":\"0\",\"msg\":\"ok\"");
            }
            else
            {
                Response.Write("\"errcode\":\"1\",\"msg\":\"false\"");
            }
        }
    }
Ejemplo n.º 2
0
    private void editlight(int ID, string X, string Y)
    {
        try
        {
            View_Light view_Light = new View_Light();
            view_Light.ID = ID;
            View_Light hot = TableOperate <View_Light> .GetRowData(view_Light);//查询是否存在

            if (hot.ID > 0)
            {
                if (Request.Params["X"] == null)
                {
                    X = null;
                }
                else
                {
                    X            = HttpUtility.UrlDecode(Request.Params["X"]);
                    view_Light.X = double.Parse(X);
                }
                if (Request.Params["Y"] == null)
                {
                    Y = null;
                }
                else
                {
                    Y = HttpUtility.UrlDecode(Request.Params["Y"]);

                    view_Light.Y = double.Parse(Y);
                }
                int mes = TableOperate <View_Light> .Update(view_Light);

                if (mes > 0)
                {
                    Response.Write("\"errcode\":\"0\",\"msg\":\"ok\"");
                }
                else
                {
                    Response.Write("\"errcode\":\"1\",\"msg\":\"false\"");
                }
            }
            else
            {
                Response.Write("\"errcode\":\"1\",\"msg\":\"无效参数\"");
            }
        }
        catch (Exception)
        {
            throw;
        }
        Response.End();
    }
Ejemplo n.º 3
0
    private void getlight(int AreaID)
    {
        View_Light value     = new View_Light();
        View_Light condition = new View_Light();

        if (!string.IsNullOrEmpty(this.Request["AreaID"]))
        {
            AreaID       = Convert.ToInt32(Request["AreaID"]);
            condition.ID = AreaID;
        }
        List <View_Light> list = TableOperate <View_Light> .SelectByIdDesc(value, condition);

        string json = "{\"list\":[";

        for (int i = 0; i < list.Count; i++)
        {
            json += "{\"ID\":" + list[i].ID + ",  \"X\":\"" + list[i].X + "\", \"Y\":\"" + list[i].Y + "\", \"AreaID\":" + list[i].AreaID + "},";
        }
        json  = json.Trim(',');
        json += "]}";
        Response.Write(json);
    }
Ejemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string     title     = GetstringKey("name");
        View_Light condition = new View_Light();
        View_Light value     = new View_Light();

        AreaID = GetIntKey("AreaID");
        if (AreaID != 0)
        {
            condition.AreaID = AreaID;
        }

        if (title != "")
        {
            condition.Title = "%" + title + "%";
            condition.AddAttach("Title", "like");
        }
        condition.ExhibitionID = AdminMethod.ExhibitionID;

        m_tableManageList = TableOperate <View_Light> .SelectByPage(value, condition, "order by  OrderID asc", PageSize, PageIndex, ref Count);

        DataBind();
        name.Value = title;
    }
Ejemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string     action    = GetstringKey("action");
        int        ID        = GetIntKey("ID");
        int        areaid    = GetIntKey("areaid");
        View_Light condition = new View_Light();
        View_Light v         = new View_Light();

        if (ID == 0)
        {
            Response.Write("");
            return;
        }
        condition.ID = ID;
        View_Light myView = TableOperate <View_Light> .GetRowData(v, condition);

        if (myView.ID == 0)
        {
            Response.Write("");
            return;
        }
        View_Light condition2 = new View_Light();
        View_Light V2         = new View_Light();

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

        condition2.OrderID = myView.OrderID;
        if (areaid != 0)
        {
            condition2.AreaID = areaid;
        }
        condition2.ExhibitionID = AdminMethod.ExhibitionID;
        if (action == "up")
        {
            //向上,现在是时间越早越在上面
            condition2.AddAttach("OrderID", "<");
            strOrder = " order by OrderID  DESC"; //时间从大到小
        }
        else
        {
            condition2.AddAttach("OrderID", ">");
            strOrder = " order by OrderID ASC";
        }
        List <View_Light> desOrderMdl = TableOperate <View_Light> .Select(V2, condition2, 1, strOrder);

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

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

        Light conditionU2 = new Light();

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

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