标签:
public List<MemmberInfo> GetAllMemmberInfoByDelFlag(int delFlag)
{
string sql = "select MemmberId,MemName,MemMobilePhone,MemAddress,MemType,MemNum,MemGender,MemDiscount,MemMoney,SubTime,MemIntegral,MemEndServerTi me,MemBirthdaty from MemmberInfo where DelFlag=@DelFlag";
DataTable dt = SqliteHelper.ExecuteTable(sql, new SQLiteParameter("@DelFlag", delFlag));
List<MemmberInfo> list = new List<MemmberInfo>();
if (dt.Rows.Count > 0)
{
foreach (DataRow dr in dt.Rows)
{
MemmberInfo mem = RowToMemmberInfo(dr);
list.Add(mem);
}
}
return list;
}
private MemmberInfo RowToMemmberInfo(DataRow dr)
{
MemmberInfo mem = new MemmberInfo();
mem.MemAddress = dr["MemAddress"].ToString();
mem.MemBirthdaty = Convert.ToDateTime(dr["MemBirthdaty"]);
mem.MemDiscount = Convert.ToDecimal(dr["MemDiscount"]);
mem.MemEndServerTime = Convert.ToDateTime(dr["MemEndServerTime"]);
mem.MemGender = dr["MemGender"].ToString();
mem.MemIntegral = Convert.ToInt32(dr["MemIntegral"]);
mem.MemmberId = Convert.ToInt32(dr["MemmberId"]);
mem.MemMobilePhone = dr["MemMobilePhone"].ToString();
mem.MemMoney = Convert.ToDecimal(dr["MemMoney"]);
mem.MemName = dr["MemName"].ToString();
mem.MemNum = dr["MemNum"].ToString();
mem.MemPhone = mem.MemMobilePhone;//小坑 有没有都可以
//mem.MemTpName==坑
mem.MemType = Convert.ToInt32(dr["MemType"]);
mem.SubTime = Convert.ToDateTime(dr["SubTime"]);
return mem;
}
标签:
原文地址:http://www.cnblogs.com/bidianqing/p/4211841.html