/// <summary> /// 获得数据列表 /// </summary> public List <ERM.MDL.Users> GetModelList(string strWhere) { DataSet ds = dal.GetList(strWhere); List <ERM.MDL.Users> modelList = new List <ERM.MDL.Users>(); int rowsCount = ds.Tables[0].Rows.Count; if (rowsCount > 0) { ERM.MDL.Users model; for (int n = 0; n < rowsCount; n++) { model = new ERM.MDL.Users(); model.fullname = ds.Tables[0].Rows[n]["fullname"].ToString(); model.login = ds.Tables[0].Rows[n]["login"].ToString(); model.password = ds.Tables[0].Rows[n]["password"].ToString(); model.phone = ds.Tables[0].Rows[n]["phone"].ToString(); if (ds.Tables[0].Rows[n]["sh"].ToString() != "") { model.sh = int.Parse(ds.Tables[0].Rows[n]["sh"].ToString()); } if (ds.Tables[0].Rows[n]["theme"].ToString() != "") { model.theme = int.Parse(ds.Tables[0].Rows[n]["theme"].ToString()); } model.title = ds.Tables[0].Rows[n]["title"].ToString(); model.units = ds.Tables[0].Rows[n]["units"].ToString(); model.unitstype = ds.Tables[0].Rows[n]["unitstype"].ToString(); if (ds.Tables[0].Rows[n]["userid"].ToString() != "") { model.userid = int.Parse(ds.Tables[0].Rows[n]["userid"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(ERM.MDL.Users model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(ERM.MDL.Users model) { dal.Add(model); }