public M_Arrive SelReturnModel(int ID) { using (SqlDataReader reader = Sql.SelReturnReader(TbName, PK, ID)) { if (reader.Read()) { return(initMod.GetModelFromReader(reader)); } else { return(null); } } }
public static M_Arrive AV_SelModel(string avNo) { M_Arrive model = new M_Arrive(); SqlParameter[] sp = new SqlParameter[] { new SqlParameter("arriveNo", avNo) }; using (SqlDataReader sqlDataReader = Sql.SelReturnReader(model.TbName, " Where ArriveNo=@arriveNo", sp)) { if (sqlDataReader.Read()) { return(model.GetModelFromReader(sqlDataReader)); } return(null); } }