/// <summary> /// 扣除现金 /// </summary> /// <param name="strAdminKey"></param> /// <param name="UserID"></param> /// <param name="Curr"></param> /// <param name="Quotiety"></param> /// <returns></returns> public RI_Result SetForfeiture(string strAdminKey, int UserID, RI_Currency Curr, double Quotiety) { try { if (strAdminKey == null || string.Compare(strAdminKey.Trim(), Common.Config("Authorization", "AdminKey").Trim()) != 0) { Common.Log("UnAuthorized Remoting Key [" + strAdminKey.Trim() + "]."); return(RI_Result.Unauthorized); } else if (!Common.Switch_Maintain) { Common.Log("The Interface [ServiceMaintain] Is Closed."); return(RI_Result.Closed_Interface); } else if (Common.DBSync == null) { return(RI_Result.Internal_Error); } else { RI_Result Rtn = Common.DBSync.SetForfeiture(UserID, (TradingSystem.Currency)Curr, Quotiety); if (Rtn == RI_Result.Success) { Common.Log("Set Forfeiture Info [" + UserID + "/" + Curr.ToString().Trim() + "]."); } return(Rtn); } } catch (Exception err) { Common.Log(err); return(RI_Result.Internal_Error); } }
public void Clear() { try { Cash = 0; UsableCash = 0; Wealth = 0; Curr = RI_Currency.Unknown; } catch { } }
public void Clear() { try { OriginalCash = 0; ChangedCash = 0; Curr = RI_Currency.Unknown; ChangedDate = DateTime.MinValue; OrderID = 0; } catch { } }
public void Clear() { try { StockCode = ""; StockMarket = RemotingInterface.RI_Market.Unknown; Volume = 0; SellableVolume = 0; AveragePrice = 0; Curr = RI_Currency.Unknown; } catch { } }
public void Clear() { try { Side = false; StockCode = ""; StockMarket = RemotingInterface.RI_Market.Unknown; TradeVolume = 0; TradePrice = 0; Curr = RI_Currency.Unknown; TradeDate = DateTime.MinValue; } catch { } }
public void Clear() { try { UserID = 0; OrderID = 0; OrderType = RemotingInterface.RI_Type.None; OrderStatus = RemotingInterface.RI_Status.Unknown; Side = false; StockCode = ""; StockMarket = RemotingInterface.RI_Market.Unknown; OrderVolume = 0; OrderPrice = 0; TradePrice = 0; Curr = RI_Currency.Unknown; OrderDate = DateTime.MinValue; UpdatedDate = DateTime.MinValue; ExpiredDate = DateTime.MaxValue; } catch { } }
/// <summary> /// 导入单个订单 /// </summary> /// <param name="data"></param> /// <returns></returns> public bool Import(RI_Order data) { try { OrderID = data.OrderID; OrderType = data.OrderType; OrderStatus = data.OrderStatus; Side = data.Side; StockCode = data.StockCode; StockMarket = data.StockMarket; OrderVolume = data.OrderVolume; OrderPrice = data.OrderPrice; TradePrice = data.TradePrice; OrderDate = data.OrderDate; Curr = data.Curr; UpdatedDate = data.UpdatedDate; ExpiredDate = data.ExpiredDate; return(true); } catch { return(false); } }
public void Clear() { try { OrderID = 0; OrderType = RemotingInterface.RI_Type.None; OrderStatus = RemotingInterface.RI_Status.Unknown; Side = false; StockCode = ""; StockMarket = RemotingInterface.RI_Market.Unknown; OrderVolume = 0; OrderPrice = 0; TradePrice = 0; Curr = RI_Currency.Unknown; OrderDate = DateTime.MinValue; UpdatedDate = DateTime.MinValue; ExpiredDate = DateTime.MaxValue; } catch { } }
/// <summary> /// 导入单个订单 /// </summary> /// <param name="data"></param> /// <returns></returns> public bool Import(RI_Order data) { try { OrderID = data.OrderID; OrderType = data.OrderType; OrderStatus = data.OrderStatus; Side = data.Side; StockCode = data.StockCode; StockMarket = data.StockMarket; OrderVolume = data.OrderVolume; OrderPrice = data.OrderPrice; TradePrice = data.TradePrice; OrderDate = data.OrderDate; Curr = data.Curr; UpdatedDate = data.UpdatedDate; ExpiredDate = data.ExpiredDate; return true; } catch { return false; } }
/// <summary> /// 扣除现金 /// </summary> /// <param name="strAdminKey"></param> /// <param name="UserID"></param> /// <param name="Curr"></param> /// <param name="Quotiety"></param> /// <returns></returns> public RI_Result SetForfeiture(string strAdminKey, int UserID, RI_Currency Curr, double Quotiety) { try { if (strAdminKey == null || string.Compare(strAdminKey.Trim(), Common.Config("Authorization", "AdminKey").Trim()) != 0) { Common.Log("UnAuthorized Remoting Key [" + strAdminKey.Trim() + "]."); return RI_Result.Unauthorized; } else if (!Common.Switch_Maintain) { Common.Log("The Interface [ServiceMaintain] Is Closed."); return RI_Result.Closed_Interface; } else if (Common.DBSync == null) return RI_Result.Internal_Error; else { RI_Result Rtn = Common.DBSync.SetForfeiture(UserID, (TradingSystem.Currency)Curr, Quotiety); if (Rtn == RI_Result.Success) Common.Log("Set Forfeiture Info [" + UserID + "/" + Curr.ToString().Trim() + "]."); return Rtn; } } catch (Exception err) { Common.Log(err); return RI_Result.Internal_Error; } }