コード例 #1
0
ファイル: cporder.aspx.cs プロジェクト: yysong822/citydata
    protected void bPOrder_Click(object sender, EventArgs e)
    {
        int lengthProgram = lboxProgram.Items.Count;
        int sucCount      = 0;

        if (lengthProgram > 0)
        {
            for (int i = 0; i < lengthProgram; i++)
            {
                Model.ChannelProgram mpoSingle = new Model.ChannelProgram();
                mpoSingle.CP_ID    = Convert.ToInt32(lboxProgram.Items[i].Value);
                mpoSingle.CP_Order = i;
                if (sdbll.setCPnewOrder(mpoSingle) == 0)
                {
                    sucCount++;
                }
                else
                {
                    Response.Write("<script>alert('设置栏目顺序失败!');</script>");
                }
            }
            if (sucCount == lengthProgram)
            {
                Response.Write("<script>alert('设置栏目顺序成功!');</script>");
            }
        }
    }
コード例 #2
0
 protected void bDelete_Click(object sender, EventArgs e)
 {
     Model.ChannelProgram mChannel = new Model.ChannelProgram();
     mChannel.CP_ID = Convert.ToInt32(trChannel.SelectedNode.Value.Trim());
     Model.ChannelProgram[] mProgram;
     try
     {
         mProgram = dbll.getCP(trChannel.SelectedNode.Value.Trim());
     }
     catch
     {
         mProgram = null;
     }
     if (mProgram != null && mProgram.Length == 0)
     {
         if (sdbll.setCP(mChannel, "delete") == 0)
         {
             flushPage();
             Response.Write("<script>alert('删除频道成功!');</script>");
         }
         else
         {
             Response.Write("<script>alert('删除频道失败!');</script>");
         }
     }
     else
     {
         flushPage();
         Response.Write("<script>alert('不允许删除有栏目的频道!');</script>");
     }
 }
コード例 #3
0
 protected void bMove_Click(object sender, EventArgs e)
 {
     if (trProgram.SelectedNode != null)
     {
         Model.ChannelProgram mChannel = new Model.ChannelProgram();
         mChannel.CP_Name = trProgram.SelectedNode.Text.Trim();
         mChannel.CP_ID   = Convert.ToInt32(trProgram.SelectedNode.Value.Trim());
         if (ddlProgramList.SelectedValue.Trim() != "选择频道")
         {
             mChannel.FatherID = Convert.ToInt32(ddlProgramList.SelectedValue.Trim());
         }
         else
         {
             Response.Write("<script>alert('请选择频道!');</script>");
         }
         if (sdbll.setCPnewFather(mChannel) == 0)
         {
             flushPage();
             Response.Write("<script>alert('转移栏目成功!');</script>");
         }
         else
         {
             Response.Write("<script>alert('转移栏目失败!');</script>");
         }
     }
 }
コード例 #4
0
ファイル: test.aspx.cs プロジェクト: yysong822/citydata
    public void testGetZBcpid()
    {
        Model.ChannelProgram mcp = new Model.ChannelProgram();
        mcp.DataTypeID = 1;

        BLL.DataBLL dbll = new BLL.DataBLL();
        //int done = sbll.setStationsInfo(msr, "insert");
        Label1.Text = dbll.getZBcpid(mcp).CP_ID.ToString();
    }
