public void FactionCheckUpUnPass(int id) { bizFaction bf = new bizFaction(); bizUsers bu = new bizUsers(); bizUserMsg bm = new bizUserMsg(); Faction model = bf.Get(id); Users modelUser = bu.Get(model.BuildUserID); bm.AddSysMsg(model.BuildUserID, "你提交的部落: [b]" + model.FName + "[/b] 的申请[color=red]没有通过审核[/color]。"); bf.Delete(id); }
public string UsersJinbiDeal(string userName,string users, int factionID, int jinbi) { if (users == null) return "你没有选择用户"; if (jinbi <= 0) return "派发的吧币不能为空或者负数"; string[] userArray = users.Split(','); dalUsers du = new dalUsers(); dalFaction df = new dalFaction(); dalFactionLog dfl = new dalFactionLog(); bizUserMsg bum = new bizUserMsg(); Faction model = df.Get(factionID); if (model.FJinbi < userArray.Length * jinbi) { return "部落基金池没这么多基金(" + userArray.Length * jinbi + ")可以派发"; } foreach (var item in userArray) { Users modelUser = du.Get(int.Parse(item)); if (modelUser.FactionID == factionID) { modelUser.Attach(); modelUser.Jinbi = modelUser.Jinbi + jinbi; modelUser.Detach(); du.Update(modelUser); } dfl.Add(factionID, userName + " 从部落基金中派发了" + jinbi + "吧币给了 " + modelUser.UserName); bum.AddSysMsg(int.Parse(item), userName + " 从部落基金中派发了" + jinbi + "吧币给了你"); } bizFaction bf = new bizFaction(); Faction modelF = bf.Get(factionID); modelF.Attach(); modelF.FJinbi = modelF.FJinbi - userArray.Length * jinbi; modelF.Detach(); bf.Update(modelF); return ""; }
public void Deal(int userReportID,int adminID,string adminName,string re,byte jiangliType) { bool giveJiangli = false ; bizUsers bu = new bizUsers(); bizUserMsg bum = new bizUserMsg(); UserReports model = Get(userReportID); Users modelUser = bu.Get(model.UserID); model.Attach(); model.AdminID = adminID; model.AdminName = adminName; model.AdminRe = re; if (model.JiangliType == 0) { giveJiangli = true; model.JiangliType = jiangliType; } model.ReTime = DateTime.Now; model.Detach(); Update(model); if (giveJiangli == true) { if (model.JiangliType == 1) { modelUser.Attach(); modelUser.Jinbi += 200; modelUser.Detach(); bu.Update(modelUser); bum.AddSysMsg(model.UserID, "因为你的举报,系统奖励了你200吧币。"); } if (model.JiangliType == 2) { bizUserXCard buc = new bizUserXCard(); buc.AddCard(model.UserID, "bigqiqiu", 1); bum.AddSysMsg(model.UserID, "因为你的举报,系统奖励了你1张强化气球卡。"); } } }
public ActionResult DeleteOneMessage(int id) { int count; bizUserMsg um = new bizUserMsg(); List<UserMsgDetail> list = um.ListDetail(UserID, 0, 0, 50, out count); um.DeleteOneMessage(UserID, id); int index = 0; for (int i = 0; i < list.Count; i++) { if (list[i].UserMsgID == id) { index = i; break; } } int msgID=0; if (list.Count > (index + 1)) msgID = list[index + 1].UserMsgID; else if (index > 1) msgID = list[index - 1].UserMsgID; else msgID = 0; return Redirect("/bbsbar/UserMsg/" + msgID + ".html"); }
public ActionResult UserMsg(int id) { int count; UserMsgDetail model; bizUserMsg um = new bizUserMsg(); List<UserMsgDetail> list = um.ListDetail(UserID, 0, 0, 50, out count); if (list.Count == 0) { model = null; ViewData["prevID"] = 0; ViewData["nextID"] = 0; return View(model); } if(list.Count==1) { model = list[0]; ViewData["prevID"] = 0; ViewData["nextID"] = 0; UserMsg modelMsg = um.Get(model.UserMsgID); modelMsg.Attach(); modelMsg.Status = 1; modelMsg.Detach(); um.Update(modelMsg); return View(model); } if (id == list[0].UserMsgID) id = 0; if (id == 0) { model = list[0]; ViewData["prevID"] = 0; ViewData["nextID"] = list[1].UserMsgID; } else { int index=0; for (int i = 0; i < list.Count; i++) { if (list[i].UserMsgID == id) { index = i; break; } } model = list[index]; ViewData["prevID"] = list[index-1].UserMsgID; if ((index+1) == list.Count) ViewData["nextID"] = 0; else ViewData["nextID"] = list[index + 1].UserMsgID; } if (model != null && model.Status == 0) { UserMsg modelMsg = um.Get(model.UserMsgID); modelMsg.Attach(); modelMsg.Status = 1; modelMsg.Detach(); um.Update(modelMsg); } return View(model); }
public ActionResult SendMessage(FormCollection f) { bizUserFriend bf = new bizUserFriend(); List<UserFriendDetail> list = bf.ListByUser(UserID); bizUsers b = new bizUsers(); Users model = b.Get(f["UserName"].Trim()); if (model == null) { TempData["Msg"] = "���û�������"; TempData["UserName"] = f["UserName"].Trim(); return RedirectToAction("SendMessage"); } if (model.UserID == 1000) { TempData["Msg"] = "���ܸ�ϵͳ������Ϣ"; TempData["UserName"] = f["UserName"].Trim(); return RedirectToAction("SendMessage"); } bizUserMsg bum = new bizUserMsg(); bizPopUp bp = new bizPopUp(); PopUp modelP = new PopUp(); modelP.Title = "ϵͳ��ʾ"; modelP.Types = 2; modelP.Content = "�û���" + UserName + "�����㷢��һ�������"; modelP.UserID = model.UserID; modelP.AddUser = 1000; modelP.URL = "/user/selfMessage/0-1.html"; modelP.Target = "_blank"; modelP.StartTime = DateTime.Now; modelP.EndTime = DateTime.Now.AddDays(1); modelP.Status = 0; bum.Add(UserID, model.UserID, CommonCache.FilterTextReplace(f["Content"])); bp.Add(modelP); TempData["Msg"] = "���ŷ��ͳɹ�"; return RedirectToAction("SendMessage"); }
public ActionResult SelfMessage(int showType, int pageNo) { ViewData["CurrMenu"] = "���Ź���"; int count; bizUserMsg um = new bizUserMsg(); List<UserMsgDetail> list = um.ListDetail(UserID, showType, pageNo - 1, 5, out count); um.UpdateUnRead(UserID); ViewData["MsgBar"] = bbs.GetUserMsgBarHtml2(showType); //ViewData["UserName"] = UserName; ViewData["PageList"] = bbs.GetUserMsgPageList("/User/SelfMessage/" + showType, count, pageNo, 5); return View(list); }
public ActionResult DeleteOneMessage(int id) { bizUserMsg um = new bizUserMsg(); um.DeleteOneMessage(UserID, id); return Redirect("/User/SelfMessage/0-1.html"); }