public JsonResult DelException(string ids) { if (string.IsNullOrWhiteSpace(ids)) { WorkContext.AjaxStringEntity.msgbox = "缺少参数"; return(Json(WorkContext.AjaxStringEntity)); } BLL.BaseBLL <Entity.SysLogException> bll = new BLL.BaseBLL <Entity.SysLogException>(); if ("all".Equals(ids.ToLower())) { bll.DelBy(new List <BLL.FilterSearch>()); AddAdminLogs(Entity.SysLogMethodType.Delete, "清空异常日志"); } else { int id = TypeHelper.ObjectToInt(ids); List <BLL.FilterSearch> filters = new List <BLL.FilterSearch>(); filters.Add(new BLL.FilterSearch("ID", id.ToString(), BLL.FilterSearchContract.等于)); bll.DelBy(filters); AddAdminLogs(Entity.SysLogMethodType.Delete, "删除异常日志:" + id.ToString()); } WorkContext.AjaxStringEntity.msg = 1; WorkContext.AjaxStringEntity.msgbox = "success"; return(Json(WorkContext.AjaxStringEntity)); }
public JsonResult Del(string ids) { int id = TypeHelper.ObjectToInt(ids); if (id <= 0) { WorkContext.AjaxStringEntity.msgbox = "非法参数"; return(Json(WorkContext.AjaxStringEntity)); } string str = BLL.BLLCusCategory.GetChildIDStr(TypeHelper.ObjectToInt(ids)); if (string.IsNullOrWhiteSpace(str)) { WorkContext.AjaxStringEntity.msgbox = "找不到相关数据"; return(Json(WorkContext.AjaxStringEntity)); } BLL.BaseBLL <Entity.CusCategory> bll = new BLL.BaseBLL <Entity.CusCategory>(); var id_list = Array.ConvertAll <string, int>(str.Split(','), int.Parse); bll.DelBy(p => id_list.Contains(p.ID)); AddAdminLogs(Entity.SysLogMethodType.Delete, "删除分类:" + str); WorkContext.AjaxStringEntity.msg = 1; WorkContext.AjaxStringEntity.msgbox = "success"; return(Json(WorkContext.AjaxStringEntity)); }
public JsonResult DelApiAction(string ids) { if (string.IsNullOrWhiteSpace(ids)) { WorkContext.AjaxStringEntity.msgbox = "缺少参数"; return(Json(WorkContext.AjaxStringEntity)); } BLL.BaseBLL <Entity.SysLogApiAction> bll = new BLL.BaseBLL <Entity.SysLogApiAction>(); var id_list = Array.ConvertAll <string, int>(ids.Split(','), int.Parse); bll.DelBy(p => id_list.Contains(p.ID)); WorkContext.AjaxStringEntity.msg = 1; WorkContext.AjaxStringEntity.msgbox = "success"; return(Json(WorkContext.AjaxStringEntity)); }
public JsonResult Del(string ids) { if (string.IsNullOrWhiteSpace(ids)) { WorkContext.AjaxStringEntity.msgbox = "缺少参数"; return(Json(WorkContext.AjaxStringEntity)); } BLL.BaseBLL <Entity.Demo> bll = new BLL.BaseBLL <Entity.Demo>(); var id_list = Array.ConvertAll <string, int>(ids.Split(','), int.Parse); bll.DelBy(p => id_list.Contains(p.ID)); AddAdminLogs(Entity.SysLogMethodType.Delete, "删除Demo:" + ids); WorkContext.AjaxStringEntity.msg = 1; WorkContext.AjaxStringEntity.msgbox = "success"; return(Json(WorkContext.AjaxStringEntity)); }
public JsonResult Del(string ids) { if (string.IsNullOrWhiteSpace(ids)) { WorkContext.AjaxStringEntity.msgbox = "缺少参数"; return(Json(WorkContext.AjaxStringEntity)); } BLL.BaseBLL <Entity.AppVersion> bll = new BLL.BaseBLL <Entity.AppVersion>(); foreach (var item in ids.Split(',')) { int id = TypeHelper.ObjectToInt(item); bll.DelBy(p => p.ID == id); } WorkContext.AjaxStringEntity.msg = 1; WorkContext.AjaxStringEntity.msgbox = "success"; return(Json(WorkContext.AjaxStringEntity)); }
public JsonResult Del(string ids) { if (string.IsNullOrWhiteSpace(ids)) { WorkContext.AjaxStringEntity.msgbox = "非法参数"; return(Json(WorkContext.AjaxStringEntity)); } BLL.BaseBLL <Entity.SysRole> bll = new BLL.BaseBLL <Entity.SysRole>(); foreach (var item in ids.Split(',')) { int id = TypeHelper.ObjectToInt(item); if (id != 1) { bll.DelBy(p => p.ID == id); AddAdminLogs(Entity.SysLogMethodType.Delete, "删除用户组:" + item); } } WorkContext.AjaxStringEntity.msg = 1; WorkContext.AjaxStringEntity.msgbox = "success"; return(Json(WorkContext.AjaxStringEntity)); }
public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext) { base.OnActionExecuted(actionExecutedContext); if (site.WebAPITracker) { WebApiMonitorLog MonLog = actionExecutedContext.Request.Properties[Key] as WebApiMonitorLog; MonLog.ExecuteEndTime = DateTime.Now; MonLog.ActionName = actionExecutedContext.ActionContext.ActionDescriptor.ActionName; MonLog.ControllerName = actionExecutedContext.ActionContext.ActionDescriptor.ControllerDescriptor.ControllerName; MonLog.Uri = actionExecutedContext.Request.RequestUri.OriginalString; new System.Threading.Thread(new System.Threading.ThreadStart(delegate() { BLL.BaseBLL <Entity.SysLogApiAction> bll = new BLL.BaseBLL <Entity.SysLogApiAction>(); DateTime now_date = DateTime.Now.Date; bll.DelBy(p => p.ExecuteStartTime < now_date); bll.Add(MonLog.GetLogEntity()); })) { IsBackground = true }.Start(); } }