public List <DM_DVQLY> DM_DVQLYandLEVER_BYDV(string Ma_dv) { List <DM_DVQLY> dm_dvqly = new List <DM_DVQLY>(); DbDataReader reader = null; DbConnection conn = _DbHelper.CreateConnection(Common.ConnectionString); conn.Open(); try { List <DbParameter> para = new List <DbParameter>(); para.Add(_DbHelper.CreateParameter("MA_DVIQLY", Ma_dv, false)); reader = _DbHelper.ExecuteReader(conn, Common.DatabaseSchema + "[DM_DVQLYandLEVER_BYDV]", para.ToArray()); if (reader.HasRows) { DM_DVQLYDataAccess.SetListDM_DVQLYInfo(ref reader, ref dm_dvqly); } return(dm_dvqly); } catch (Exception ex) { throw new Exception(String.Format(" DM_DVQLYandLEVER_BYDV.SelectAll: {0}", ex.Message)); } finally { if (reader != null) { reader.Close(); } conn.Close(); } }
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(); } }
public List <DM_DVQLY> Select_DVI_Cha_ByChild() { List <DM_DVQLY> dm_dvqly = new List <DM_DVQLY>(); DbDataReader reader = null; DbConnection conn = _DbHelper.CreateConnection(Common.ConnectionString); conn.Open(); try { reader = _DbHelper.ExecuteReader(conn, Common.DatabaseSchema + "[Select_DVI_Cha_ByChild]", (DbParameter[])null); if (reader.HasRows) { DM_DVQLYDataAccess.SetListDM_DVQLYInfo(ref reader, ref dm_dvqly); } return(dm_dvqly); } catch (Exception ex) { throw new Exception(String.Format(" DM_DVQLYDataAccess.SelectAll: {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); } }