public List <rightModel> RightSelectBy(rightModel rm) { List <right> list = SelectBy(e => e.right_id.Equals(rm.right_id)); List <rightModel> list2 = new List <rightModel>(); foreach (var item in list) { rightModel cm = new rightModel() { right_id = item.right_id, right_name = item.right_name, right_usable = item.right_usable, right_explain = item.right_explain }; list2.Add(cm); } return(list2); }
public List <rightModel> RightSelect() { List <right> list = SelectAll(); List <rightModel> list2 = new List <rightModel>(); foreach (right item in list) { rightModel cm = new rightModel() { right_id = item.right_id, right_name = item.right_name, right_usable = item.right_usable, right_explain = item.right_explain }; list2.Add(cm); } return(list2); }
public ActionResult Create(rightModel rm) { string sfs = Request["sysRole"]; if (sfs == "false") { rm.right_usable = "否"; } else if (sfs == "true") { rm.right_usable = "是"; } rightModel rgh = new rightModel() { right_id = rm.right_id, right_name = rm.right_name, right_explain = rm.right_explain, right_usable = rm.right_usable }; if (ModelState.IsValid) { int result = ifr.Add(rgh); if (result > 0) { return(Content("<script>alert('新增成功');window.location.href='/Right_list/index'</script>")); } else { return(View()); } } else { return(View()); } }
public ActionResult Edit() { //if (ifr.Update(rm) > 0) //{ // return Content("<script>alert('修改成功');window.location.href='/Right_list/index'</script>"); //} //else //{ // return Content("<script>alert('修改失败');window.location.href='/Right_list/index'</script>"); //} string Rolemanager = Request["RoleManager"]; Dictionary <string, object> di = JsonConvert.DeserializeObject <Dictionary <string, object> >(Rolemanager); rightModel mm = new rightModel() { right_id = int.Parse(di["right_id"].ToString()), right_name = di["right_name"].ToString(), right_explain = di["right_explain"].ToString(), right_usable = di["right_usable"].ToString() }; int i = ifr.Update(mm); return(Content(JsonConvert.SerializeObject(i))); }
public int Update(rightModel rm) { return(ifr.Update(rm)); }
public List <rightModel> RightSelectBy(rightModel rm) { return(ifr.RightSelectBy(rm)); }
public int Del(rightModel rm) { return(ifr.Del(rm)); }
public int Add(rightModel rm) { return(ifr.Add(rm)); }