Beispiel #1
0
 public LIType Find()
 {
     return(Tipo.Find(this, new Telefone(), "IDTipoTelefone", "Nome"));
 }
Beispiel #2
0
 public void Save()
 {
     Tipo.Save(this, new Telefone(), "IDTipoTelefone", "Nome");
 }
Beispiel #3
0
 public void Delete()
 {
     Tipo.Delete(this, new Telefone(), "IDTipoTelefone");
 }
 public void Delete()
 {
     Tipo.Delete(this, new Documento(), "IDTipoDocumento");
 }
 public LIType Find()
 {
     return(Tipo.Find(this, new Documento(), "IDTipoDocumento", "Nome"));
 }
Beispiel #6
0
 public LIType Find()
 {
     return(Tipo.Find(this, new Email(), "IDTipoEmail", "Nome"));
 }
 public void Save()
 {
     Tipo.Save(this, new Documento(), "IDTipoDocumento", "Nome");
 }
Beispiel #8
0
 public void Delete()
 {
     Tipo.Delete(this, new Email(), "IDTipoEmail");
 }
Beispiel #9
0
 public void Save()
 {
     Tipo.Save(this, new Email(), "IDTipoEmail", "Nome");
 }
Beispiel #10
0
        public static void Delete(IType objiTypeValues, IType iType, string namePropertyId)
        {
            var pTipo = objiTypeValues.GetType().GetProperty(namePropertyId);

            if (pTipo.GetValue(objiTypeValues, null) == null) throw new TradeVisionValidationError("IDTipo obrigatório para a ação GET");
            var tipoTabelaColuna = new TipoTabelaColuna(iType);
            tipoTabelaColuna.Get();
            if (tipoTabelaColuna.IDTipoTabelaColuna != null)
            {
                var tipo = new Tipo();
                tipo.TipoTabelaColuna = tipoTabelaColuna;
                tipo.IDTipo = (int?)pTipo.GetValue(objiTypeValues, null);
                tipo.Delete();
            }
        }
Beispiel #11
0
        public static void Save(IType objiTypeValues, IType iType, string namePropertyId, string namePropertyName)
        {
            var tipoTabelaColuna = new TipoTabelaColuna(iType);
            try
            {
                tipoTabelaColuna.IsTransaction = true;
                tipoTabelaColuna.Get();
                tipoTabelaColuna.Save();

                var tipo = new Tipo();
                tipo.Transaction = tipoTabelaColuna.Transaction;
                tipo.IDTipo = (int?)objiTypeValues.GetType().GetProperty(namePropertyId).GetValue(objiTypeValues, null);
                tipo.Nome = (string)objiTypeValues.GetType().GetProperty(namePropertyName).GetValue(objiTypeValues, null);
                tipo.TipoTabelaColuna = tipoTabelaColuna;
                tipo.Save();

                tipoTabelaColuna.Commit();
            }
            catch (Exception err)
            {
                tipoTabelaColuna.Rollback();
                throw err;
            }
        }
Beispiel #12
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;
        }