//关系转对象 private MemmberType RowToMemmberType(DataRow item) { MemmberType mem = new MemmberType(); mem.MemTpName = item["MemTpName"].ToString(); mem.MemType = Convert.ToInt32(item["MemType"]); return(mem); }
private MemmberType RowToMemmberType(DataRow dr) { MemmberType memtp = new MemmberType(); memtp.MemTpName = dr["MemTpName"].ToString(); memtp.MemType = Convert.ToInt32(dr["MemType"]); return(memtp); }
private MemmberType RowToMemmberType(DataRow dr) { MemmberType mt = new MemmberType(); mt.MemTpDesc = dr["MemTpDesc"].ToString(); mt.MemTpName = dr["MemTpName"].ToString(); mt.MemType = Convert.ToInt32(dr["MemType"]); mt.SubBy = Convert.ToInt32(dr["SubBy"]); return(mt); }
/// <summary> /// 查询所有没有被删除的会员类型 /// </summary> /// <returns>会员类型集合</returns> public List <MemmberType> GetAllMemmberTypeByDelFlag() { string sql = "select MemType,MemTpName from MemmberType where DelFlag=0"; DataTable dt = SqliteHelper.ExecuteTable(sql); List <MemmberType> list = new List <MemmberType>(); if (dt.Rows.Count > 0) { foreach (DataRow item in dt.Rows) { MemmberType memtp = RowToMemmberType(item); list.Add(memtp); } } return(list); }
/// <summary> /// 查询所有会员等级 /// </summary> /// <param name="delFlag"></param>会员等级 /// <returns>会员等级所有集合</returns> public List <MemmberType> GetAllMemmberTypeByDelflag(int delFlag) { string sql = "select MemType,MemTpName from MemmberType where delFlag=" + delFlag; DataTable dt = Sqlitehelper.ExecuteTable(sql); List <MemmberType> list = new List <MemmberType>(); MemmberType memtp = new MemmberType(); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { memtp = RowToMemmberType(dr); list.Add(memtp); } } return(list); }
/// <summary> /// 查询会员级别 /// </summary> /// <param name="delFlag">删除标识</param> /// <returns>级别对象集合</returns> public List <MemmberType> GetAllMemmberTypeByDelFlag(int delFlag) { string sql = "select MemType,MemTpName from MemmberType where DelFlag=@DelFlag"; SQLiteDataReader reader = SqliteHelper.ExecuteReader(sql, new SQLiteParameter("@DelFlag", delFlag)); List <MemmberType> list = new List <MemmberType>(); if (reader.HasRows) { while (reader.Read()) { MemmberType mt = new MemmberType(); mt.MemTpName = reader["MemTpName"].ToString(); mt.MemType = Convert.ToInt32(reader["MemType"]); list.Add(mt); } } return(list); }