private BM_COMMON DataRowToBean(DataRow row) { BM_COMMON bm=new BM_COMMON(); bm.bg_bm = UtilData.DBObjectToString(row["bg_bm"]); bm.bg_bz = UtilData.DBObjectToString(row["bg_bz"]); bm.bg_id = UtilData.DBObjectToInt(row["bg_id"]); bm.bg_lx = UtilData.DBObjectToString(row["bg_lx"]); bm.bg_lxmc = UtilData.DBObjectToString(row["bg_lxmc"]); bm.bg_mc = UtilData.DBObjectToString(row["bg_mc"]); bm.bg_pysx = UtilData.DBObjectToString(row["bg_pysx"]); return bm; }
public ActionResult UserRoleFp() { ViewData["UserID"] = Request.Params["UserID"]; IList<Role> list; if (!Session["UiLoginId"].ToString().Equals("admin")) { list = iRoleRepository.SearchFor(""); } else { list = iRoleRepository.GetAll(); } IList<BM_COMMON> bmlist=new List<BM_COMMON>(); foreach (var role in list) { BM_COMMON bm=new BM_COMMON(); bm.bg_mc = role.Role_Name; bm.bg_bm = role.Role_Code.ToString(); bmlist.Add(bm); } ViewData["Roles"] = bmlist; return View(); }