/// <summary> /// 获得数据列表 /// </summary> public List <NoName.NetShop.Model.UserModel> GetModelList(string strWhere) { DataSet ds = dal.GetList(strWhere); List <NoName.NetShop.Model.UserModel> modelList = new List <NoName.NetShop.Model.UserModel>(); int rowsCount = ds.Tables[0].Rows.Count; if (rowsCount > 0) { NoName.NetShop.Model.UserModel model; for (int n = 0; n < rowsCount; n++) { model = new NoName.NetShop.Model.UserModel(); if (ds.Tables[0].Rows[n]["UserId"].ToString() != "") { model.UserId = int.Parse(ds.Tables[0].Rows[n]["UserId"].ToString()); } model.UserName = ds.Tables[0].Rows[n]["UserName"].ToString(); model.UserEmail = ds.Tables[0].Rows[n]["UserEmail"].ToString(); model.Password = ds.Tables[0].Rows[n]["Password"].ToString(); if (ds.Tables[0].Rows[n]["LastLoginTime"].ToString() != "") { model.LastLoginTime = DateTime.Parse(ds.Tables[0].Rows[n]["LastLoginTime"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(NoName.NetShop.Model.UserModel model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(NoName.NetShop.Model.UserModel model) { dal.Add(model); }
/// <summary> /// ��������б� /// </summary> public List<NoName.NetShop.Model.UserModel> GetModelList(string strWhere) { DataSet ds = dal.GetList(strWhere); List<NoName.NetShop.Model.UserModel> modelList = new List<NoName.NetShop.Model.UserModel>(); int rowsCount = ds.Tables[0].Rows.Count; if (rowsCount > 0) { NoName.NetShop.Model.UserModel model; for (int n = 0; n < rowsCount; n++) { model = new NoName.NetShop.Model.UserModel(); if(ds.Tables[0].Rows[n]["UserId"].ToString()!="") { model.UserId=int.Parse(ds.Tables[0].Rows[n]["UserId"].ToString()); } model.UserName=ds.Tables[0].Rows[n]["UserName"].ToString(); model.UserEmail=ds.Tables[0].Rows[n]["UserEmail"].ToString(); model.Password=ds.Tables[0].Rows[n]["Password"].ToString(); if(ds.Tables[0].Rows[n]["LastLoginTime"].ToString()!="") { model.LastLoginTime=DateTime.Parse(ds.Tables[0].Rows[n]["LastLoginTime"].ToString()); } modelList.Add(model); } } return modelList; }