Ejemplo n.º 1
0
        private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
        {
            DateTime startDay  = this.dateTimePicker1.Value.Date;
            string   startTime = startDay.ToString("yyyy-MM-dd") + " 00:00:00";

            if (!this.startDate.Equals(startTime))
            {
                List <Comment> listComments = new QuanLyBinhLuanDomain().LoadBinhLuanInPeriod(this.repository, startTime, this.endDate);
                this.commentStatistic = new Models.CommentStatistic(listComments);
                this.startDate        = startTime;
                handleData();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Default constructor
        /// </summary>
        public CommentStatistic(Repository.Repository repository)
        {
            this.repository = repository;
            DateTime serverTime = DateTime.Now;
            string   startTime  = serverTime.ToString("yyyy-MM-dd") + " 00:00:00";
            string   endTime    = serverTime.AddDays(1).ToString("yyyy-MM-dd") + " 00:00:00";

            this.startDate = startTime;
            this.endDate   = endTime;
            this.InitializeComponent();
            List <Comment> listComments = new QuanLyBinhLuanDomain().LoadBinhLuanInPeriod(repository, startTime, endTime);

            this.commentStatistic = new Models.CommentStatistic(listComments);

            handleData();
        }