Esempio n. 1
0
        public JsonResult Delete(string ids)
        {
            int[] idArr = CommOp.ToIntArray(ids, ',');

            LogManager.DeleteByKeys(idArr);
            return(JsonTips("success", "Log_Delete_Success"));
        }
Esempio n. 2
0
        public JsonResult GetDeptUsers(string deptIds)
        {
            int[] deptIdArr = CommOp.ToIntArray(deptIds, ',');
            var   list      = OrgManager.mOrganizationManager.GetDepUserQuery();

            if (!deptIdArr.IsEmpty())
            {
                list = list
                       .Where(u => u.DepId != null && deptIdArr.Contains(u.DepId.Value));
            }

            var result = list
                         .GroupBy(u => u.UserId)
                         .Select(g => g.FirstOrDefault())
                         // 在不需要高级查询,只需要模糊查询的情况下,也可以返回一个匿名对象查询
                         // 这里只返回三个字段,是为了减少返回前台的json数据量
                         .Select(u => new
            {
                Id       = u.UserId.Value,
                UserName = u.UserName,
                DepName  = u.DepName,
            });

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Esempio n. 3
0
 public ActionResult DeleteAlerts(string ids)
 {
     int[] idArr = CommOp.ToIntArray(ids, ',');
     //  Manager.Delete(id);
     _schedule.DeleteAlerts(CurrentUserId.ToInt(), idArr);
     return(JsonTips("success", JStr.SuccessDeleted));
 }
Esempio n. 4
0
 public virtual ActionResult Delete(string ids)
 {
     foreach (int id in CommOp.ToIntArray(ids, ','))
     {
         _article.Delete(id);
     }
     return(JsonTips("success", JStr.SuccessDeleted));
 }
Esempio n. 5
0
 //删除文件
 public JsonResult DeleteFiles(string ids)
 {
     int[] idArr = CommOp.ToIntArray(ids, ',');
     for (var i = 0; i < idArr.Length; i++)
     {
         _resourceFileService.DeleteFile(idArr[i]);
     }
     return(JsonTips("success", "删除文件成功!"));
 }
 public ActionResult Index(JMessage msg)
 {
     msg.SendToIds = CommOp.ToIntArray(Request.Form["SendTo"], ',');
     msg.Channel   = (SendChannel)CommOp.ToIntArray(Request.Form["Channel"], ',').Sum();
     msg.SenderId  = CurrentUserId.ToInt();
     SiteManager.Message.Send(msg);
     //msg.SendToIds.Each(id => SiteManager.Message.AlertFast(id));
     return(JsonTips("success", "消息发送成功!"));
 }
Esempio n. 7
0
        public ActionResult Delete(string ids)
        {
            int[] idArr = CommOp.ToIntArray(ids, ',');

            int i = 0;

            foreach (int item in idArr)
            {
                bool flag = AppManager.Instance.UserManager.Remove(item.ToStr());
                if (flag)
                {
                    i++;
                }
            }
            //未进行执行调整成foreach循环
            //idArr.Each(id => AppManager.Instance.UserManager.Remove(id.ToStr()));
            return(JsonTips("success", null, JStr.SuccessDeleted0, (object)null, i));
        }
Esempio n. 8
0
        public object Done(string actionName, string controllerName, string ids)
        {
            var controller = ControllerBuilder.Current.GetControllerFactory()
                             .CreateController(this.Request.RequestContext, controllerName) as BaseController;

            controller.ControllerContext = this.ControllerContext;

            int[] idArr = CommOp.ToIntArray(ids, ',');
            ResourceFileInfo[] results = new ResourceFileInfo[idArr.Length];
            int i = 0;

            foreach (int id in idArr)
            {
                //调用业务逻辑得到stream数组
                var file = _resourceFileService.GetFile(id);
                results[i++] = file;
            }

            var obj = RefHelper.CallMethod(controller, actionName, new object[] { results });

            results.Each(r => r.FileStream.Dispose());
            return(obj);
        }
 public virtual ActionResult Delete(string ids)
 {
     _dataProvider.DeleteByKeys(CommOp.ToIntArray(ids, ','));
     return(JsonTips("success", "删除成功!"));
 }