public string Chenmo(int bbsMainID, int userID, string userName, byte chenmoType) { BBSMain model = Get(bbsMainID); if (model == null) return "该帖不存在。"; model.Attach(); model.ChenmoType = chenmoType; //if (chenmoType==2) // model.OptionLog += "<br />" + "被 " + userName + " 沉默 " + DateTime.Now; //if (chenmoType == 0) // model.OptionLog += "<br />" + "被 " + userName + " 取消沉默 " + DateTime.Now; model.Detach(); Update(model); bizBBSMainLog bml = new bizBBSMainLog(); if (chenmoType == 2) bml.Add(bbsMainID, userID, "该帖子被管理员沉默"); if (chenmoType == 0) bml.Add(bbsMainID, userID, "该帖子被管理员取消沉默"); return "设置成功。"; }
public ActionResult SetTop(int id, FormCollection f) { if (!UserCommon.CheckBBSAdminRight(AdminType)) return Content("����Ȩִ�д˲���"); bizBBSMainLog bml = new bizBBSMainLog(); bizBBSMainOfBall b = new bizBBSMainOfBall(); BBSMainOfBall model = b.Get(id); if (model != null) return Content("�������Ѿ���������"); BBSMainOfBall bModel = new BBSMainOfBall(); bModel.BBSMainID = id; bModel.UserID = UserID; bModel.BallType = 2; bModel.TopType = byte.Parse(f["topType"].ToString()); bModel.AddTime = DateTime.Now; bModel.EndTime = DateTime.Now.AddMonths(1); b.Add(bModel); bml.Add(id, UserID, "�������ö�"); return Content("�ö��ɹ�"); }