public IActionResult CreateTimeVM() { var vm = new TimeVM(); var time = vm.TimeFrom.ToString("hh\\:mm"); return(View(vm)); }
public async Task <IActionResult> CreateTimeVM(TimeVM input) { if (!ModelState.IsValid) { return(View()); } return(View()); }
public ActionResult Editar(int id) { TimeVM data = Mapper.Map<TimeVM>(_timeService.GetById(id)); data.ListaEstadios = _estadioService.BuscarAtivos().Select(x => new SelectListItem() { Value = x.Id.ToString(), Text = string.IsNullOrEmpty(x.Apelido) || string.IsNullOrWhiteSpace(x.Apelido) ? x.Nome : x.Apelido }); data.LstStatus = Utils.ListarStatus(); return View(data); }
/// <summary> /// Default constructor /// </summary> public WidgetTime() { _fullWidget = new TimeWidgetFull(); _rightLeftWidget = new TimeWidgetReduce(); _topBotWidget = new TimeWidgetReduce(); _dataContext = (TimeVM)_fullWidget.DataContext; _topBotWidget.DataContext = _dataContext; _rightLeftWidget.DataContext = _dataContext; }
public ActionResult Criar() { TimeVM data = new TimeVM() { ListaEstadios = _estadioService.BuscarAtivos().Select(x => new SelectListItem() { Value = x.Id.ToString(), Text = string.IsNullOrEmpty(x.Apelido) || string.IsNullOrWhiteSpace(x.Apelido) ? x.Nome : x.Apelido }), LstStatus = Utils.ListarStatus() }; return View(data); }
void refreshPattern() { // 刷新界面编辑(TODO) ClassVM.Refresh(); CourseVM.Refresh(); StudentVM.Refresh(); TagVM.Refresh(); TeacherVM.Refresh(); TimeVM.Refresh(); RuleVM.Refresh(); }
private ActionResult Salvar(TimeVM timeVM) { try { if (!ModelState.IsValid) { throw new Exception("O modelo não é válido."); } var time = Mapper.Map <TimeVM, Time>(timeVM); logic.Save(time); return(RedirectToAction("Index")); } catch (Exception ex) { ModelState.AddModelError("", ex.Message); return(View(timeVM)); } }
public ActionResult GetVestigingOpeningHourByLocationId(int Id, string date) { object[] item = _locationService.GetVestigingOpeningHourByLocationId(Id, DateTime.ParseExact(date, GlobalStatic.DateFormatString, CultureInfo.InvariantCulture)); if (item != null) { var minTime = new TimeVM(); var maxTime = new TimeVM(); int tempTryResult = 0; if (item[0] != null) { minTime.Hour = int.TryParse(item[0].ToString().Split('.')[0], out tempTryResult) ? tempTryResult : 0; minTime.Minute = int.TryParse(item[0].ToString().Split('.')[1], out tempTryResult) ? tempTryResult : 0; } else { minTime = null; } if (item[1] != null) { maxTime.Hour = int.TryParse(item[1].ToString().Split('.')[0], out tempTryResult) ? tempTryResult : 0; maxTime.Minute = int.TryParse(item[1].ToString().Split('.')[1], out tempTryResult) ? tempTryResult : 0; } else { maxTime = null; } return(Json(new { minTime, maxTime, availableDates = item[2] }, JsonRequestBehavior.AllowGet)); } return(Json(null, JsonRequestBehavior.AllowGet)); }
public ActionResult Editar(TimeVM timeVM) { return(Salvar(timeVM)); }
public ActionResult Editar(TimeVM model) { _timeService.Update(Mapper.Map<Time>(model)); return RedirectToAction("Index"); }
public ActionResult Criar(TimeVM model) { _timeService.Add(Mapper.Map<Time>(model)); return RedirectToAction("Index"); }