public NotifyResult GetNotifies([FromQuery] int userid) { var ur = _context.Users .Where(u => u.UserId == userid) .Single(); var ret = new NotifyResult { ClaimForms = new List <ClaimForm>(), WorkFlows = new List <WorkFlow>() }; var cf = _context.ClaimForms .FromSqlRaw("select * from dbo.ClaimForm cf " + "where cf.Id in (" + "select b.RelatedId from dbo.StatusChangeMessage b " + "where b.IsRead = 0 and b.RelatedType = {0} and b.userId={1})", RelatedTypeEnum.ClaimForm, userid) .ToList(); ret.ClaimForms.AddRange(cf); var wf = _context.WorkFlows .FromSqlRaw("select * from dbo.WorkFlow cf " + "where cf.Id in (" + "select b.RelatedId from dbo.StatusChangeMessage b " + "where b.IsRead = 0 and b.RelatedType = {0} and b.userId={1})", RelatedTypeEnum.WorkFlow, userid) .ToList(); ret.WorkFlows.AddRange(wf); return(ret); }
private NotifyResult SendNotify(NotifyRequest request) { var sendResponces = new List <SendResponse>(); var response = CheckPreventInterceptors(request, InterceptorPlace.Prepare, null); if (response != null) { sendResponces.Add(response); } else { sendResponces.AddRange(SendGroupNotify(request)); } NotifyResult result = null; if (sendResponces == null || sendResponces.Count == 0) { result = new NotifyResult(SendResult.OK, sendResponces); } else { result = new NotifyResult(sendResponces.Aggregate((SendResult)0, (s, r) => s |= r.Result), sendResponces); } log.Debug(result); return(result); }
/// <summary> /// 易宝支付海关报关异步回执 /// </summary> /// <param name="nameValuePair"></param> /// <returns></returns> /// <remarks>2015-12-31 杨浩 创建</remarks> public Result EhkingNotifyReceipt(NotifyResult notifyResult) { var result = new Result() { Status = true }; try { BLL.Log.LocalLogBo.Instance.Write("\r\n异步调用成功!", "EhkingNotify"); string json = JsonConvert.SerializeObject(notifyResult); BLL.Log.LocalLogBo.Instance.Write("\r\n异步调用成功2!" + json, "EhkingNotifyResult"); result = BLL.ApiFactory.ApiProviderFactory.GetPayInstance((int)Hyt.Model.CommonEnum.PayCode.易宝).NotifyReceipt(json); } catch (Exception ex) { BLL.Log.LocalLogBo.Instance.Write(ex.Message, "EhkingNotifyReceiptException"); result.Status = false; result.Message = ex.Message; } return(result); }
public NotifyResult ParseNotifyResponse(string responseValue) { NotifyResponse response = XmlSerializerHelper.FromXmlString <NotifyResponse>(responseValue); if (!response.IsSuccess) { NotifyResult result1 = new NotifyResult(); result1.ErrorCode = response.ErrCode; result1.ErrorMessage = this.GetErrorMessage(response, "ParseNotifyResponse"); return(result1); } if (!this.ValidateResponse <NotifyResponse>(response)) { NotifyResult result2 = new NotifyResult(); result2.ErrorMessage = "返回结果响应结果不正确"; return(result2); } NotifyResult result3 = new NotifyResult(); result3.IsSuccess = true; result3.Attach = response.Attach; result3.OutTradeNo = response.OutTradeNo; result3.TimeEnd = response.TimeEnd; result3.TotalFee = ((double)response.TotalFee.GetValueOrDefault()) / 100.0; result3.TransactionId = response.TransactionId; result3.Bank = WeChatBankTypes.GetBank(response.BankType); return(result3); }
public string BuildString_F002(ExHashTable parmaKeyDict) { string result = string.Empty; var req = Utils.ToDataResult(parmaKeyDict, GlobalData.B2BSpotVersion); if (req != null) { var reqModel = req.ToModel <DynamicXml>().To_F002(); var notifyResult = new NotifyResult() { ReqData = reqModel, DataResult = req }; //处理业务 var handler = BuildHandler.GetHandler(); if (handler != null) { handler.Process(req.FuncCode, notifyResult); } //业务处理成功后更改 响应码:RspCode 为成功 "000000" parmaKeyDict.Set("RspCode", notifyResult.RspStatus.Code); parmaKeyDict.Set("RspMsg", notifyResult.RspStatus.Msg); result = string.Join(GlobalData.XMLHeadTemplate, ""); } return(result); }
/// <summary> /// 会员签解约维护【1303】 /// </summary> /// <param name="parmaKeyDict"></param> /// <returns></returns> public string BuildString_1303(ExHashTable parmaKeyDict) { string result = string.Empty; //接收的数据 var req = Utils.ToDataResult(parmaKeyDict, GlobalData.B2BSpotVersion); if (req != null) { Req_1303 reqModel = req.ToModel <Req_1303>(); var resModel = new Res_1303(); var notifyResult = new NotifyResult() { ReqData = reqModel, RspData = resModel, DataResult = req }; //处理业务 var handler = BuildHandler.GetHandler(); if (handler != null) { handler.Process(req.FuncCode, notifyResult); } //业务处理成功后更改 响应码:RspCode 为成功 "000000" parmaKeyDict.Set("RspCode", notifyResult.RspStatus.Code); parmaKeyDict.Set("RspMsg", notifyResult.RspStatus.Msg); //返回内容 result = Utils.JoinModelString <Res_1303>(notifyResult.RspData); } return(result); }
public void Notified(Func <NotifyResult, NotifyReturnMessage> onNotified) { var request = HttpContext.Current.Request; var respose = HttpContext.Current.Response; respose.ContentType = "text/plain"; Dictionary <string, string> dictToReturn = new Dictionary <string, string>(); dictToReturn.Add("return_code", "SUCCESS"); dictToReturn.Add("return_msg", ""); NotifyResult result = null; string xml; xml = GetResultXml(request); ResultBuilder resultBuilder = new ResultBuilder(xml); resultBuilder.BasicValidate(); result = new NotifyResult(resultBuilder); NotifyReturnMessage returnMessage = onNotified(result); if (!returnMessage.Success) { dictToReturn["return_code"] = "FAIL"; dictToReturn["return_msg"] = returnMessage.Message; } respose.Write(CommonHelper.CreateXmlForReturn(dictToReturn)); }
protected void OnClosed(EventArgs e) { if (result == NotifyResult.Waiting) { result = NotifyResult.Cancel; } this.timer.Stop(); }
/// <summary> /// 向客户端发送通知,在<see cref="RequestMessage"/>的"IsBroadcast"属性为True则忽略"Destination"发送广播,否则则定向发送至"Destination"对应的端 /// </summary> /// <param name="message"></param> /// <returns></returns> public NotifyResult Notify(NotifyMessage message) { //设置消息源 message.Source = ServerId; var notifyResult = new NotifyResult() { ExceptionInfos = new Dictionary <string, string>(), SentTerminals = new List <string>() }; if (message.IsBroadcast) { foreach (var duplexCallbackContract in _callbackContracts) { try { duplexCallbackContract.Value.CallbackNotify(message); notifyResult.SentTerminals.Add(duplexCallbackContract.Key); } catch (Exception ex) { notifyResult.ExceptionInfos.Add(duplexCallbackContract.Key, ex.Message); } } } else if (message.Destination != null) { if (_callbackContracts.TryGetValue(message.Destination, out var callbackContract)) { try { callbackContract.CallbackNotify(message); } catch (Exception ex) { notifyResult.ExceptionInfos.Add(message.Destination, ex.Message); } } else { notifyResult.ExceptionInfos.Add(message.Destination, ErrorCodes.FindClientFailed.GetCustomAttribute <LogAttribute>() ?.Description); } } return(notifyResult); }
/// <summary> /// Notifies subscribed devices that a token should be created and endorsed. /// </summary> /// <param name = "tokenRequestId">the token request ID to send</param> /// <param name = "addKey">optional add key payload to send</param> /// <param name = "receiptContact">optional receipt contact to send</param> /// <returns>notify result of the notification request</returns> public Task <NotifyResult> NotifyCreateAndEndorseToken( string tokenRequestId, AddKey addKey, ReceiptContact receiptContact) { var request = new TriggerCreateAndEndorseTokenNotificationRequest { TokenRequestId = tokenRequestId }; if (addKey != null) { request.AddKey = addKey; } if (receiptContact != null) { request.Contact = receiptContact; } return(gateway.TriggerCreateAndEndorseTokenNotificationAsync(request) .ToTask(response => NotifyResult.Create(response.NotificationId, response.Status))); }
//public async Task<NotifyResult> NotifyUser(string strMessage, NotifyType type, NotifyButton button) //{ // PiNotify.GetInstance().SetNotification(strMessage, type, button); // _root.ShowNotify(); // return await Task.Run(() => _result); //} public void Close(NotifyResult result) { _result = result; _root.CloseNotify(); }
private void yesButton_Click(object sender, EventArgs e) { result = NotifyResult.Yes; this.timer.Stop(); (Parent as Popup).Close(); }
private NotifyResult SendNotify(NotifyRequest request) { var sendResponces = new List<SendResponse>(); var response = CheckPreventInterceptors(request, InterceptorPlace.Prepare, null); if (response != null) { sendResponces.Add(response); } else { sendResponces.AddRange(SendGroupNotify(request)); } NotifyResult result = null; if (sendResponces == null || sendResponces.Count == 0) { result = new NotifyResult(SendResult.OK, sendResponces); } else { result = new NotifyResult(sendResponces.Aggregate((SendResult)0, (s, r) => s |= r.Result), sendResponces); } log.Debug(result); return result; }
public void Process(string funcCode, NotifyResult notifyResult) { //通讯信息 var recvResult = notifyResult.DataResult; switch (funcCode) { case "1301": { //接收业务数据 Req_1301 req_1301 = notifyResult.ReqData as Req_1301; //处理业务 //MemberInfoDataAccess.AddOrUpdateMemberInfo(req_1301); //构造返回结果 string serialNumber = AssistantHelper.GetOrderId(6, "yyyyMMddHHmmss", ""); notifyResult.RspData.ThirdLogNo = serialNumber; notifyResult.RspData.Reserve = "1301"; notifyResult.RspStatus.Code = "000000"; notifyResult.RspStatus.Msg = "交易成功"; } break; case "1315": //出入金账户维护【1315】 { Req_1315 req_1315 = notifyResult.ReqData as Req_1315; //处理业务 //记录签约后返回来的子账户和出入金账号 后续用到 //MemberInfoDataAccess.AddOrUpdateMemberInfo(req_1315); //构造返回结果 string serialNumber = AssistantHelper.GetOrderId(6, "yyyyMMddHHmmss", ""); notifyResult.RspData.ThirdLogNo = serialNumber; notifyResult.RspData.Reserve = "1315"; notifyResult.RspStatus.Code = "000000"; notifyResult.RspStatus.Msg = "交易成功"; } break; case "1303": //会员签解约维护【1303】 { //接收业务数据 Req_1303 req_1303 = notifyResult.ReqData as Req_1303; //处理业务 //MemberInfoDataAccess.AddOrUpdateMemberInfo(req_1303); //构造返回结果 string serialNumber = AssistantHelper.GetOrderId(6, "yyyyMMddHHmmss", ""); notifyResult.RspData.ThirdLogNo = serialNumber; notifyResult.RspData.Reserve = "1303"; notifyResult.RspStatus.Code = "000000"; notifyResult.RspStatus.Msg = "交易成功"; } break; case "1310": //入金(银行发起)【1310】 { Req_1310 req_1310 = notifyResult.ReqData as Req_1310; //处理业务 //.... //构造返回结果 string serialNumber = AssistantHelper.GetOrderId(6, "yyyyMMddHHmmss", ""); notifyResult.RspData.ThirdLogNo = serialNumber; notifyResult.RspData.Reserve = "1310"; notifyResult.RspStatus.Code = "000000"; notifyResult.RspStatus.Msg = "交易成功"; } break; case "1312": //出金(银行发起)【1312】 { Req_1312 req_1312 = notifyResult.ReqData as Req_1312; //处理业务 //.... //构造返回结果 string serialNumber = AssistantHelper.GetOrderId(6, "yyyyMMddHHmmss", ""); notifyResult.RspData.ThirdLogNo = serialNumber; notifyResult.RspData.Reserve = "1312"; notifyResult.RspStatus.Code = "000000"; notifyResult.RspStatus.Msg = "交易成功"; } break; case "1019": //查交易网端会员管理账户余额 { Req_1019 req_1019 = notifyResult.ReqData as Req_1019; //处理业务 //.... //构造返回结果 string serialNumber = AssistantHelper.GetOrderId(6, "yyyyMMddHHmmss", ""); notifyResult.RspData.ThirdLogNo = serialNumber; notifyResult.RspData.Reserve = "1019"; notifyResult.RspStatus.Code = "000000"; notifyResult.RspStatus.Msg = "交易成功"; } break; case "1326": //银行复核通知 { Req_1326 req_1326 = notifyResult.ReqData as Req_1326; //处理业务 //.... //构造返回结果 string serialNumber = AssistantHelper.GetOrderId(6, "yyyyMMddHHmmss", ""); notifyResult.RspData.ThirdLogNo = serialNumber; notifyResult.RspData.Reserve = "1326"; notifyResult.RspStatus.Code = "000000"; notifyResult.RspStatus.Msg = "交易成功"; } break; case "FILE04": //ERP文件上传、下载结果通知 { Req_FILE04 req_FILE04 = notifyResult.ReqData as Req_FILE04; //处理业务 跨行快付的业务 //.... notifyResult.RspStatus.Code = "000000"; notifyResult.RspStatus.Msg = "交易成功"; } break; case "F002": //银行通知 明细报表生成通知接口 { Req_F002 req_F002 = notifyResult.ReqData as Req_F002; //记录日志 notifyResult.RspStatus.Code = "000000"; notifyResult.RspStatus.Msg = "交易成功"; } break; default: break; } }
private int WndProc(IntPtr hWnd, int uMsg, IntPtr wParam, IntPtr lParam) { if (uMsg == 0x110) { x0bdae4f1006d9d27.x9d748d087524e2b4(this, 2); x443cc432acaadb1d.SetParent(base.Handle, hWnd); hWndPage = hWnd; hWndForm = x443cc432acaadb1d.GetParent(hWnd); base.Visible = true; return(1); } if (uMsg == 15) { base.Invalidate(true); return(0); } if (uMsg == 0x4e) { xd0b43587806b92d7 xdbbd = (xd0b43587806b92d7)Marshal.PtrToStructure(lParam, typeof(xd0b43587806b92d7)); if (xdbbd.x8baacca1e4006e06.x9035cf16181332fc == -200) { bool flag = OnActivate(); x443cc432acaadb1d.x1240f363affcf768(hWnd, 0, flag ? IntPtr.Zero : ((IntPtr)(-1))); return(1); } if (xdbbd.x8baacca1e4006e06.x9035cf16181332fc == -202) { NotifyResult result = OnApply(); x443cc432acaadb1d.x1240f363affcf768(hWnd, 0, (IntPtr)((long)result)); return(1); } if (xdbbd.x8baacca1e4006e06.x9035cf16181332fc != -203) { if (xdbbd.x8baacca1e4006e06.x9035cf16181332fc != -205) { if (xdbbd.x8baacca1e4006e06.x9035cf16181332fc == -201) { bool flag2 = OnValidateChanges(); x443cc432acaadb1d.x1240f363affcf768(hWnd, 0, flag2 ? IntPtr.Zero : ((IntPtr)1)); return(1); } if (xdbbd.x8baacca1e4006e06.x9035cf16181332fc == -209) { bool flag3 = OnQueryCancel(); x443cc432acaadb1d.x1240f363affcf768(hWnd, 0, flag3 ? IntPtr.Zero : ((IntPtr)1)); return(1); } } else { OnShowHelp(); } } else { OnCancel(); } } else if (uMsg == 5) { base.Width = lParam.ToInt32() & 0xffff; base.Height = lParam.ToInt32() / 0x10000; OnCreatePage(); } return(0); }
public void PrintChangeDetails(IEnumerable <DChangesetData> changes, DRule rule, NotifyResult result) { result.Result = new List <string>(); foreach (var dChangesetData in changes) { foreach (var change in dChangesetData.Changes) { var name = ""; if (!change.New.ActualFileSnapshot.Files.Any()) { var type = _types.First(x => x.Id == change.New.TypeId); if (type.IsTaskType()) { var attrs = type.Attributes.Where(x => x.ShowInTree).OrderBy(y => y.DisplaySortOrder); foreach (var mAttribute in attrs) { DValue value; change.New.Attributes.TryGetValue(mAttribute.Name, out value); if (value != null) { name += " " + value.StrValue; } } } //if (change.New.Attributes.ContainsKey(SystemAttributes.PROJECT_ITEM_NAME)) //{ // name = change.New.Attributes[SystemAttributes.PROJECT_ITEM_NAME]; // result.Result.Add(name); //} } /*if (change.New.Attributes.ContainsKey(SystemAttributes.TASK_STATE)) * { * name = change.New.Attributes[SystemAttributes.TASK_STATE]; * result.Result.Add(GetRuleText(rule) + " файл " + name); * } * else * { * if (!change.New.ActualFileSnapshot.Files.Any()) * continue; * * var type = _types.First(x => x.Id == change.New.TypeId); * var attrs = type.Attributes.Where(x => x.ShowInTree).OrderBy(y => y.DisplaySortOrder); * foreach (var mAttribute in attrs) * { * DValue value; * change.New.Attributes.TryGetValue(mAttribute.Name, out value); * if (value != null) * name += " " + value.StrValue; * } * * if (change.Old == null) * { * result.Result.Add(GetRuleText(rule) + " документ " + name); * } * else * { * result.Result.Add(GetRuleText(rule) + " а версия документа " + name); * } * }*/ } } }