Ejemplo n.º 1
0
    protected string GetNews(int ChannelID)
    {
        string      jsonstr   = "[";
        ChannelNews value     = new ChannelNews();
        ChannelNews condition = new ChannelNews();

        condition.ChannelID = ChannelID;
        List <ChannelNews> list = TableOperate <ChannelNews> .Select(value, condition, 0, "order by OrderID asc");

        for (int i = 0; i < list.Count; i++)
        {
            jsonstr += "{\"ID\":" + list[i].ID + ", \"TypeID\":\"" + list[i].TypeID + "\", \"Title\":\"" + list[i].Title + "\", \"Brief\":\"" + Null(list[i].Brief) + "\", \"Files\":\"" + GetFiles(list[i].Files) + "\", \"AddTime\":\"" + list[i].AddTime + "\"},";
        }
        jsonstr  = jsonstr.Trim(',');
        jsonstr += "]";
        return(jsonstr);
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        m_ExhibitionList = ModeChannelProvider.SelectAll();
        ChannelNews condition = new ChannelNews();
        ChannelNews value     = new ChannelNews();
        string      title     = GetstringKey("name");

        PCID = GetIntKey("pcid");
        if (title != "")
        {
            condition.Title = "%" + title + "%";
            condition.AddAttach("Title", "like");
        }
        if (PCID != 0)
        {
            condition.ChannelID = PCID;
        }
        condition.ExhibitionID = AdminMethod.ExhibitionID;
        m_tableManageList      = TableOperate <ChannelNews> .SelectByPage(value, condition, "order by  OrderID asc", PageSize, PageIndex, ref Count);

        DataBind();
        name.Value = title;
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string action = GetstringKey("action");
        string ID     = Request["ID"];

        ChannelNews condition = new ChannelNews();
        ChannelNews v         = new ChannelNews();

        if (string.IsNullOrEmpty(ID))
        {
            Response.Write("");
            return;
        }

        condition.ID = Convert.ToInt32(ID);
        ChannelNews myView = TableOperate <ChannelNews> .GetRowData(v, condition);

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

        ChannelNews condition2 = new ChannelNews();
        ChannelNews V2         = new ChannelNews();

        condition2.AddConditon(" and ID<>'" + condition.ID + "'");
        condition2.ChannelID = myView.ChannelID;

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

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


        ChannelNews conditionU = new ChannelNews();

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

        ChannelNews conditionU2 = new ChannelNews();

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

        Response.StatusCode = 200;
        Response.Write(conditionU2.ID);
    }
Ejemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        m_ExhibitionList = ChannelProvider.SelectAll();
        string action = GetstringKey("action");

        PCID = GetIntKey("pcid");
        if (action != "save")
        {
            if (!string.IsNullOrEmpty(this.Request["iD"]))
            {
                int         _iD       = Convert.ToInt32(this.Request["iD"]);
                ChannelNews condition = new ChannelNews();
                condition.ID = _iD;
                news         = TableOperate <ChannelNews> .GetRowData(condition);

                iD.Value = Convert.ToString(news.ID);
            }
            DataBind();
        }
        else
        {
            Result      result         = new Result();
            string      logbrief       = "";
            ChannelNews newChannelNews = new ChannelNews();
            newChannelNews.ID = 0;
            newChannelNews.AutoForm(this.Page);

            string Title = newChannelNews.Title;
            int    _iD;
            if (!string.IsNullOrEmpty(this.Request["iD"]))
            {
                _iD = Convert.ToInt32(this.Request["iD"]);
                TableOperate <ChannelNews> .Update(newChannelNews);

                result.msg = "编辑成功,等待返回列表";
                //logbrief = "管理员:【" + AdminMethod.AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "编辑了资源【" + Title + "】";
            }
            else
            {
                newChannelNews.AddTime      = DateTime.Now;
                newChannelNews.AddID        = AdminMethod.AdminID;
                newChannelNews.ExhibitionID = AdminMethod.ExhibitionID;
                newChannelNews.OrderID      = CloudSQL.GetNowTime();
                _iD = TableOperate <ChannelNews> .InsertReturnID(newChannelNews);

                result.msg = "添加成功,等待返回列表";
                //logbrief = "管理员:【" + AdminMethod.AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "添加了资源【" + Title + "】";
            }

            if (_iD > 0)
            {
                result.isOk = true;
                Lognet.AddLogin(logbrief);
            }
            else
            {
                result.msg = "操作失败";
            }
            Response.ContentType = "text/json";
            Response.Write(new JavaScriptSerializer().Serialize(result));
            Response.End();
        }
        DataBind();
    }