Business Object Maper - Field Properties


Author
Message
Rogerio Mauri
Rogerio Mauri
StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)
Group: StrataFrame Users
Posts: 205, Visits: 629
Ok... Você poderia então questioná-lo se entendeu corretamente a proposta?

Rogério Mauri Smile

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Olá Rogério.

Pelo que ele respondeu, parece ter entendido o que você disse, e concordado. Ele só ficou confuso se era uma pergunta sua ou um alerta sobre a situação.

Valeu! Wink

Rogerio Mauri
Rogerio Mauri
StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)
Group: StrataFrame Users
Posts: 205, Visits: 629
Ops...

Rogerio Mauri (09/05/2008)
Therefore, he follows text in Portuguese.

Therefore, it follows text in Portuguese
 


Rogério Mauri Smile

Rogerio Mauri
Rogerio Mauri
StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)
Group: StrataFrame Users
Posts: 205, Visits: 629
Taylor… I will go to need the support of Ivan. Therefore, he follows text in Portuguese.

Ivan...

Não sei consegui explicar a questão neste tópico, mas a resposta de Taylor chegou um pouco confusa para mim. Peço seu auxílio.

A questão é a seguinte:

Considerando o código 'default' criado pelo BOM para campos imagem, customizados para System.Drawing.Bitmap / Serialize Data, uma associação 'null' no BO gera um erro. Então, sugeri a mudança no código 'default' conforme acima. Ou seja, se a propriedade for 'null' (ação para excluir a imagem no banco de dados via BO) 'setar' o campo com byte[0]. Ficou claro ou existe uma outra maneira de tratar campos imagens (inclusão/exclusão) com o BO?

Rogério Mauri Smile



Dustin Taylor
Dustin Taylor
StrataFrame Team Member (652 reputation)
Group: StrataFrame Users
Posts: 364, Visits: 771
Howdy Rogerio Smile

Yep, for serializing a bitmap you have to account for nulls, otherwise your image object(s) can throw fits whenever it tries to serialize or deserialize the image. Were you just pointing that out, or was there a question I missed?

Thanks!

Rogerio Mauri
Rogerio Mauri
StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)
Group: StrataFrame Users
Posts: 205, Visits: 629
For:
     - 'Custom Data Type':       System.Drawing.Bitmap 
     - 'Serialize Data?':            selected.

Code generated automatically for the SF:

/// <summary>
/// Fotografia
/// </summary>
/// <remarks></remarks>

[Browsable(false),
 BusinessFieldDisplayInEditor(),
 Description("Fotografia"),
 DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public System.Drawing.Bitmap Foto
{
     get
    
{
          try
         
{
               return (System.Drawing.Bitmap)this.BinaryFormatter.Deserialize(new
                       
 MemoryStream((Byte[])this.CurrentRow["Foto"]));
          }
          catch
         
{
              return null;
          }
     }
     set
    
{
           if(value != null)
           {
                MemoryStream loStream = new MemoryStream();
                this.BinaryFormatter.Serialize(loStream, value);
                this.CurrentRow["Foto"] = loStream.ToArray();
          
}
           else
                this.CurrentRow["Foto"] =
new byte[0]; ;)
    
}
}

This alteration is necessary to be able to exclude an image.

private void cmdExcluiFoto_Click(object sender, EventArgs e)
{
     if (MessageBox.Show("Deseja realmente excluir a foto?", "Atenção",
         MessageBoxButtons.YesNo,
         MessageBoxIcon.Question,
         MessageBoxDefaultButton.Button2,
         MessageBoxOptions.DefaultDesktopOnly) == DialogResult.No)
         return;
     picFoto.Image = null;
     tbCadastroPFBO1.Foto = null; ;)
}



Rogério Mauri Smile

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search