Beispiel #1
0
 /// <summary>
 /// 根据前台查询的类型转化为后台对应的实际统计单元
 /// </summary>
 /// <param name="style">前台的统计风格</param>
 /// <returns></returns>
 public static int ConvertBaseCountType(ReportStyleNew style)
 {
     switch (style)
     {
         case ReportStyleNew.DayStyle:
             return 1;
         case ReportStyleNew.MonthStyle:
             return 2;
         case ReportStyleNew.YearStyle:
             return 3;
         default:
             return 1;
     }
 }
Beispiel #2
0
        /// <summary>
        /// 根据前台查询的类型转化为后台对应的实际统计单元
        /// </summary>
        /// <param name="style">前台的统计风格</param>
        /// <returns></returns>
        public static int ConvertBaseCountType(ReportStyleNew style)
        {
            switch (style)
            {
            case ReportStyleNew.DayStyle:
                return(1);

            case ReportStyleNew.MonthStyle:
                return(2);

            case ReportStyleNew.YearStyle:
                return(3);

            default:
                return(1);
            }
        }
Beispiel #3
0
 /// <summary>
 /// 格式化日期显示的格式
 /// </summary>
 /// <param name="date">日期</param>
 /// <param name="style">显示格式</param>
 /// <returns></returns>
 public static string FormatDate(string date, ReportStyleNew style)
 {
     DateTime Dates = Convert.ToDateTime(date);
     switch (ConvertBaseCountType(style))
     {
         case 1:
             ////Dates = Dates.AddHours(1);
             return Dates.ToString("HH 点");
         case 2:
             return Dates.ToString("MM-dd");
         case 3:
             return Dates.ToString("MM-dd");
         //return Dates.ToString("yyyy-MM 月");
         default:
             return Dates.ToString("yyyy-MM 月");
     }
 }
Beispiel #4
0
        /// <summary>
        /// 格式化日期显示的格式
        /// </summary>
        /// <param name="date">日期</param>
        /// <param name="style">显示格式</param>
        /// <returns></returns>
        public static string ReportFormatDate(string date, ReportStyleNew style)
        {
            DateTime Dates = Convert.ToDateTime(date);

            switch (ConvertBaseCountType(style))
            {
            case 1:
                ////Dates = Dates.AddHours(1);
                return(Dates.ToString("HH 点"));

            case 2:
                return(Dates.ToString("yyyy-MM-dd"));

            case 3:
                return(Dates.ToString("yyyy-MM-dd"));

            //return Dates.ToString("yyyy-MM 月");
            default:
                return(Dates.ToString("yyyy-MM 月"));
            }
        }