Exemple #1
0
        public string last()
        {
            int           year = Convert.ToInt32(Request.QueryString["year"]);
            StringBuilder sb   = new StringBuilder();


            for (int i = 1; i < 13; i++)
            {
                DataTable dt3 = BLL_Hotel.Cha_MonthChargeCount(i, year - 1);
                if (dt3.Rows.Count != 0)
                {
                    if (i != 12)
                    {
                        sb.Append(dt3.Rows[0][1].ToString() + ",");
                    }
                    else
                    {
                        sb.Append(dt3.Rows[0][1].ToString());
                    }
                }
                else
                {
                    if (i != 12)
                    {
                        sb.Append("0,");
                    }
                    else
                    {
                        sb.Append("0");
                    }
                }
            }
            return(sb.ToString());
        }
Exemple #2
0
        public string month()
        {
            int           year = Convert.ToInt32(Request.QueryString["year"]);
            StringBuilder sb   = new StringBuilder();

            //DataTable dt = BLL_Hotel.Cha_YearChargeCount(2015);
            //DataTable dt1 = BLL_Hotel.Cha_YearChargeCount(2014);

            for (int i = 1; i < 13; i++)
            {
                DataTable dt3 = BLL_Hotel.Cha_MonthChargeCount(i, year);
                if (dt3.Rows.Count != 0)
                {
                    sb.Append("<tr><th>" + dt3.Rows[0][0].ToString() + "月</th><td>" + dt3.Rows[0][1].ToString() + "</td>");
                }
                else
                {
                    sb.Append("<tr><th>" + i + "月</th><td>0</td>");
                }



                DataTable dt2 = BLL_Hotel.Cha_MonthChargeCount(i, year - 1);



                if (dt2.Rows.Count != 0)
                {
                    sb.Append("<td>" + dt2.Rows[0][1].ToString() + "</td></tr>");
                }

                else
                {
                    sb.Append("<td>0</td></tr>");
                }
            }

            return(sb.ToString());
        }