Example #1
0
        public static void Get(IType objiTypeValues, IType iType, string namePropertyId, string namePropertyName)
        {
            var pTipo = objiTypeValues.GetType().GetProperty(namePropertyId);
            var pName = objiTypeValues.GetType().GetProperty(namePropertyName);

            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.Get();

                if (tipo.IDTipo != null)
                {
                    pName.SetValue(objiTypeValues, objiTypeValues.PrepareValueProperty(tipo.Nome, pName.PropertyType), null);
                }
            }
        }
Example #2
0
 public void Get()
 {
     if (IDTipoEndereco == null)
     {
         return;
     }
     Tipo.Get(this, new Endereco(), "IDTipoEndereco", "Nome");
 }
Example #3
0
 public void Get()
 {
     if (IDTipoTelefone == null)
     {
         return;
     }
     Tipo.Get(this, new Telefone(), "IDTipoTelefone", "Nome");
 }
Example #4
0
 public void Get()
 {
     if (IDTipoDocumento == null)
     {
         return;
     }
     Tipo.Get(this, new Documento(), "IDTipoDocumento", "Nome");
 }
Example #5
0
 public void Get()
 {
     if (IDTipoEmail == null)
     {
         return;
     }
     Tipo.Get(this, new Email(), "IDTipoEmail", "Nome");
 }
Example #6
0
    protected void btnSalvar_Click(object sender, EventArgs e)
    {
        var Tipo = new Tipo();
        try
        {
            if (txtId.Text != "")
            {
                Tipo.IDTipo = int.Parse(txtId.Text);
                Tipo.Get();
            }

            Tipo.Nome = txtNome.Text;
        Tipo.IDTipoTabelaColuna = int.Parse(txtIDTipoTabelaColuna.Text);

            Tipo.Save();
            GetTipo((int)Tipo.IDTipo);

            Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>alert('Registro salvo.')</script>");
        }
        catch (Exception err)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>alert('" + FormatError.FormatMessageForJAlert(err.Message) + "')</script>");
        }
    }
Example #7
0
    private void GetTipo(int idTipo)
    {
        dvSalvarTipo.Visible = true;
        dvListarTipos.Visible = false;

        var Tipo = new Tipo();
        Tipo.IDTipo = idTipo;
        Tipo.Get();

        txtId.Text = Tipo.IDTipo.ToString();
        txtNome.Text = Tipo.Nome.ToString();
        txtIDTipoTabelaColuna.Text = Tipo.IDTipoTabelaColuna.ToString();
    }
Example #8
0
        public static void Get(IType objiTypeValues, IType iType, string namePropertyId, string namePropertyName)
        {
            var pTipo = objiTypeValues.GetType().GetProperty(namePropertyId);
            var pName = objiTypeValues.GetType().GetProperty(namePropertyName);

            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.Get();

                if (tipo.IDTipo != null)
                    pName.SetValue(objiTypeValues, objiTypeValues.PrepareValueProperty(tipo.Nome, pName.PropertyType), null);
            }
        }