public ActionResult Search(SeasonModelsView model) { try { var data = _factory.GetListSeason(model.StoreID, null, CurrentUser.ListOrganizationId); foreach (var item in data) { if (item.StartTime.Value.Date == Commons._UnlimitedDate.Date || item.EndTime.Value.Date == Commons._UnlimitedDate.Date) { item.Unlimited = true; } else { item.StartTime = item.StartTime.Value.ToLocalTime(); item.EndTime = item.EndTime.Value.ToLocalTime(); } item.StartDate = new DateTime(item.StartDate.Year, item.StartDate.Month, item.StartDate.Day, item.StartTime.Value.Hour, item.StartTime.Value.Minute, item.StartTime.Value.Second); item.EndDate = new DateTime(item.EndDate.Year, item.EndDate.Month, item.EndDate.Day, item.EndTime.Value.Hour, item.EndTime.Value.Minute, item.EndTime.Value.Second); //============= if (item.RepeatType == (byte)Commons.ERepeatType.DayOfWeek) { item.ListWeekDayV2.ForEach(x => { if (item.ListDay.Contains(x.Index)) { x.IsActive = true; x.Status = 1; } }); } else if (item.RepeatType == (byte)Commons.ERepeatType.DayOfMonth) { item.ListMonthDayV2.ForEach(x => { if (item.ListDay.Contains(x.Index)) { x.IsActive = true; x.Status = 1; } }); } } model.List_Season = data; } catch (Exception ex) { _logger.Error("Season_Search: " + ex); return(new HttpStatusCodeResult(400, ex.Message)); } return(PartialView("_ListData", model)); }
// GET: SSeason public ActionResult Index() { try { SeasonModelsView model = new SeasonModelsView(); model.StoreID = CurrentUser.StoreId; return(View(model)); } catch (Exception ex) { _logger.Error("Season_Index:" + ex); return(new HttpStatusCodeResult(400, ex.Message)); } }