コード例 #1
0
ファイル: Program.cs プロジェクト: Didox/MVC_e_Velocit_app
            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);
            }
コード例 #2
0
ファイル: Tipos.cs プロジェクト: Didox/MVC_e_Velocit_app
        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);
        }
コード例 #3
0
ファイル: CData.cs プロジェクト: whatanaka/estudos
 /// <summary>
 /// Busca os dados da base através dos parâmetros
 /// </summary>
 public virtual LIType Get(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)
         {
             while (dr.Read())
             {
                 l.Add(SetObject(dr, (IType)Activator.CreateInstance(iType.GetType())));
             }
         }
         return(l);
     }
     catch (Exception ex) { throw ex; }
     finally { CloseConnection(iType); }
 }
コード例 #4
0
ファイル: CData.cs プロジェクト: Didox/MVC_e_Velocit_app
 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;
 }
コード例 #5
0
ファイル: Program.cs プロジェクト: Didox/MVC_e_Velocit_app
            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;
            }
コード例 #6
0
ファイル: Tipos.cs プロジェクト: Didox/MVC_e_Velocit_app
        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;
        }