public List<VIPCardKeyOR> selectAllVipCard() { string sql = "select * from t_VIPCardKey"; DataTable dt = null; try { dt = dbMySql.ExecuteQuery(sql); } catch (Exception ex) { throw ex; } if (dt == null) { return null; } List<VIPCardKeyOR> listBuss = new List<VIPCardKeyOR>(); foreach (DataRow dr in dt.Rows) { VIPCardKeyOR obj = new VIPCardKeyOR(dr); listBuss.Add(obj); } return listBuss; }
public List<VIPCardKeyOR> selectVIPCardKeyData(string orgbhWhere) { if (string.IsNullOrEmpty(orgbhWhere)) return null; string sql = @"select bu.* from t_VIPCardKey bu inner join t_Bank b on b.orgbh= bu.orgbh where " + orgbhWhere; DataTable dt = null; try { dt = dbMsSql.ExecuteQuery(sql); } catch (Exception ex) { throw ex; } if (dt == null) return null; List<VIPCardKeyOR> listVIPC = new List<VIPCardKeyOR>(); foreach (DataRow dr in dt.Rows) { VIPCardKeyOR obj = new VIPCardKeyOR(dr); listVIPC.Add(obj); } return listVIPC; }
/// <summary> /// 获取插入数据 /// </summary> public string GetInsertSql(VIPCardKeyOR vIPCardKey) { string sql = @"insert into t_VIPCardKey (ID,VIPCardKey,VipCardType,Description,orgbh) values ('@ID','@VIPCardKey','@VipCardType','@Description','@orgbh')"; sql = sql.Replace("@ID", vIPCardKey.Id); // sql = sql.Replace("@VIPCardKey", vIPCardKey.Vipcardkey); //VIP卡识别码 sql = sql.Replace("@VipCardType", vIPCardKey.Vipcardtype); //VIP卡类型 sql = sql.Replace("@Description", vIPCardKey.Description); //描述 sql = sql.Replace("@orgbh", vIPCardKey.Orgbh); //所属机构 return sql; }