public ActionResult LogOff() { AuthenticationManager.SignOut(); EasySession.Clear(); return(RedirectToAction("Login", "Account")); }
/// <param name="protocol"></param> private async Task InnerChannelReceived(ProtocolPacket protocol) { if (protocol.ReportArrived && protocol.PacketMode != PacketMode.Arrived) { ProtocolPacket p = protocol.CopyTo(new ProtocolPacket()); p.Data = new byte[0]; p.HasResponse = false; p.PacketMode = PacketMode.Arrived; p.UsingRemoteEndPoint = true; SendAsync(p).NoAwaiter(); } if (_syncHandles.TryGetValue(protocol.Counter, out ResultWaiter syncHandle)) { syncHandle?.Set(protocol); } if (protocol.PacketMode != PacketMode.Request) { return; } Task CallBack(ProtocolPacket packet, int millisecondsTimeout = -1) { IPEndPoint remoteEndPoint = new IPEndPoint(new IPAddress(packet.Ip), packet.Port); packet.Ip = ConnectOptions.LocalEndPoint.Address.GetAddressBytes(); packet.Port = ConnectOptions.LocalEndPoint.Port; packet.UsingRemoteEndPoint = true; packet.ReportArrived = _connectMode == ConnectMode.Udp; SendAsync(packet, remoteEndPoint, millisecondsTimeout).NoAwaiter(); return(Task.Delay(0)); } ProtocolPacket newPro = protocol.CopyTo(new ProtocolPacket()); newPro.HasResponse = false; newPro.PacketMode = PacketMode.Response; EasySession session = new EasySession(newPro, CallBack); if (Received != null) { await Received(session, protocol.Data); } }
/// <summary> /// /// </summary> /// <param name="spname"></param> /// <param name="easySession"></param> /// <returns></returns> public IQuery UpdateSP(string spname, EasySession easySession) { return new QueryImpl(spname, easySession, CommandType.StoredProcedure); }
/// <summary> /// /// </summary> /// <param name="query"></param> /// <param name="easySession"></param> /// <returns></returns> public IQuery UpdateQuery(string query, EasySession easySession) { return new QueryImpl(query, easySession, CommandType.Text); }
public IQuery EasyQuery(EasySession easySession) { return new QueryImpl(easySession); }