public DM_DVQLY DM_DVQLY_SelectAll_byMaDVi(string Ma_DVi) { DM_DVQLY dm_dvqly = new DM_DVQLY(); DbDataReader reader = null; DbConnection conn = _DbHelper.CreateConnection(Common.ConnectionString); conn.Open(); try { List <DbParameter> para = new List <DbParameter>(); para.Add(_DbHelper.CreateParameter(FIELD_MA_DVIQLY, Ma_DVi, false)); reader = _DbHelper.ExecuteReader(conn, Common.DatabaseSchema + "[DM_DVQLY_SelectAll_byMaDVi]", para.ToArray()); if (reader.HasRows && reader.Read()) { DM_DVQLYDataAccess.SetDM_DVQLYInfo(reader, ref dm_dvqly); } return(dm_dvqly); } catch (Exception ex) { throw new Exception(String.Format("DM_DVQLYDataAccess.DM_DVQLY_SelectAll_byMaDVi: {0}", ex.Message)); } finally { if (reader != null) { reader.Close(); } conn.Close(); } }
private static void SetBindingListDM_DVQLYInfo(ref DbDataReader reader, ref BindingList <DM_DVQLY> dm_dvqlys) { DM_DVQLY dm_dvqly = null; while (reader.Read()) { dm_dvqly = new DM_DVQLY(); DM_DVQLYDataAccess.SetDM_DVQLYInfo(reader, ref dm_dvqly); dm_dvqlys.Add(dm_dvqly); } }