コード例 #5
0
ファイル: test.aspx.cs プロジェクト: yysong822/citydata
    public void testSetAllSetting()
    {
        //Model.ChannelProgram mcp, Model.ElementRelation[] mer,Model.StationRelation[] msr
        Model.ChannelProgram mcp = new Model.ChannelProgram();
        mcp.CP_ID      = 170;
        mcp.DataTypeID = 1;
        mcp.TimeTypeID = 8;


        Model.ElementRelation[] mer = new Model.ElementRelation[3];

        Model.ElementRelation mer_single1 = new Model.ElementRelation();
        mer_single1.ElementID    = 1;
        mer_single1.ElementOrder = 0;

        Model.ElementRelation mer_single2 = new Model.ElementRelation();
        mer_single2.ElementID    = 3;
        mer_single2.ElementOrder = 1;

        Model.ElementRelation mer_single3 = new Model.ElementRelation();
        mer_single3.ElementID    = 7;
        mer_single3.ElementOrder = 2;

        mer[0] = mer_single1;
        mer[1] = mer_single2;
        mer[2] = mer_single3;


        Model.StationRelation[] msr = new Model.StationRelation[3];

        Model.StationRelation msr_single1 = new Model.StationRelation();
        msr_single1.SelectID     = 172;
        msr_single1.StationID    = 50774;
        msr_single1.StationOrder = 0;

        Model.StationRelation msr_single2 = new Model.StationRelation();
        msr_single2.SelectID     = 30;
        msr_single2.StationID    = 56778;
        msr_single2.StationOrder = 1;

        Model.StationRelation msr_single3 = new Model.StationRelation();
        msr_single3.SelectID     = 512;
        msr_single3.StationID    = 59432;
        msr_single3.StationOrder = 2;

        msr[0] = msr_single1;
        msr[1] = msr_single2;
        msr[2] = msr_single3;



        BLL.SettingBLL sbll    = new BLL.SettingBLL();
        String[]       display = new String[5];
        display     = sbll.setAllSetting(mcp, mer, msr);
        Label1.Text = display[0] + "/" + display[1] + "/" + display[2] + "/" + display[3] + "/" + display[4];
    }
コード例 #6
0
ファイル: test.aspx.cs プロジェクト: yysong822/citydata
    public void testdeleteSetCP()
    {
        Model.ChannelProgram mcp = new Model.ChannelProgram();
        mcp.CP_ID = 171;

        BLL.SettingBLL sbll = new BLL.SettingBLL();
        int            done = sbll.setCP(mcp, "delete");

        Label1.Text = done.ToString();
    }
コード例 #7
0
ファイル: setting.aspx.cs プロジェクト: yysong822/citydata
    protected void bSet_Click(object sender, EventArgs e)
    {
        int elementCount = lboxDisplaySelected.Items.Count;
        int stationCount = lboxStationReal.Items.Count;

        if (trProgram.SelectedNode.Parent != null && elementCount != 0 && stationCount != 0 && ddlTimeType.SelectedValue != "选择数据时段" && ddlDataType.SelectedValue != "选择数据类型")
        {
            string[]             cpInfo = trProgram.SelectedNode.Value.Split('#');
            Model.ChannelProgram mcp    = new Model.ChannelProgram();
            mcp.CP_ID      = Convert.ToInt32(cpInfo[0]);
            mcp.DataTypeID = Convert.ToInt32(ddlDataType.SelectedValue);
            mcp.TimeTypeID = Convert.ToInt32(ddlTimeType.SelectedValue);
            trProgram.SelectedNode.Value = cpInfo[0] + "#" + ddlTimeType.SelectedValue + "#" + ddlDataType.SelectedValue;
            Model.ElementRelation[] mer = new Model.ElementRelation[elementCount];
            Model.StationRelation[] msr = new Model.StationRelation[stationCount];
            for (int i = 0; i < elementCount; i++)
            {
                Model.ElementRelation merSingle = new Model.ElementRelation();
                merSingle.ElementID    = Convert.ToInt32(lboxDisplaySelected.Items[i].Value);
                merSingle.ElementOrder = i;
                mer[i] = merSingle;
            }
            for (int i = 0; i < stationCount; i++)
            {
                Model.StationRelation msrSingle = new Model.StationRelation();
                string[] stationInfo            = lboxStationReal.Items[i].Value.Split('#');
                msrSingle.StationID    = Convert.ToInt32(stationInfo[0]);
                msrSingle.SelectID     = Convert.ToInt32(stationInfo[1]);
                msrSingle.StationOrder = i;
                msr[i] = msrSingle;
            }
            string[] setStationResult = sdbll.setAllSetting(mcp, mer, msr);
            int      resultCount      = setStationResult.Length;
            int      doneCount        = 0;
            for (int i = 0; i < resultCount; i++)
            {
                if (setStationResult[i] == "done")
                {
                    doneCount++;
                }
            }
            if (doneCount == resultCount)
            {
                Response.Write("<script>alert('设置栏目成功!');</script>");
            }
            else
            {
                Response.Write("<script>alert('设置栏目失败!');</script>");
            }
        }
        else
        {
            Response.Write("<script>alert('请检查信息是否填充完整!');</script>");
        }
    }
