public ActionResult SetScore(int id,FormCollection f) { int userID = UserID; bizBBSMain b = new bizBBSMain(); BBSMain model = b.Get(id); int cha; if (model == null) return Redirect("/Home/AlertPage.html"); if (!UserCommon.CheckBBSAdminRight(AdminType)) return Redirect("/Home/AlertPage.html"); bizUserScoreLog bu = new bizUserScoreLog(); UserScoreLog modelUS = bu.Get(id, userID); List<UserScoreLog> listUS = bu.List(id); if (modelUS == null) { if (int.Parse(f["score"])!=0) bu.Add(id, userID, UserName, int.Parse(f["score"]), f["remark"].Trim()); } else { b.UserScoreCancel(id, userID); } TempData["Msg"]="�������óɹ�"; return RedirectToAction("SetScore",new {id=id}); }
//public ActionResult Move(int id) //{ // bizBBSMain b = new bizBBSMain(); // BBSMain model = b.Get(id); // if (model == null) // return Redirect("/Home/AlertPage.html"); // if (!UserCommon.CheckBBSAdminRight(AdminType)) // return Redirect("/Home/AlertPage.html"); // bizBBSTypes btypes = new bizBBSTypes(); // List<BBSTypes> listType = btypes.ListByMainID(model.TypeMainID); // ViewData["typeMain"] = model.TypeMainID; // ViewData["typeDe"] = model.TypeDeID; // ViewData["ListType"] = listType; // return View(model); //} //[AcceptVerbs(HttpVerbs.Post)] //public ActionResult Move(int id, FormCollection f) //{ // bizBBSMain b = new bizBBSMain(); // BBSMain model = b.Get(id); // if (model == null) // return Redirect("/Home/AlertPage.html"); // if (!UserCommon.CheckBBSAdminRight(AdminType)) // return Redirect("/Home/AlertPage.html"); // model.Attach(); // model.TypeDeID = int.Parse(f["typeDeID"]); // model.Detach(); // b.Update(model); // TempData["Msg"] = "ת�Ƴɹ�"; // return RedirectToAction("Move", new { id = id }); //} public ActionResult SetScore(int id) { bizBBSMain b = new bizBBSMain(); bizUserScoreLog bu = new bizUserScoreLog(); BBSMain model = b.Get(id); if (model == null) return Redirect("/Home/AlertPage.html"); if (!UserCommon.CheckBBSAdminRight(AdminType)) return Redirect("/Home/AlertPage.html"); UserScoreLog modelUS = bu.Get(id, UserID); List<UserScoreLog> listUS = bu.List(id); if (listUS.Sum(x => x.Score) >= 20) { TempData["Msg"] = "�����������Ļ����Ѿ�����20���������á�"; } ViewData["modelUS"] = modelUS; return View(model); }