예제 #1
0
        public JsonResult NoPassWorkOrder(int Id, string notes, int adminId)
        {
            if (!_administratorContract.CheckExists(p => p.Id == adminId))
            {
                return(Json(new OperationResult(OperationResultType.Error, "该用户不存在"), JsonRequestBehavior.AllowGet));
            }
            WorkOrderDealtWith wodt = _workOrderDealtWithContract.View(Id);

            if (wodt == null || wodt.HandlerID != adminId)
            {
                return(Json(new OperationResult(OperationResultType.Error, "无法操作"), JsonRequestBehavior.AllowGet));
            }
            var result = _workOrderDealtWithContract.DealtWith(Id, -1, notes);

            int operationId = wodt.WorkOrder.OperatorId ?? 0;

            if (operationId > 0)
            {
                string msg_o = "您指派给" + (wodt.Handler != null && wodt.Handler.Member != null ? wodt.Handler.Member.RealName : "") + "的工单被拒绝处理,拒绝原因:" + wodt.Notes;
                EntityContract._notificationContract.SendNotice(operationId, "工单状态更新提醒", msg_o, sendNotificationAction);
            }
            int    applicantId = wodt.WorkOrder.ApplicantId;
            string msg         = "您申请的工单被" + (wodt.Handler != null && wodt.Handler.Member != null ? wodt.Handler.Member.RealName : "") + "拒绝处理,拒绝原因:" + wodt.Notes;

            EntityContract._notificationContract.SendNotice(applicantId, "工单状态更新提醒", msg, sendNotificationAction);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public JsonResult AddClassApplication(ClassApplication dto)
        {
            if (!_administratorContract.CheckExists(a => a.Id == dto.AdminId && !a.IsDeleted && a.IsEnabled))
            {
                return(Json(new OperationResult(OperationResultType.Error, "用户不存在")));
            }
            OperationResult oper = _classApplicationContract.Insert(dto);

            return(Json(oper));
        }
예제 #3
0
        public JsonResult IsAnswer(int notificationReadId, int adminId)
        {
            if (!_adminContract.CheckExists(a => a.Id == adminId))
            {
                return(Json(new OperationResult(OperationResultType.Error, "用户不存在"), JsonRequestBehavior.AllowGet));
            }
            var notificationReader = _msgNotificationContract.View(notificationReadId);

            if (notificationReader == null)
            {
                return(Json(new OperationResult(OperationResultType.Error, "消息不存在"), JsonRequestBehavior.AllowGet));
            }
            int num = _notificationQASystemContract.Entities.Count(q => q.NotificationId == notificationReader.NotificationId && q.IsEnabled && !q.IsDeleted);

            if (num == 0)
            {//看完就标致已读
                if (notificationReadId > 0)
                {
                    var entity = _msgNotificationContract.View(notificationReadId);
                    if (entity == null || entity.AdministratorId != adminId)
                    {
                        return(Json(new OperationResult(OperationResultType.Error, "消息不存在")));
                    }
                    entity.IsRead = true;
                    var dto = Mapper.Map <MsgNotificationReaderDto>(entity);
                    _msgNotificationContract.Update(dto);
                }

                return(Json(new OperationResult(OperationResultType.QueryNull), JsonRequestBehavior.AllowGet));
            }

            OperationResult opera = _notificationQASystemContract.CheckIsAnswer(notificationReadId, adminId);

            return(Json(opera, JsonRequestBehavior.AllowGet));
        }