/// <summary> /// 获得数据列表 /// </summary> public List <Maticsoft.Model.CMS_AdminUser> DataTableToList(DataTable dt) { List <Maticsoft.Model.CMS_AdminUser> modelList = new List <Maticsoft.Model.CMS_AdminUser>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Maticsoft.Model.CMS_AdminUser model; for (int n = 0; n < rowsCount; n++) { model = new Maticsoft.Model.CMS_AdminUser(); if (dt.Rows[n]["Id"].ToString() != "") { model.Id = int.Parse(dt.Rows[n]["Id"].ToString()); } model.Name = dt.Rows[n]["Name"].ToString(); model.Pwd = dt.Rows[n]["Pwd"].ToString(); if (dt.Rows[n]["RoleId"].ToString() != "") { model.RoleId = int.Parse(dt.Rows[n]["RoleId"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Maticsoft.Model.CMS_AdminUser model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Maticsoft.Model.CMS_AdminUser model) { return(dal.Add(model)); }