Esempio n. 1
0
    //1:安置;2:推荐
    public static string Direct_Table_New(string bh, int qs, int isAnTj)
    {
        if (isAnTj == 1)
        {
            strAzTj = "az";
        }
        else
        {
            strAzTj = "tj";
        }

        SqlParameter[] spa = new SqlParameter[] {
            new SqlParameter("@number", bh),
            new SqlParameter("@ExpectNum", qs),
            new SqlParameter("@type", isAnTj)
        };

        DataTable dtNew = DAL.DBHelper.ExecuteDataTable("ShowNet", spa, CommandType.StoredProcedure);

        string toWidth = (JieGouNew.GetFinalWidth(dtNew)).ToString();

        return("<table align='center' width='" + toWidth + "' style='margin-left:20px;'><tr><td align='left'>" + JieGouNew.GetAll(dtNew, bh) + "<td/><tr></table>");
    }
Esempio n. 2
0
    public static string GetThree(DataTable dt)
    {
        StringBuilder sb2 = new StringBuilder();

        DataRow[] row3;

        row3 = dt.Select("cengshu=3", "Xuhao");//第三层

        DataRow[] row2;

        row2 = dt.Select("cengshu=2", "Xuhao"); //第二层

        DataRow[] rowTeam;                      //第三层团队

        int firstWidth = 0;

        int endWidth = 0;

        int w2 = 0;

        int firstPLeft = 0;

        int toWidth = JieGouNew.GetFinalWidth(dt);

        int midWidth = 0;

        int leftWidth = 0;

        int rightWidth = 0;

        int toWidth2 = 0;

        if (row2.Length > 0)
        {
            toWidth2 = Convert.ToInt32(row2[row2.Length - 1]["LeftDistance"].ToString()) + Convert.ToInt32(row2[row2.Length - 1]["Lenth"].ToString());
        }

        //画横线

        if (toWidth2 > toWidth)
        {
            sb2.Append("<table width='" + toWidth2 + "' cellspacing='0' cellpadding='0'><tr>");
        }
        else
        {
            sb2.Append("<table width='" + toWidth + "' cellspacing='0' cellpadding='0'><tr>");
        }

        for (int i = 0; i < row2.Length; i++)
        {
            rowTeam = dt.Select("shangji='" + row2[i]["number"] + "'", "Xuhao");

            w2 = 0;

            for (int k = 0; k < rowTeam.Length; k++)
            {
                firstPLeft = Convert.ToInt32(rowTeam[k]["Said"].ToString());

                if (firstPLeft == 0)
                {
                    firstPLeft = jianJu;
                }

                w2 += firstPLeft + Convert.ToInt32(rowTeam[k]["Lenth"].ToString());


                if (k == 0)
                {
                    firstWidth = Convert.ToInt32(rowTeam[k]["Lenth"].ToString());
                }

                if (k == rowTeam.Length - 1)
                {
                    endWidth = Convert.ToInt32(rowTeam[k]["Lenth"].ToString());
                }
            }

            leftWidth = firstPLeft + firstWidth / 2;

            rightWidth = endWidth / 2;

            midWidth = w2 - leftWidth - rightWidth;

            if (rowTeam.Length > 1)
            {
                sb2.Append("<td  width='" + w2 + "'><table width='100%' cellspacing='0' cellpadding='0' border='0' ><tbody><tr><td width='" + leftWidth + "' height=\"2\"></td><td width='" + midWidth + "' background=\"images/images03_05.gif\"  > </td><td width='" + rightWidth + "'></td></tr></tbody></table></td>");
            }
            else
            {
                leftWidth = w2 / 3;

                midWidth = w2 / 3;

                rightWidth = w2 - leftWidth - midWidth;

                sb2.Append("<td  width='" + w2 + "'><table width='100%' cellspacing='0' cellpadding='0' border='0' ><tbody><tr><td width='" + w2 + "' height=\"2\"></td><td width='" + midWidth + "' > </td><td width='" + rightWidth + "'></td></tr></tbody></table></td>");
            }
        }


        sb2.Append("</tr></table>");

        //画竖线和第三层总余新
        sb2.Append("<table width='100%'cellspacing='0' cellpadding='0'><tr>");

        for (int i = 0; i < row2.Length; i++)
        {
            rowTeam = dt.Select("shangji='" + row2[i]["number"] + "'", "Xuhao");

            w2 = 0;

            for (int k = 0; k < rowTeam.Length; k++)
            {
                firstWidth = Convert.ToInt32(rowTeam[k]["Lenth"].ToString());
                firstPLeft = Convert.ToInt32(rowTeam[k]["Said"].ToString());

                if (firstPLeft == 0)
                {
                    firstPLeft = jianJu;
                }

                leftWidth = firstWidth / 2 - 1;

                rightWidth = firstWidth / 2 - 1;

                sb2.Append("<td width='" + (firstWidth + firstPLeft) + "' valign='top'>");
                sb2.Append("<table width='100%' cellspacing='0' cellpadding='0' border='0' >");
                sb2.Append("<tbody>");
                sb2.Append("<tr><td width='" + firstPLeft + "'><table width='100%'><tbody><tr><td>&nbsp;</td></tr></tbody></table></td><td width='" + firstWidth + "'><table width='100%' cellspacing='0' cellpadding='0' border='0' ><tbody><tr><td width='" + leftWidth + "' height=\"18\"></td><td width=\"2\" background=\"images/images02_02.gif\"  > </td><td width='" + rightWidth + "'></td></tr></tbody></table></td></tr>");


                sb2.Append("<tr><td width='" + firstPLeft + "' ><table width='100%'><tbody><tr><td>&nbsp;</td></tr></tbody></table></td><td width='" + firstWidth + "'>" + GetOneTable(dt, rowTeam[k]["number"].ToString()) + "</td></tr>");



                sb2.Append("</tbody></table></td>");
            }
        }


        sb2.Append("</tr></table>");


        return(sb2.ToString());
    }