/// <summary> /// 获得数据列表 /// </summary> public List <Sys.Model.AdminRole> DataTableToList(DataTable dt) { List <Sys.Model.AdminRole> modelList = new List <Sys.Model.AdminRole>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Sys.Model.AdminRole model; for (int n = 0; n < rowsCount; n++) { model = new Sys.Model.AdminRole(); if (dt.Rows[n]["RoleID"].ToString() != "") { model.RoleID = int.Parse(dt.Rows[n]["RoleID"].ToString()); } model.RoleName = dt.Rows[n]["RoleName"].ToString(); model.RoleFlag = dt.Rows[n]["RoleFlag"].ToString(); if (dt.Rows[n]["AdminNum"].ToString() != "") { model.AdminNum = int.Parse(dt.Rows[n]["AdminNum"].ToString()); } if (dt.Rows[n]["OrderID"].ToString() != "") { model.OrderID = int.Parse(dt.Rows[n]["OrderID"].ToString()); } model.Note = dt.Rows[n]["Note"].ToString(); if (dt.Rows[n]["CreateTime"].ToString() != "") { model.CreateTime = DateTime.Parse(dt.Rows[n]["CreateTime"].ToString()); } if (dt.Rows[n]["UpdateTime"].ToString() != "") { model.UpdateTime = DateTime.Parse(dt.Rows[n]["UpdateTime"].ToString()); } modelList.Add(model); } } return(modelList); }
private void Edit() { ModelRole = BllSysRole.GetModel(RoleId); }
/// <summary> /// 更新一条数据 /// </summary> public int Update(Sys.Model.AdminRole model) { return(dal.Update(model)); }
/// <summary> /// 更新一条数据 /// </summary> public int UpdateRoleFlagForSiteFlag(Sys.Model.AdminRole model) { return(dal.UpdateRoleFlagForSiteFlag(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Sys.Model.AdminRole model) { return(dal.Add(model)); }