public static List<Upload> List(FiltroUpload f, out int RecordCount) { List<Upload> resultList = new List<Upload>(); try { UploaDS dataservice = new UploaDS(); DataSet ds = dataservice.List(f, out RecordCount); if (ds.Tables.Count > 0) foreach (DataRow r in ds.Tables[0].Rows) { Upload a = new Upload(); ORM(a, r); resultList.Add(a); } } catch (Exception ex) { throw ex; } return resultList; }
public static Upload GetById(int id) { Upload Result = null; try { UploaDS DS = new UploaDS(); String objectHash = Guid.NewGuid().ToString(); DataRow dr = DS.GetObjectById(id, objectHash); if (dr != null) { Result = new Upload(); ORM(Result, dr); } } catch (Exception ex) { throw ex; } return Result; }