public ActionResult SearchAction(StatByRegionViewModel model)
        {
            try
            {
                if (String.IsNullOrWhiteSpace(model.SearchConditions["StartDate"]))
                {
                    model.Start = Constants.MinDate;
                }
                else
                {
                    DateTime result = Constants.MinDate;
                    bool isSuccess = DateTime.TryParse(model.SearchConditions["StartDate"], out result);
                    model.Start = isSuccess ? result : Constants.MinDate;
                }

                if (String.IsNullOrWhiteSpace(model.SearchConditions["EndDate"]))
                {
                    model.End = DateTime.MaxValue;
                }
                else
                {
                    DateTime result = DateTime.MaxValue;
                    bool isSuccess = DateTime.TryParse(model.SearchConditions["EndDate"], out result);
                    model.End = isSuccess ? result : DateTime.MaxValue;
                }

                model.QueryData();
                model.CountTotalRows();

                return View(model);
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                return View(model);
            }
        }
 //
 // GET: /StatByAccount/
 public ActionResult Index(StatByRegionViewModel model)
 {
     model.SearchConditions["StartDate"] = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd");
     model.SearchConditions["EndDate"] = DateTime.Now.ToString("yyyy-MM-dd");
     return View(model);
 }