Пример #1
0
    //修改广告频道
    public void EditAD_Position_Channel()
    {
        int    AD_Position_Channel_ID   = tools.CheckInt(Request.Form["AD_Position_Channel_ID"]);
        string AD_Position_Channel_Name = tools.CheckStr(Request.Form["AD_Position_Channel_Name"]);
        string AD_Position_Channel_Note = tools.CheckStr(Request.Form["AD_Position_Channel_Note"]);
        string AD_Position_Channel_Site = Public.GetCurrentSite();

        if (AD_Position_Channel_Name == "")
        {
            Public.Msg("error", "错误信息", "请填写频道名称", false, "{back}");
        }

        ADPositionChannelInfo entity = new ADPositionChannelInfo();

        entity.AD_Position_Channel_ID   = AD_Position_Channel_ID;
        entity.AD_Position_Channel_Name = AD_Position_Channel_Name;
        entity.AD_Position_Channel_Note = AD_Position_Channel_Note;
        entity.AD_Position_Channel_Site = AD_Position_Channel_Site;


        if (Mychannel.EditAD_Position_Channel(entity, Public.GetUserPrivilege()))
        {
            Public.Msg("positive", "操作成功", "操作成功", true, "AD_Position_Channel.aspx");
        }
        else
        {
            Public.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}");
        }
    }
Пример #2
0
    //获取广告位置
    public string GetAdPositions()
    {
        QueryInfo Query = new QueryInfo();

        Query.PageSize    = tools.CheckInt(Request["rows"]);
        Query.CurrentPage = tools.CheckInt(Request["page"]);
        string keyword    = tools.CheckStr(Request["keyword"]);
        int    Ad_Channel = tools.CheckInt(Request["Ad_Channel"]);

        Query.ParamInfos.Add(new ParamInfo("AND", "str", "ADPositionInfo.Ad_Position_Site", "=", Public.GetCurrentSite()));
        if (Ad_Channel > 0)
        {
            Query.ParamInfos.Add(new ParamInfo("AND", "int", "ADPositionInfo.Ad_Position_ChannelID", "=", Ad_Channel.ToString()));
        }
        if (keyword.Length > 0)
        {
            Query.ParamInfos.Add(new ParamInfo("AND(", "str", "ADPositionInfo.Ad_Position_Name", "like", keyword));
            Query.ParamInfos.Add(new ParamInfo("OR)", "str", "ADPositionInfo.Ad_Position_Value", "like", keyword));
        }

        string Marketing = tools.CheckStr(Request["Marketing"]);

        if (Marketing == "1" || Marketing == "0")
        {
            Query.ParamInfos.Add(new ParamInfo("AND", "str", "ADPositionInfo.U_Ad_Position_Marketing", "=", Marketing));
        }

        Query.OrderInfos.Add(new OrderInfo(tools.CheckStr(Request["sidx"]), tools.CheckStr(Request["sord"])));
        PageInfo pageinfo = Myposition.GetPageInfo(Query, Public.GetUserPrivilege());
        IList <ADPositionInfo> Positions = Myposition.GetADPositions(Query, Public.GetUserPrivilege());

        if (Positions != null)
        {
            StringBuilder jsonBuilder = new StringBuilder();
            jsonBuilder.Append("{\"page\":" + pageinfo.CurrentPage + ",\"total\":" + pageinfo.PageCount + ",\"records\":" + pageinfo.RecordCount + ",\"rows\"");
            jsonBuilder.Append(":[");
            foreach (ADPositionInfo entity in Positions)
            {
                jsonBuilder.Append("{\"ADPositionInfo.AD_Position_ID\":" + entity.Ad_Position_ID + ",\"cell\":[");
                //各字段

                jsonBuilder.Append("\"");
                jsonBuilder.Append(entity.Ad_Position_ID);
                jsonBuilder.Append("\",");


                jsonBuilder.Append("\"");
                jsonBuilder.Append(Public.JsonStr(entity.Ad_Position_Name));
                jsonBuilder.Append("\",");

                jsonBuilder.Append("\"");
                jsonBuilder.Append(Public.JsonStr(entity.Ad_Position_Value));
                jsonBuilder.Append("\",");

                jsonBuilder.Append("\"");
                ADPositionChannelInfo channel = Mychannel.GetAD_Position_ChannelByID(entity.Ad_Position_ChannelID, Public.GetUserPrivilege());
                if (channel != null)
                {
                    jsonBuilder.Append(channel.AD_Position_Channel_Name);
                }
                else
                {
                    jsonBuilder.Append("&nbsp;");
                }
                jsonBuilder.Append("\",");

                jsonBuilder.Append("\"");
                jsonBuilder.Append(entity.Ad_Position_Width);
                jsonBuilder.Append("\",");

                jsonBuilder.Append("\"");
                jsonBuilder.Append(entity.Ad_Position_Height);
                jsonBuilder.Append("\",");

                //jsonBuilder.Append("\"");
                //jsonBuilder.Append(Public.DisplayCurrency(entity.U_Ad_Position_Price));
                //jsonBuilder.Append("\",");

                jsonBuilder.Append("\"");

                if (Public.CheckPrivilege("afbc3245-62b5-4eb3-aefb-c6c8f3e2b02d"))
                {
                    jsonBuilder.Append("<img src=\\\"/images/icon_edit.gif\\\"> <a href=\\\"ad_position_edit.aspx?position_id=" + entity.Ad_Position_ID + "\\\" title=\\\"修改\\\">修改</a>");
                }
                if (Public.CheckPrivilege("67c30881-650c-4f84-aa81-08e2e379798c"))
                {
                    jsonBuilder.Append(" <img src=\\\"/images/icon_del.gif\\\"> <a href=\\\"javascript:void(0);\\\" onclick=\\\"confirmdelete('ad_position_do.aspx?action=move&position_id=" + entity.Ad_Position_ID + "')\\\" title=\\\"删除\\\">删除</a>");
                }

                jsonBuilder.Append("\",");

                jsonBuilder.Remove(jsonBuilder.Length - 1, 1);
                jsonBuilder.Append("]},");
            }
            jsonBuilder.Remove(jsonBuilder.Length - 1, 1);
            jsonBuilder.Append("]");
            jsonBuilder.Append("}");
            return(jsonBuilder.ToString());
        }
        else
        {
            return(null);
        }
    }