public JsonResult FinishWorkOrder(int Id, 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, 2, ""); int operationId = wodt.WorkOrder.OperatorId ?? 0; if (operationId > 0) { string msg_o = "您指派给" + (wodt.Handler != null && wodt.Handler.Member != null ? wodt.Handler.Member.RealName : "") + "的工单已被完成"; 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 : "") + "完成"; EntityContract._notificationContract.SendNotice(applicantId, "工单状态更新提醒", msg, sendNotificationAction); return(Json(result, JsonRequestBehavior.AllowGet)); }
public JsonResult NoPass(WorkOrderDealtWithDto dealtwith) { var result = _workOrderDealtWithContract.DealtWith(dealtwith.Id, -1, dealtwith.Notes); WorkOrderDealtWith wodt = _workOrderDealtWithContract.View(dealtwith.Id); int operationId = wodt.WorkOrder.OperatorId ?? 0; if (operationId > 0) { string msg_o = "您指派给" + (wodt.Handler.Member != null ? wodt.Handler.Member.RealName : "") + "的工单被拒绝处理,拒绝原因:" + wodt.Notes; EntityContract._notificationContract.SendNotice(operationId, "工单状态更新提醒", msg_o, sendNotificationAction); } string msg = "您申请的工单被" + (wodt.Handler.Member != null ? wodt.Handler.Member.RealName : "") + "拒绝处理,拒绝原因:" + wodt.Notes; int applicantId = wodt.WorkOrder.ApplicantId; EntityContract._notificationContract.SendNotice(applicantId, "工单状态更新提醒", msg, sendNotificationAction); return(Json(result, JsonRequestBehavior.AllowGet)); }
public JsonResult Finish(int Id) { var result = _workOrderDealtWithContract.DealtWith(Id, 2, ""); WorkOrderDealtWith wodt = _workOrderDealtWithContract.View(Id); int operationId = wodt.WorkOrder.OperatorId ?? 0; if (operationId > 0) { string msg_o = "您指派给" + (wodt.Handler != null && wodt.Handler.Member != null ? wodt.Handler.Member.RealName : "") + "的工单已被完成"; EntityContract._notificationContract.SendNotice(operationId, "工单状态更新提醒", msg_o, sendNotificationAction); } string msg = "您申请的工单已被" + (wodt.Handler != null && wodt.Handler.Member != null ? wodt.Handler.Member.RealName : "") + "完成"; int applicantId = wodt.WorkOrder.ApplicantId; EntityContract._notificationContract.SendNotice(applicantId, "工单状态更新提醒", msg, sendNotificationAction); return(Json(result, JsonRequestBehavior.AllowGet)); }