Пример #1
0
 private PropertyImageCollection InitializeCollection(DataTable dt)
 {
     try
     {
         PropertyImageCollection retVal = null;
         if (dt != null && dt.Columns.Count > 0)
         {
             retVal = new PropertyImageCollection();
             foreach (DataRow row in dt.Rows)
             {
                 PropertyImage obj = InitializeObject(row);
                 retVal.Add(obj);
             }
         }
         return(retVal);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #2
0
 private PropertyImage InitializeObject(DataRow dr)
 {
     try
     {
         PropertyImage retVal = null;
         if (dr != null)
         {
             retVal              = new PropertyImage();
             retVal.Id           = new Guid(dr["Id"].ToString());
             retVal.PRL          = dr["PRL"].ToString();
             retVal.Description  = dr["Description"].ToString();
             retVal.Extension    = dr["Extension"].ToString();
             retVal.Image        = dr["Image"] != null ? (byte[])dr["Image"] : null;
             retVal.IsFirstImage = Convert.ToBoolean(dr["IsFirstImage"]);
         }
         return(retVal);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }