/// <summary> /// 获得数据列表 /// </summary> public List <Garfield.Model.Sys_authority> DataTableToList(DataTable dt) { List <Garfield.Model.Sys_authority> modelList = new List <Garfield.Model.Sys_authority>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Garfield.Model.Sys_authority model; for (int n = 0; n < rowsCount; n++) { model = new Garfield.Model.Sys_authority(); if (dt.Rows[n]["Role_id"] != null && dt.Rows[n]["Role_id"].ToString() != "") { model.Role_id = int.Parse(dt.Rows[n]["Role_id"].ToString()); } if (dt.Rows[n]["App_ids"] != null && dt.Rows[n]["App_ids"].ToString() != "") { model.App_ids = dt.Rows[n]["App_ids"].ToString(); } if (dt.Rows[n]["Menu_ids"] != null && dt.Rows[n]["Menu_ids"].ToString() != "") { model.Menu_ids = dt.Rows[n]["Menu_ids"].ToString(); } if (dt.Rows[n]["Button_ids"] != null && dt.Rows[n]["Button_ids"].ToString() != "") { model.Button_ids = dt.Rows[n]["Button_ids"].ToString(); } if (dt.Rows[n]["Create_id"] != null && dt.Rows[n]["Create_id"].ToString() != "") { model.Create_id = int.Parse(dt.Rows[n]["Create_id"].ToString()); } if (dt.Rows[n]["Create_date"] != null && dt.Rows[n]["Create_date"].ToString() != "") { model.Create_date = DateTime.Parse(dt.Rows[n]["Create_date"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Garfield.Model.Sys_authority model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(Garfield.Model.Sys_authority model) { dal.Add(model); }