public bool Ban(int id, int moderatorId, ModeratorReason reason, string reasonText)
        {
            var comm = GetCommand("SPUsersBan");
            comm.AddParameter<int>(this.Factory, "UserId", id);
            comm.AddParameter<int>(this.Factory, "ModeratorUserId", id);
            comm.AddParameter<ModeratorReason>(this.Factory, "ModeratorReason", reason);
            comm.AddParameter<string>(this.Factory, "ModeratorReasonFull", reasonText);

            return comm.SafeExecuteNonQuery() > 0;
        }
        public bool Suspend(int id, int moderatorId, ModeratorReason reason, string reasonText, DateTime endDate)
        {
            var comm = GetCommand("SPUsersSuspend");
            comm.AddParameter<int>(this.Factory, "UserId", id);
            comm.AddParameter<int>(this.Factory, "ModeratorUserId", id);
            comm.AddParameter<ModeratorReason>(this.Factory, "ModeratorReason", reason);
            comm.AddParameter<string>(this.Factory, "ModeratorReasonFull", reasonText);
            comm.AddParameter<DateTime>(this.Factory, "SuspendedEnd", endDate);

            return comm.SafeExecuteNonQuery() > 0;
        }
Пример #3
0
 public bool Warn(int id, int moderatorId, UserRole moderatorRole, ModeratorReason reason, string reasonText)
 {
     CheckCanManage(id, moderatorId, moderatorRole);
     return _dataAccess.Warn(id, moderatorId, reason, reasonText);
 }
Пример #4
0
 public bool Suspend(int id, int moderatorId, UserRole moderatorRole, ModeratorReason reason, string reasonText, DateTime endDate)
 {
     CheckCanManage(id, moderatorId, moderatorRole);
     return _dataAccess.Suspend(id, moderatorId, reason, reasonText, endDate);
 }
 public ActionResult Ban(int id, ModeratorReason reason, string reasonText)
 {
     //Include the result of banning in the viewdata for tracking (testing)
     ViewData.Model = _service.Ban(id, User.Id, User.Role, reason, reasonText);
     return Json(null);
 }
 public ActionResult Warn(int id, ModeratorReason reason, string reasonText)
 {
     ViewData.Model = _service.Warn(id, User.Id, User.Role, reason, reasonText);
     return Json(ViewData.Model);
 }
 public ActionResult Suspend(int id, ModeratorReason reason, string reasonText)
 {
     ViewData.Model = _service.Suspend(id, User.Id, User.Role, reason, reasonText, DateTime.UtcNow.AddDays(15));
     return Json(ViewData.Model);
 }