Example #1
0
            private static LIType LoadModels()
            {
                var tabelas  = new LIType();
                var campanha = new Campanha(201);

                campanha.Get();

                if (campanha.IDCampanha == null)
                {
                    throw new TradeVisionValidationError("Campanha não encontrada");
                }

                tabelas.Add(new Usuario(campanha));
                tabelas.Add(new PessoaJuridica(campanha));

                var classesDidoxBusiness = CType.GetAllClassesOfAssembly(new Usuario());
                var listaTabelas         = getListaTabelasXLS();

                foreach (string tabela in listaTabelas)
                {
                    foreach (IType iType in classesDidoxBusiness)
                    {
                        if (CType.GetTableName(iType).ToLower() == tabela.ToLower())
                        {
                            if (!tabelas.Exists(it => it.GetType().Name == iType.GetType().Name))
                            {
                                tabelas.Add(iType);
                                break;
                            }
                        }
                    }
                }
                return(tabelas);
            }
Example #2
0
        public static LIType Find(IType objiTypeValues, IType iType, string namePropertyId, string namePropertyName)
        {
            var tipoTabelaColuna = new TipoTabelaColuna(iType);

            tipoTabelaColuna.Get();
            var tiposCType = new LIType();

            if (tipoTabelaColuna.IDTipoTabelaColuna != null)
            {
                var tipoFind = new Tipo();
                tipoFind.TipoTabelaColuna = tipoTabelaColuna;
                var tipos = tipoFind.Find();
                foreach (var t in tipos)
                {
                    var tipo  = (Tipo)t;
                    var cType = (IType)Activator.CreateInstance(objiTypeValues.GetType());
                    var pTipo = cType.GetType().GetProperty(namePropertyId);
                    var pName = cType.GetType().GetProperty(namePropertyName);
                    pTipo.SetValue(cType, cType.PrepareValueProperty(tipo.IDTipo, pTipo.PropertyType), null);
                    pName.SetValue(cType, cType.PrepareValueProperty(tipo.Nome, pName.PropertyType), null);
                    tiposCType.Add(cType);
                }
            }

            return(tiposCType);
        }
Example #3
0
    private void GetPessoaJuridicaDePara(LIType historicoDePara)
    {
        if (historicoDePara == null)
        {
            historicoDePara = getHistorico();
        }

        gvPessoaJuridicasDePara.DataSource = historicoDePara;
        gvPessoaJuridicasDePara.DataBind();
    }
Example #4
0
 /// <summary>
 /// Busca os dados da base e seta a referencia
 /// </summary>
 public virtual IType Get(ref IType iType)
 {
     try
     {
         Cmd             = DataBaseGeneric.CreateCommand(BaseType);
         Cmd.CommandType = CommandType.StoredProcedure;
         Cmd.CommandText = "usp_Get" + iType.GetType().Name;
         SetParanGet(iType);
         OpenConnection();
         LIType       l  = new LIType();
         DbDataReader dr = Cmd.ExecuteReader();
         if (dr != null && dr.Read())
         {
             SetObject(dr, iType);
         }
         return(iType);
     }
     catch (Exception ex) { throw ex; }
     finally { CloseConnection(iType); }
 }
Example #5
0
    private void GetPessoaJuridicaDePara(LIType historicoDePara)
    {
        if (historicoDePara == null)
            historicoDePara = getHistorico();

        gvPessoaJuridicasDePara.DataSource = historicoDePara;
        gvPessoaJuridicasDePara.DataBind();
    }
Example #6
0
 protected LIType MakeListToGet(IType iType)
 {
     OpenConnectionTrans(iType);
     LIType l = new LIType();
     DbDataReader dr = Cmd.ExecuteReader();
     if (dr != null)
         while (dr.Read())
             l.Add(SetObject(dr, (IType)Activator.CreateInstance(iType.GetType())));
     dr.Close();
     return l;
 }
Example #7
0
            private static LIType LoadModels()
            {
                var tabelas = new LIType();
                var campanha = new Campanha(201);
                campanha.Get();

                if (campanha.IDCampanha == null)
                    throw new TradeVisionValidationError("Campanha não encontrada");

                tabelas.Add(new Usuario(campanha));
                tabelas.Add(new PessoaJuridica(campanha));

                var classesDidoxBusiness = CType.GetAllClassesOfAssembly(new Usuario());
                var listaTabelas = getListaTabelasXLS();
                foreach (string tabela in listaTabelas)
                {
                    foreach (IType iType in classesDidoxBusiness)
                    {
                        if (CType.GetTableName(iType).ToLower() == tabela.ToLower())
                        {
                            if (!tabelas.Exists(it => it.GetType().Name == iType.GetType().Name))
                            {
                                tabelas.Add(iType);
                                break;
                            }
                        }
                    }
                }
                return tabelas;
            }
Example #8
0
        public static LIType Find(IType objiTypeValues, IType iType, string namePropertyId, string namePropertyName)
        {
            var tipoTabelaColuna = new TipoTabelaColuna(iType);
            tipoTabelaColuna.Get();
            var tiposCType = new LIType();
            if (tipoTabelaColuna.IDTipoTabelaColuna != null)
            {
                var tipoFind = new Tipo();
                tipoFind.TipoTabelaColuna = tipoTabelaColuna;
                var tipos = tipoFind.Find();
                foreach (var t in tipos)
                {
                    var tipo = (Tipo)t;
                    var cType = (IType)Activator.CreateInstance(objiTypeValues.GetType());
                    var pTipo = cType.GetType().GetProperty(namePropertyId);
                    var pName = cType.GetType().GetProperty(namePropertyName);
                    pTipo.SetValue(cType, cType.PrepareValueProperty(tipo.IDTipo, pTipo.PropertyType), null);
                    pName.SetValue(cType, cType.PrepareValueProperty(tipo.Nome, pName.PropertyType), null);
                    tiposCType.Add(cType);
                }
            }

            return tiposCType;
        }