コード例 #8
0
ファイル: test.aspx.cs プロジェクト: yysong822/citydata
    public void testSetCPfid()
    {
        Model.ChannelProgram mcp = new Model.ChannelProgram();
        mcp.FatherID = 172;
        mcp.CP_ID    = 170;

        BLL.SettingBLL sbll = new BLL.SettingBLL();
        int            done = sbll.setCPnewFather(mcp);

        Label1.Text = done.ToString();
    }
コード例 #9
0
ファイル: test.aspx.cs プロジェクト: yysong822/citydata
    public void testupdateSetCP()
    {
        Model.ChannelProgram mcp = new Model.ChannelProgram();
        mcp.CP_Name = "测试0频道";
        mcp.CP_ID   = 170;

        BLL.SettingBLL sbll = new BLL.SettingBLL();
        int            done = sbll.setCP(mcp, "update");

        Label1.Text = done.ToString();
    }
コード例 #10
0
ファイル: test.aspx.cs プロジェクト: yysong822/citydata
    public void testinsertSetCP()
    {
        Model.ChannelProgram mcp = new Model.ChannelProgram();
        mcp.CP_Name  = "测试栏目3";
        mcp.FatherID = 170;

        BLL.SettingBLL sbll = new BLL.SettingBLL();
        int            done = sbll.setCP(mcp, "insert");

        Label1.Text = done.ToString();
    }
コード例 #11
0
 protected void bDelete_Click(object sender, EventArgs e)
 {
     Model.ChannelProgram mChannel = new Model.ChannelProgram();
     mChannel.CP_ID = Convert.ToInt32(trProgram.SelectedNode.Value.Trim());
     if (sdbll.setCP(mChannel, "delete") == 0)
     {
         flushPage();
         Response.Write("<script>alert('删除栏目成功!');</script>");
     }
     else
     {
         Response.Write("<script>alert('删除栏目失败!');</script>");
     }
 }
コード例 #12
0
ファイル: test.aspx.cs プロジェクト: yysong822/citydata
    public void testGetZBstations()
    {
        Model.ChannelProgram mcp = new Model.ChannelProgram();
        mcp.DataTypeID = 1;
        mcp.TimeTypeID = 6;



        BLL.DataBLL             dbll = new BLL.DataBLL();
        Model.StationRelation[] msr2 = dbll.getZBStations(mcp);
        for (int i = 0; i < msr2.Length; i++)
        {
            al.Add(msr2[i]);
        }
        Label1.Text = msr2.Length.ToString();
    }
コード例 #13
0
    protected void bAddChannel_Click(object sender, EventArgs e)
    {
        if (tbAddChannel.Text.Trim() != "")
        {
            Model.ChannelProgram mChannel = new Model.ChannelProgram();
            mChannel.CP_Name = tbAddChannel.Text.Trim();
            if (sdbll.setCP(mChannel, "insert") == 0)
            {
                flushPage();

                Response.Write("<script>alert('增加频道成功!');</script>");
            }
            else
            {
                Response.Write("<script>alert('增加频道失败!');</script>");
            }
        }
        else
        {
            Response.Write("<script>alert('不允许为空!');</script>");
        }
    }
