/// <summary> /// 获得数据列表 /// </summary> public List <Dianda.Model.USER_Role> DataTableToList(DataTable dt) { List <Dianda.Model.USER_Role> modelList = new List <Dianda.Model.USER_Role>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Dianda.Model.USER_Role model; for (int n = 0; n < rowsCount; n++) { model = new Dianda.Model.USER_Role(); if (dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } model.NAME = dt.Rows[n]["NAME"].ToString(); model.Roles = dt.Rows[n]["Roles"].ToString(); model.Types = dt.Rows[n]["Types"].ToString(); if (dt.Rows[n]["UpID"].ToString() != "") { model.UpID = int.Parse(dt.Rows[n]["UpID"].ToString()); } if (dt.Rows[n]["DELFLAG"].ToString() != "") { model.DELFLAG = int.Parse(dt.Rows[n]["DELFLAG"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Dianda.Model.USER_Role model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Dianda.Model.USER_Role model) { return(dal.Add(model)); }