public void BindSelects() { ViewBag.Lotes = new List <List <dynamic> >(); ViewBag.Lotes = _loteRepository.GetLotesJoinItems(); var zonas = _context._00Zona.Where(c => c.Id < 3).ToList(); ViewBag.Zonas = new List <_00Zona>(); foreach (var item in zonas) { var z = new _00Zona(); z.Id = item.Id; z.Zona = item.Zona; ViewBag.Zonas.Add(z); } var delegacoes = _context._00Delegacao.ToList(); ViewBag.Delegacao = new List <_00Delegação>(); foreach (var item in delegacoes) { var d = new _00Delegação(); d.Id = item.Id; d.Delegacao = item.Delegacao; d.Zona = item.Zona; ViewBag.Delegacao.Add(d); } var areas = _context._00Areas.ToList(); ViewBag.Areas = new List <_00Areas>(); foreach (var item in areas) { var a = new _00Areas(); a.Id = item.Id; a.Area = item.Area; ViewBag.Areas.Add(a); } }
public void BindSelects() { ViewBag.Lotes = new List <List <dynamic> >(); ViewBag.Lotes = _loteRepository.GetLotesJoinItems(); ViewBag.MotivosRejeicao = new List <_11MotivosRej>(); ViewBag.MotivosRejeicao = _motivoRejeicaoRepository.GetMotivosProdutoSv(); var zonas = _context._00Zona.Where(c => c.Id < 3).Select(c => new { c.Id, c.Zona }).ToList(); ViewBag.Zonas = new List <_00Zona>(); foreach (var item in zonas) { var z = new _00Zona(); z.Id = item.Id; z.Zona = item.Zona; ViewBag.Zonas.Add(z); } var delegacao = _context._00Delegacao.Select(c => new { c.Id, c.Delegacao, c.Zona }).ToList(); ViewBag.Delegacao = new List <_00Delegação>(); foreach (var item in delegacao) { var d = new _00Delegação(); d.Id = item.Id; d.Delegacao = item.Delegacao; d.Zona = item.Zona; ViewBag.Delegacao.Add(d); } var areas = _context._00Areas.Select(c => new { c.Id, c.Area }).ToList(); ViewBag.Area = new List <_00Areas>(); foreach (var item in areas) { var a = new _00Areas(); a.Id = item.Id; a.Area = item.Area; ViewBag.Area.Add(a); } // dropdown status condominio : GASIFICANDO, COMERCIALIZANDO... var statusCondominio = _context._00TabelasItems .Where(c => (c.Tabela == 237) && (c.Campo == "STATUS") && (c.Id != 25)) .OrderBy(c => c.Ordem) .Select(c => new { c.Id, c.Item }).ToList(); ViewBag.StatusCondominios = new List <_00TabelasItems>(); foreach (var item in statusCondominio) { var sc = new _00TabelasItems(); sc.Id = item.Id; sc.Item = item.Item; ViewBag.StatusCondominios.Add(sc); } var listCond = _context._11_LoteAtivo_Condominios.FromSql("exec [dbo].[11_LoteAtivo_Condominios]").ToList(); ViewBag.ListaCondominios = new List <_11_LoteAtivos_Condominios>(); foreach (var item in listCond) { var c = new _11_LoteAtivos_Condominios(); c.Id = item.Id; c.Nome = item.Nome; c.Num = item.Num; c.Complemento = item.Complemento; c.Item = item.Item; c.Z = item.Z; c.D = item.D; ViewBag.ListaCondominios.Add(c); } }