public AzDocRelRequestEntity GetAzDocRelRequest(Int32 requestId) { var ent = new AzDocRelRequestEntity(); using (var cmd = eaSql.CreateDbCommandWriter(GET_AZ_DOC_REL_REQUEST, CommandType.StoredProcedure)) { cmd.AddInParam("PI_REQUEST_ID", DbType.Int32, requestId); using (var ds = new DataSet()) { helper.LoadDataSet(cmd, ds, "Results"); DataTable dt = ds.Tables["Results"]; if (dt.Rows.Count > 0) { ent.MapFromRow(dt.Rows[0]); } } } return(ent); }
public List <AzDocRelRequestEntity> GetAllAzDocRelRequest(Int32 docId) { var list = new List <AzDocRelRequestEntity>(); using (var cmd = eaSql.CreateDbCommandWriter(GET_ALL_AZ_DOC_REL_REQUEST, CommandType.StoredProcedure)) { cmd.AddInParam("PI_DOC_ID", DbType.Int32, docId); using (var ds = new DataSet()) { helper.LoadDataSet(cmd, ds, "Results"); DataTable dt = ds.Tables["Results"]; foreach (DataRow dr in dt.Rows) { var item = new AzDocRelRequestEntity(); item.MapFromRow(dr); list.Add(item); } } return(list); } }