public EmergentOrder QueryEmergentOrder(decimal id, OrderIdType orderIdType) { string sql = "SELECT Id,[Type],Content,[Time],Account,OrderIdType FROM T_EmergentOrder WHERE Id=@Id AND OrderIdType =@OrderIdType"; EmergentOrder result = null; using (DbOperator dboperator = new DbOperator(Provider, ConnectionString)) { dboperator.AddParameter("Id", id); dboperator.AddParameter("OrderIdType", orderIdType); using (System.Data.Common.DbDataReader reader = dboperator.ExecuteReader(sql)) { if (reader.Read()) { result = new EmergentOrder(); result.Id = reader.GetDecimal(0); result.Type = (OrderStatus)reader.GetInt32(1); result.Content = reader.GetString(2); result.Time = reader.GetDateTime(3); result.Account = reader.GetString(4); result.OrderIdTypeValue = (OrderIdType)reader.GetByte(5); } } } return(result); }
public UnmanagedOrders(IReadOnlyList <string> list) { OrderPtr = IntPtr.Zero; InOrderIdPtr = Marshal.AllocHGlobal(OrderIdTypeSize * list.Count); OutOrderIdPtr = Marshal.AllocHGlobal(OrderIdTypeSize * list.Count); // 将结构体写成内存块 for (var i = 0; i < list.Count; ++i) { var id = new OrderIdType() { ID = list[i] }; Marshal.StructureToPtr(id, new IntPtr(InOrderIdPtr.ToInt64() + i * OrderIdTypeSize), false); } }
public override bool Equals(object obj) { OrderIdType that = obj as OrderIdType; return(that != null && that.orgid == orgid && that.ordernumber == ordernumber); }
public override bool Equals(object obj) { OrderIdType that = obj as OrderIdType; return(that != null && that.Prefix.Equals(Prefix) && that.OrderNumber == OrderNumber); }
/// <summary> /// 查询紧急订单信息 /// </summary> /// <param name="id">单子号</param> /// <param name="orderIdType">单子类型</param> /// <returns></returns> public static EmergentOrder QueryEmergentOrder(decimal id, OrderIdType orderIdType = OrderIdType.Order) { ICoordinationRepository repository = Factory.CreateCoordinationRepository(); return(repository.QueryEmergentOrder(id, orderIdType)); }