public ActionResult getProcedimientos(string term) { SelectViewModel sel = new SelectViewModel(); List <FiltroModel> lstProcedimientos = new List <FiltroModel>(); lstProcedimientos = sel.listaProcedimiento(term); return(Json(new { list = lstProcedimientos }, JsonRequestBehavior.AllowGet)); }
public SelectPanel() { Graph gr = new OrientedGraph(); InitializeComponent(); SelectViewModel s = new SelectViewModel(gr); this.DataContext = s; }
public IActionResult SubmitSelect(int id) { SelectViewModel vm = new SelectViewModel { Color = _colors[id - 1] }; return(View(vm)); }
public selectUserControl() { InitializeComponent(); myvm = new SelectViewModel(this, page2); listView.ItemsSource = myvm.GetAllClients(); DataContext = myvm; }
public static Window ShowSelectDialog(WpfWindow owner) { var viewModel = new SelectViewModel(); var win = new SelectWindow { DataContext = viewModel, Owner = owner }; viewModel.LoadWindows(); return(win.ShowDialog().GetValueOrDefault() ? viewModel.SelectedWindow : null); }
public void UpdateCell(SelectViewModel <PaymentMethod> info) { viewModel = info; if (!string.IsNullOrEmpty(info.Method.Icon)) { _icon.Image = UIImage.FromFile(info.Method.Icon); } _name.Text = info.Method.Name; _selectButton.Checked = info.IsSelect; viewModel.NotificationSelectChange = SelectChange; }
public async Task <IActionResult> SelectInfo() { UserEntity user = await _userHelper.GetUserAsync(User.Identity.Name); SelectViewModel select = new SelectViewModel { Drivers = _combosHelper.GetDriverStation(user.Station), Trucks = _combosHelper.GetTrucksStation(user.Station) }; return(View(select)); }
public async Task <IActionResult> Select(SelectViewModel selectViewModel) { #region Select try { var carreras = await _repository .FindBy <Carrera>(null, x => x.OrderBy(x => x.Nombre), x => x.IdUnidadAcademicaNavigation, x => x.IdUnidadAcademicaNavigation.IdCampusNavigation); int totalRegistros = carreras.Count(); if (!string.IsNullOrEmpty(selectViewModel.search)) { selectViewModel.search = selectViewModel.search.ToLower(); carreras = carreras.Where(x => x.Nombre.ToLower().Contains(selectViewModel.search) || x.IdUnidadAcademicaNavigation.Nombre.ToLower().Contains(selectViewModel.search) || x.IdUnidadAcademicaNavigation.IdCampusNavigation.Nombre.ToLower().Contains(selectViewModel.search)).ToList(); totalRegistros = carreras.Count(); } var skip = (selectViewModel.page * selectViewModel.perPage) - selectViewModel.perPage; var carrerasResult = carreras.Skip(skip).Take(selectViewModel.perPage).ToList(); if (selectViewModel.id != 0) { var carrera = await _repository.GetById <Carrera>(selectViewModel.id); carrerasResult.Add(carrera); } return(Ok(new { results = carrerasResult.Select(x => new { x.Id, text = x.Nombre, carrera = x.Nombre, unidadacademica = x.IdUnidadAcademicaNavigation.Nombre, campus = x.IdUnidadAcademicaNavigation.IdCampusNavigation.Nombre }), totalRegistros })); } catch (MessageAlertException ex) { _logger.LogInformation(ex.Message); return(BadRequest()); } catch (Exception ex) { _logger.LogError(ex.Message); return(BadRequest()); } #endregion }
public async Task <IActionResult> SelectInfo(SelectViewModel select) { if (ModelState.IsValid) { return(RedirectToAction($"{select.DriverId}/{nameof(Index)}/{select.TruckId}")); } UserEntity user = await _userHelper.GetUserAsync(User.Identity.Name); select.Drivers = _combosHelper.GetDriverStation(user.Station); select.Trucks = _combosHelper.GetTrucksStation(user.Station); return(View(select)); }
public static T SelectValue <T>(MainViewModel parentViewModel, string label, List <T> values) { var viewModel = new SelectViewModel(values.Cast <object>().ToList()) { Label = label }; var window = new SelectWindow(viewModel) { Owner = FindWindow(parentViewModel) }; window.ShowDialog(); return((T)viewModel.Result); }
public ActionResult PersonnelList(SelectViewModel selectViewModel) { Employee employee = Session["employee"] as Employee; if (employee == null) { return(RedirectToAction("SignIn", "Home")); } List <Personnel> personnels = manager_personnel.GetPersonnels(employee.CompanyName, selectViewModel); ViewData["personnels"] = personnels; return(View()); }
public ActionResult Select(SelectViewModel selectViewModel) { List <ExerciseViewModel> list = DataService.GetExercises(25); string sJSONResponse = JsonConvert.SerializeObject(list); selectViewModel.UserExercisePlanSelection = new UserExercisePlanSelection { ExercisePlanId = selectViewModel.ExercisePlanId, UserId = HttpContext.User.Identity.Name }; int userExercisePlanSelectionId = DataService.InsertUserExercisePlanSelection(selectViewModel.UserExercisePlanSelection); return(WeeklyPlan(userExercisePlanSelectionId)); }
public ActionResult ListarUnidadPrescripcionPorGrupoFarmaceutico(string codigoGrupo, string unidadVentaProducto) { if (isOutSession) { return(Json(new { outsession = isOutSession }, JsonRequestBehavior.AllowGet)); } else if (p.ListaFat == 2 || p.ListaFATAdmEditor == 2) { SelectViewModel oSelectViewModel = new SelectViewModel(); TeleconsultaViewModel atvm = new TeleconsultaViewModel(); atvm.unidadPrescripcion = oSelectViewModel.listaUnidadPrescripcionPorCodigoGrupoFarmaceutico(codigoGrupo, unidadVentaProducto); return(PartialView("_ListaUnidadPrescripcion", atvm)); } else { return(View("SinAcceso")); } }
public ActionResult ListarViaPorGrupoFarmaceutico(string codigoGrupo) { if (isOutSession) { return(Json(new { outsession = isOutSession }, JsonRequestBehavior.AllowGet)); } else if (p.ListaFat == 2 || p.ListaFATAdmEditor == 2) { SelectViewModel oSelectViewModel = new SelectViewModel(); TeleconsultaViewModel atvm = new TeleconsultaViewModel(); atvm.vias = oSelectViewModel.listaViasAplicacionPorCodigoGrupoFarmaceutico(codigoGrupo); return(PartialView("_ListaVia", atvm)); } else { return(View("SinAcceso")); } }
public async Task <IActionResult> Edit(int?id) { if (id == null) { return(NotFound()); } var product = await _repository.FindOne(id.Value); if (product == null) { return(NotFound()); } var vm = new ProductEditViewModel { Product = product }; var allCategories = await _categoryRepository.FindAllAsync(); foreach (var category in allCategories) { var model = new SelectViewModel { Id = category.Id, DisplayName = category.Name, Selected = false }; vm.Categories.Add(model); } foreach (var selectedCategory in product.ProductCategories) { var categorySelection = vm.Categories.FirstOrDefault(m => m.Id == selectedCategory.CategoryId); if (categorySelection != null) { categorySelection.Selected = true; } } return(View(vm)); }
// GET: FATReceta public ActionResult BandejaReceta() { if (isOutSession) { return(RedirectToAction("OutSession", "Login")); } else if (p.ListaFATReceta == 0) { return(View("SinAcceso")); } TelefarmaciaViewModel atvm = new TelefarmaciaViewModel(); atvm.getListaFATReceta("", "", "", "", "REVISAR"); SelectViewModel select = new SelectViewModel(); atvm.especialidades = select.listaEspecialidadesMedicas(); atvm.estadosRp = select.estadosRp(); return(View(atvm)); }
public ActionResult ListadoAtencionesAdmCG() { if (isOutSession) { return(RedirectToAction("OutSession", "Login")); } else if (p.ListaFatAdmision != 2) { return(View("SinAcceso")); } FATAdminViewModel atvm = new FATAdminViewModel(); string[] filtros = new string[5]; int id; filtros = System.Web.HttpContext.Current.Session["filtrosFATGS"] as string[]; id = System.Web.HttpContext.Current.Session["filtrosFATGSEstado"] as int? ?? 12; if (filtros != null) { ViewBag.fecinicio = filtros[0]; ViewBag.fecfin = filtros[1]; ViewBag.busqueda = filtros[2]; ViewBag.medico = filtros[3]; ViewBag.espec = filtros[4]; ViewBag.estado = id; atvm.getListaFATAdmGS(filtros[0], filtros[1], filtros[2], filtros[3], id, filtros[4]); } else { ViewBag.fecinicio = DateTime.Now.ToString("dd/MM/yyyy"); ViewBag.fecfin = ""; ViewBag.busqueda = ""; ViewBag.medico = ""; ViewBag.espec = ""; ViewBag.estado = id; atvm.getListaFATAdmGS(DateTime.Now.ToString("dd/MM/yyyy"), "", "", "", id, ""); } SelectViewModel select = new SelectViewModel(); atvm.especialidades = select.listaEspecialidadesMedicas(); return(View(atvm)); }
public string DepartmentManagementSelect() { List <SelectViewModel> SelectListx = new List <SelectViewModel>(); var list = _db.MXIC_UserManagements.Where(x => x.UserDisable == true).Select(x => new { x.DepName }).Distinct().OrderBy(x => x.DepName).ToList(); foreach (var item in list) { var SelectItem = new SelectViewModel() { name = item.DepName, value = item.DepName }; SelectListx.Add(SelectItem); } string Str = JsonConvert.SerializeObject(SelectListx, Formatting.Indented); return(Str); }
public string QuotationSelect() { List <SelectViewModel> SelectListx = new List <SelectViewModel>(); var list = _db.MXIC_Quotations.Select(x => new { x.VendorName }).Distinct().OrderBy(x => x.VendorName).ToList(); foreach (var item in list) { var SelectItem = new SelectViewModel() { name = item.VendorName, value = item.VendorName }; SelectListx.Add(SelectItem); } string Str = JsonConvert.SerializeObject(SelectListx, Formatting.Indented); return(Str); }
public IActionResult Select(int?id) { Discipline.Clear(); if (id == null) { return(NotFound()); } var student = _context.Students .FirstOrDefault(m => m.Id == id); var students = _context.Students.Include(c => c.DisciplineStudents).ThenInclude(sc => sc.Discipline).ToList(); SelectedDiscipline = students.FirstOrDefault(s => s.Id == student.Id).DisciplineStudents.Select(c => c.Discipline).ToList(); var disciplines = _context.Disciplines.ToList().Except(SelectedDiscipline).ToList(); NewDisceplines(SelectedDiscipline, true); NewDisceplines(disciplines, false); SelectViewModel selectViewModel = new SelectViewModel(student, Discipline); return(View(selectViewModel)); }
// GET: FATServicio public ActionResult BandejaServicio() { if (isOutSession) { return(RedirectToAction("OutSession", "Login")); } else if (p.ListaFATLaboratorio == 0 || p.ListaFATRadiologia == 0) { return(View("SinAcceso")); } ViewBag.fecinicio = DateTime.Now.ToString("dd/MM/yyyy"); ViewBag.Servicio = (PermisosSKA.FatRadiologia == 2 || PermisosSKA.FatLaboratorio == 2) ? "Todo" : (PermisosSKA.FatLaboratorio == 2) ? "Laboratorio" : "Radiología"; TeleconsultaViewModel atvm = new TeleconsultaViewModel(); atvm.getListaFATServicios("", "", "", ""); SelectViewModel select = new SelectViewModel(); atvm.especialidades = select.listaEspecialidadesMedicas(); return(View(atvm)); }
public ActionResult AdminManage() { ApplicationDbContext db = new ApplicationDbContext(); var ShipList = db.Ships.Select(c => new SelectListItem { Value = c.ShipID.ToString(), Text = c.ShipName, }); var DockList = db.Docks.Select(c => new SelectListItem { Value = c.DockID.ToString(), Text = c.DockName, }); var model = new SelectViewModel { ShipList = ShipList.AsEnumerable(), DockList = DockList.AsEnumerable() }; return(View(model)); }
public string Shifts() { List <SelectViewModel> SelectListx = new List <SelectViewModel>(); var ShiftsList = _db.MXIC_VendorManagements.Select(x => x.Shifts).Distinct(); foreach (var item in ShiftsList) { var SelectItem = new SelectViewModel() { name = item, value = item }; SelectListx.Add(SelectItem); } string Str = JsonConvert.SerializeObject(SelectListx, Formatting.Indented); return(Str); }
public async Task <IActionResult> Create() { var vm = new ProductEditViewModel(); vm.Product = new Product(); var allCategories = await _categoryRepository.FindAllAsync(); foreach (var category in allCategories) { var model = new SelectViewModel { Id = category.Id, DisplayName = category.Name, Selected = false }; vm.Categories.Add(model); } return(View(vm)); }
public async Task <IActionResult> PutCountries([FromRoute] long id, [FromBody] CountryEditViewModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } Country country = new Country { Id = id, Name = model.Name }; _context.Entry(country).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CountryExists(id)) { return(NotFound()); } else { throw; } } var obj = new SelectViewModel { Value = country.Id, Label = country.Name }; return(Ok(obj)); }
public List <Personnel> GetPersonnels(string db_name, SelectViewModel selectViewModel) { Repository <Personnel> repo_personnel = new Repository <Personnel>(db_name); List <Personnel> personnelList = new List <Personnel>(); if (selectViewModel != null) { if (selectViewModel.Company == "all" && selectViewModel.S_Central == "all" && selectViewModel.Position == "all") { personnelList = repo_personnel.List(); } else { personnelList = repo_personnel.List(x => x.Company == selectViewModel.Company || x.S_Central == selectViewModel.S_Central || x.Position == selectViewModel.Position); } } else { personnelList = null; } return(personnelList); }
public string SwipeDoubleCheckTypeSelect(string TableName) { List <SelectViewModel> SelectListx = new List <SelectViewModel>(); var list = _db.View_Swipe_Doubles.Select(x => new { x.CheckType }).Distinct().OrderBy(x => x.CheckType).ToList(); //var list = _db.SwipeInfoSelects.Select(x => new { x.name }).Distinct().OrderBy(x => x.name).ToList(); foreach (var item in list) { var SelectItem = new SelectViewModel() { name = item.CheckType, value = item.CheckType }; SelectListx.Add(SelectItem); } string Str = JsonConvert.SerializeObject(SelectListx, Formatting.Indented); return(Str); }
public SelectScreen(ScreenController sC) : base(sC) { ViewModel = new SelectViewModel(); Go = new ExecuteCommand(() => SwitchScreen(new GameScreen(sC, ViewModel.ChosenPuzzle.Puzzle))); BackHome = new ExecuteCommand(() => SwitchScreen(new HomeScreen(sC))); }
public async Task <ActionResult> Checkout(SelectViewModel model) { return(View()); }
public SelectWindow(SelectViewModel selectViewModel) { DataContext = selectViewModel; selectViewModel.Close += () => Close(); InitializeComponent(); }