コード例 #14
0
 protected void bModifyName_Click(object sender, EventArgs e)
 {
     if (tbExistChannel.Text.Trim() != "")
     {
         Model.ChannelProgram mChannel = new Model.ChannelProgram();
         mChannel.CP_ID   = Convert.ToInt32(trChannel.SelectedNode.Value.Trim());
         mChannel.CP_Name = tbExistChannel.Text.Trim();
         if (sdbll.setCP(mChannel, "update") == 0)
         {
             flushPage();
             Response.Write("<script>alert('修改频道成功!');</script>");
         }
         else
         {
             Response.Write("<script>alert('修改频道失败!');</script>");
         }
     }
     else
     {
         Response.Write("<script>alert('不允许为空!');</script>");
     }
 }
コード例 #15
0
    protected void bAddProgram_Click(object sender, EventArgs e)
    {
        if (trProgram.SelectedNode != null && tbAddProgram.Text.Trim() != "")
        {
            Model.ChannelProgram mChannel = new Model.ChannelProgram();
            mChannel.CP_Name = tbAddProgram.Text.Trim();
            if (trProgram.SelectedNode.Parent != null)    /*二级节点*/
            {
                mChannel.FatherID = Convert.ToInt32(trProgram.SelectedNode.Parent.Value.Trim());
            }
            else
            {
                mChannel.FatherID = Convert.ToInt32(trProgram.SelectedNode.Value.Trim());
            }

            if (sdbll.setCP(mChannel, "insert") == 0)
            {
                flushPage();
                Response.Write("<script>alert('增加栏目成功!');</script>");
            }
            else
            {
                Response.Write("<script>alert('增加栏目失败!');</script>");
            }
        }
        else
        {
            if (trProgram.SelectedNode == null)
            {
                Response.Write("<script>alert('请正确选择频道或者栏目!');</script>");
            }
            else
            {
                Response.Write("<script>alert('不允许为空!');</script>");
            }
        }
    }
コード例 #16
0
ファイル: zb.aspx.cs プロジェクト: yysong822/citydata
    protected void fillGV(GridView gvShow, Model.RecordeData par_mrd, string timeSXID)
    {
        gvShow.DataSource = null;
        if (timeSXID == "选择时效")
        {
            try
            {
                mRecordeData = dbll.getZBData(par_mrd);
            }
            catch
            {
                mRecordeData = null;
            }
        }
        else
        {
            try
            {
                mRecordeData = dbll.getZBDataBySX(par_mrd);
            }
            catch
            {
                mRecordeData = null;
            }
        }
        if (mRecordeData != null && mRecordeData.Length != 0)
        {
            try//20090813byHan
            {
                showTip(mRecordeData[0]);
                if (lb_titleTime.Text == "昨天之前数据,不可查看!")
                {
                    gvShow.DataSource = null;
                }
                else
                {
                    gvShow.DataSource = mRecordeData;
                    Model.ChannelProgram mcp = new Model.ChannelProgram();
                    mcp.DataTypeID = par_mrd.DataType;
                    mcp.TimeTypeID = par_mrd.TimeType;
                    string cpid = dbll.getZBcpid(mcp).CP_ID.ToString();

                    if (mStationRelation == null)
                    {
                        mStationRelation = dbll.getZBStations(mcp);
                    }

                    if (mElementRelation == null)
                    {
                        mElementRelation = dbll.getElementsName(cpid);
                    }

                    if (alTransCode.Count == 0)
                    {
                        alTransCode = transCodeArrayList(cpid);
                    }

                    string rt = mRecordeData[0].ReportTime + "";


                    noExistStation();

                    mRecordeData_Pre = dbll.getZBDataPre(par_mrd, rt);

                    cmpCurTemPre();
                }
            }
            catch { }
        }

        else
        {
            if (mRecordeData == null)
            {
                p_noExistStation.Visible    = true;
                lb_noExistStation.Text      = "该栏目还没有进行配置!";
                lb_noExistStation.ForeColor = System.Drawing.Color.Red;
            }
            else
            {
                p_noExistStation.Visible    = true;
                lb_noExistStation.Text      = "本次查询无数据显示!";
                lb_noExistStation.ForeColor = System.Drawing.Color.Red;
            }
        }
        gvShow.DataBind();
    }