/// <summary> /// 得到列表 /// </summary> /// <param name="ent"></param> /// <returns></returns> public List <BuRepairing> GetBuRepairingList(string Where) { List <BuRepairing> list = new List <BuRepairing>(); using (DbDataReader reader = DataBaseManage.ExecuteReader(DalSql + Where)) { while (reader.Read()) { BuRepairing ent = new BuRepairing(); SetEnt(ent, reader); list.Add(ent); } } return(list); }
/// <summary> /// 根据RepairingId得到 BuRepairing 实体 /// </summary> /// <param name="ent"></param> /// <returns></returns> public BuRepairing GetBuRepairing(int RepairingId) { BuRepairing ent = null; string sql = DalSql; sql = sql + " And RepairingId"; MySqlParameter[] paras = new MySqlParameter[] { new MySqlParameter("RepairingId", RepairingId) }; using (DbDataReader reader = DataBaseManage.ExecuteReader(sql, paras)) { if (reader.Read()) { ent = new BuRepairing(); SetEnt(ent, reader); } } return(ent); }
public void SetEnt(BuRepairing ent, IDataReader dr) { ent.RepairingId = MyConvert.ToInt(dr["RepairingId"]); ent.RepairingName = MyConvert.ToString(dr["RepairingName"]); ent.RepairingDate = MyConvert.ToString(dr["RepairingDate"]); }