public ActionResult FAdminDeUsers(int id) { if ((new bizFactionDe()).GetByIsAdmin(id) != FactionDeID && UserCommon.CheckBBSHighAdminRight(AdminType) == false) return RedirectToAction("FAdminAlert", new { id = id }); int deID = int.Parse(Request.QueryString["deid"].ToString()); bizFaction bf=new bizFaction(); bizFactionDe bfd = new bizFactionDe(); bizUsers bu = new bizUsers(); Faction model = bf.Get(id); FactionDe modelDe = bfd.Get(deID); List<FactionDe> listDe = bfd.ListByID(id); List<Users> listUser = bu.ListByFaction(id, deID); ViewData["ID"] = id; ViewData["Faction"] = model; ViewData["FactionDe"] = modelDe; ViewData["listDe"] = listDe; return View(listUser); }
public ActionResult FAdminDeMod(int id) { if ((new bizFactionDe()).GetByIsAdmin(id) != FactionDeID && UserCommon.CheckBBSHighAdminRight(AdminType) == false) return RedirectToAction("FAdminAlert", new { id = id }); int deID = int.Parse(Request.QueryString["deID"].ToString()); bizFaction bf = new bizFaction(); bizFactionDe bfd = new bizFactionDe(); FactionDe modelDe = bfd.Get(id, deID); ViewData["ID"] = id; return View(modelDe); }
public ActionResult FAdminDeMod(int id, FormCollection f) { if ((new bizFactionDe()).GetByIsAdmin(id) != FactionDeID && UserCommon.CheckBBSHighAdminRight(AdminType) == false) return RedirectToAction("FAdminAlert", new { id = id }); if (int.Parse(f["Orders"].Trim()) < 1 || int.Parse(f["Orders"].Trim()) > 99) { TempData["Msg"] = "���Ӧ��1-99֮��"; } int deID = int.Parse(Request.QueryString["deID"].ToString()); bizFaction bf = new bizFaction(); bizFactionDe bfd = new bizFactionDe(); FactionDe modelDe = bfd.Get(id, deID); modelDe.Attach(); modelDe.FTitle = f["FTitle"].Trim(); if(modelDe.IsAdmin==0&&modelDe.IsDefault==0) modelDe.Orders = int.Parse(f["Orders"].Trim()); modelDe.Detach(); bfd.Update(modelDe); MyCache.BBSCache.ListFactionDeReLoad(); return Redirect("/Factions/FAdminDe/"+ id +".html?deID="+deID); }
public ActionResult FAdminDeDelete(int id) { if ((new bizFactionDe()).GetByIsAdmin(id) != FactionDeID && UserCommon.CheckBBSHighAdminRight(AdminType) == false) return RedirectToAction("FAdminAlert", new { id = id }); int deID = int.Parse(Request.QueryString["deid"].ToString()); bizFactionDe bfd = new bizFactionDe(); bizUsers bu = new bizUsers(); FactionDe model = bfd.Get(deID); if (model.IsAdmin == 1 || model.IsDefault == 1) { TempData["Msg"] = "�÷�Ų���ɾ��"; return Redirect("/Factions/FAdminDe/" + id + ".html"); } if (bu.ListByFaction(id, deID).Count >0) { TempData["Msg"] = "�÷�����г�Ա������ɾ��"; return Redirect("/Factions/FAdminDe/" + id + ".html"); } bfd.DeleteByDeID(deID, id); MyCache.BBSCache.ListFactionDeReLoad(); return Redirect("/Factions/FAdminDe/" + id + ".html"); }