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
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