//[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.Synchronized)] public static void PlaceNewSingleOrder(string _clOrderID, string _clientID, string _securityCode, int _quantity, double _price, string _custodyCode, char _orderSide, char _orderType, string currencyCode, string exDestination, char _timeInForce, string groupID, char handleInst, DateTime expiration, bool hasAON, int minQty) { QuickFix44.NewOrderSingle order = new QuickFix44.NewOrderSingle(); #region Order Details QuickFix.OrderQty orderQty = new QuickFix.OrderQty(_quantity); order.setField(orderQty); QuickFix.Symbol symbol = new QuickFix.Symbol(_securityCode); order.setField(symbol); QuickFix.SecurityID secID = new QuickFix.SecurityID(_securityCode); order.setField(secID); QuickFix.Side side = new QuickFix.Side(_orderSide); order.setField(side); QuickFix.OrdType ordType = new QuickFix.OrdType(_orderType); order.setField(ordType); QuickFix.Price price = new QuickFix.Price(_price); order.setField(price); Currency currency = new Currency(currencyCode); order.setField(currency); Account acc = new Account(_clientID); order.setField(acc); //QuickFix.ClearingFirm custody = new ClearingFirm(_custodyCode);order.setField(custody); QuickFix.PartyID custody = new PartyID(_custodyCode); order.setField(custody); //QuickFix.PartyRole pr = new PartyRole(PartyRole.CUSTODIAN); order.setField(pr); //QuickFix.NoPartyIDs npid = new NoPartyIDs(1); order.setField(npid); //QuickFix.PartyIDSource pid = new PartyIDSource(PartyIDSource.PROPRIETARY); order.setField(pid); TimeInForce tif = new TimeInForce(_timeInForce); order.setField(tif); IDSource ids = new IDSource("4"); order.setField(ids); TransactTime tt = new TransactTime(DateTime.Now); order.setField(tt); //SenderSubID ss = new SenderSubID("05095a"); order.setField(ss); if (_timeInForce == QuickFix.TimeInForce.GOOD_TILL_DATE) { ExpireDate ed = new ExpireDate(expiration.ToString("yyyyMMdd")); order.setField(ed); //ExpireTime et = new ExpireTime(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour + 4, 0, 0)); order.setField(et); ExpireTime et = new ExpireTime(expiration); order.setField(et); } if (hasAON) { order.setField(new ExecInst(ExecInst.ALL_OR_NONE.ToString())); order.setField(new MinQty(minQty)); } #endregion Order Details #region Fix Order Message IDs QuickFix.ClOrdID clOrdID = new QuickFix.ClOrdID(string.Format("{0}{1}", _wcfMsgPrefix, _clOrderID)); order.setField(clOrdID); #endregion Fix Order Message IDs #region Reporting //QuickFix.HandlInst handlInst = new QuickFix.HandlInst(QuickFix.HandlInst.AUTOMATED_EXECUTION_ORDER_PRIVATE_NO_BROKER_INTERVENTION); order.setField(handlInst); QuickFix.HandlInst handlInst = new QuickFix.HandlInst(handleInst); order.setField(handlInst); #endregion Reporting #region Exchange ExDestination exd = new ExDestination(exDestination); order.setField(exd); TradingSessionID tradSession = new TradingSessionID(groupID); order.setField(tradSession); #endregion Exchange Session.sendToTarget(order, _sessionID); }
private void TextBox_KeyUp(object sender, KeyRoutedEventArgs e) { if (e.Key == Windows.System.VirtualKey.Enter) { switch (((Control)sender).Name) { case "Email": Password.Focus(FocusState.Keyboard); break; case "Password": ExpireDate.Focus(FocusState.Pointer); break; case "ExpireDate": break; case "ExpireTime": break; default: break; } } }
public IEnumerable <ValidationResult> Validate(ValidationContext validationContext) { var errors = new List <ValidationResult>(); if (ConfirmationType == ConfirmationType.UsingEmail) { if (string.IsNullOrEmpty(Email)) { errors.Add(new ValidationResult(Resource.EmailRequired, new[] { "Email" })); } } if (ConfirmationType == ConfirmationType.UsingPhoneNumber) { if (string.IsNullOrEmpty(PhoneNumber)) { errors.Add(new ValidationResult(Resource.PhoneNumberRequired, new[] { "PhoneNumber" })); } } string[] expirationDateData = ExpireDate.Split('/'); int expirationMonth = int.Parse(expirationDateData[0]); int expirationYear = 2000 + int.Parse(expirationDateData[1]); var expiryDate = new DateTime(expirationYear, expirationMonth, 1); if (expiryDate <= DateTime.UtcNow) { errors.Add(new ValidationResult(Resource.YourCreditCardExpirationDateIsInThePast, new[] { "ExpireDate" })); } return(errors); }
public void ExtendSession(Int32 lifetime) { if (IsExpired) { throw new InvalidOperationException("Session expired"); } if (ExpireDate.Trunc(DateTruncType.Minute) == DateTime.UtcNow.Trunc(DateTruncType.Minute)) { return; } ExpireDate = DateTime.UtcNow.AddMinutes(lifetime); ConcurrencyTokens = Guid.NewGuid(); }
public override CsvExportEntry ConvertToCsvExportEntry() { var entry = base.ConvertToCsvExportEntry(); entry.CardholderName = CardholderName; entry.Number = Number; entry.VerificationNumber = VerificationNumber; entry.Pin = Pin; entry.ExpireDate = ExpireDate.ToString("d"); entry.IssuingBank = IssuingBank; entry.IssuingBankNumber = IssuingBankNumber; return(entry); }
private bool RenewToken() { bool renew = false; DateTime now = DateTime.Now; DateTime refresh = ExpireDate.Subtract(new TimeSpan(0, 0, RefreshIfExpiresIn)); if (now > refresh) { renew = true; } return(renew); }
public bool Insert() { Command = CommandBuilder(@"insert into Production ( productId, qty, actualQty, expireDate, manufuctureDate, number, formulaId, employeeId) values( @productId, @qty, @actualQty, @expireDate, @manufuctureDate, @number, @formulaId, @employeeId)"); Command.Parameters.AddWithValue("@productId", ProductId); Command.Parameters.AddWithValue("@qty", Quentity); Command.Parameters.AddWithValue("@actualQty", ActualQuentity); Command.Parameters.AddWithValue("@expireDate", ExpireDate.ToShortDateString()); Command.Parameters.AddWithValue("@manufuctureDate", ManufuctureDate.ToShortDateString()); Command.Parameters.AddWithValue("@number", Number); Command.Parameters.AddWithValue("@formulaId", FormulaId); Command.Parameters.AddWithValue("@employeeId", EmployeeId); return(ExecuteNQ(Command)); }
/// <summary> /// WriteXml converts the object to Xml (serializes it) and writes it using the XmlWriter passed /// </summary> /// <remarks></remarks> /// <param name="writer">The XmlWriter that contains the xml for the object</param> public void WriteXml(XmlWriter writer) { writer.WriteStartElement("Announcement"); writer.WriteElementString("ItemID", ItemID.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("ModuleID", ModuleID.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("Title", Title); writer.WriteElementString("URL", URL); writer.WriteElementString("ViewOrder", ViewOrder.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("Description", Description); writer.WriteElementString("ImageSource", ImageSource); writer.WriteElementString("TrackClicks", TrackClicks.ToString()); writer.WriteElementString("NewWindow", NewWindow.ToString()); writer.WriteElementString("PublishDate", PublishDate.ToString()); writer.WriteElementString("ExpireDate", ExpireDate.ToString()); writer.WriteEndElement(); }
public override int GetHashCode() { int hashCode = 2030292606; hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(InviteLink); hashCode = hashCode * -1521134295 + EqualityComparer <User> .Default.GetHashCode(Creator); hashCode = hashCode * -1521134295 + CreatesJoinRequest.GetHashCode(); hashCode = hashCode * -1521134295 + IsPrimary.GetHashCode(); hashCode = hashCode * -1521134295 + IsRevoked.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Name); hashCode = hashCode * -1521134295 + ExpireDate.GetHashCode(); hashCode = hashCode * -1521134295 + MemberLimit.GetHashCode(); hashCode = hashCode * -1521134295 + PendingJoinRequestCount.GetHashCode(); return(hashCode); }
/// <summary> /// Get the significant details of what needs approval /// </summary> /// <returns>A list of strings</returns> public override IDictionary <string, string> SignificantDetails() { IDictionary <string, string> returnList = base.SignificantDetails(); returnList.Add("Subject", Name); returnList.Add("Body", Body); returnList.Add("Publish Date", PublishDate.ToString()); returnList.Add("Expire Date", ExpireDate.ToString()); returnList.Add("Force Expired", Expired.ToString()); returnList.Add("Public", Public.ToString()); returnList.Add("Minimum Read Level", MinimumReadLevel.ToString()); foreach (string tag in Tags) { returnList.Add("Tag", tag); } return(returnList); }
public override string ToString() { string ret = Time.ToString() + ","; ret += TransactionCode.ToString() + ","; ret += TransactionSubcode.ToString() + ","; ret += TransID.ToString() + ","; ret += (Symbol != null ? Symbol.ToString() : "") + ","; ret += (BuySell != null ? BuySell.ToString() : "") + ","; ret += (OpenClose != null ? OpenClose.ToString() : "") + ","; ret += Quantity.ToString() + ","; ret += ExpireDate.ToString() + ","; ret += Strike.ToString() + ","; ret += (InsType != null ? InsType.ToString() : "") + ","; ret += Price.ToString() + ","; ret += Fees.ToString() + ","; ret += Amount.ToString() + ","; ret += Description.ToString() + ","; ret += AccountRef.ToString(); return(ret); }
public override int GetHashCode() { int hash = 1; if (InstrumentId.Length != 0) { hash ^= InstrumentId.GetHashCode(); } if (ExchangeId.Length != 0) { hash ^= ExchangeId.GetHashCode(); } if (InstrumentName.Length != 0) { hash ^= InstrumentName.GetHashCode(); } if (ProductId.Length != 0) { hash ^= ProductId.GetHashCode(); } if (ProductClass != 0) { hash ^= ProductClass.GetHashCode(); } if (DeliveryYear != 0) { hash ^= DeliveryYear.GetHashCode(); } if (DeliveryMonth != 0) { hash ^= DeliveryMonth.GetHashCode(); } if (MaxMarketOrderVolume != 0) { hash ^= MaxMarketOrderVolume.GetHashCode(); } if (MinMarketOrderVolume != 0) { hash ^= MinMarketOrderVolume.GetHashCode(); } if (MaxLimitOrderVolume != 0) { hash ^= MaxLimitOrderVolume.GetHashCode(); } if (MinLimitOrderVolume != 0) { hash ^= MinLimitOrderVolume.GetHashCode(); } if (VolumeMultiple != 0) { hash ^= VolumeMultiple.GetHashCode(); } if (PriceTick != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(PriceTick); } if (CreateDate.Length != 0) { hash ^= CreateDate.GetHashCode(); } if (OpenDate.Length != 0) { hash ^= OpenDate.GetHashCode(); } if (ExpireDate.Length != 0) { hash ^= ExpireDate.GetHashCode(); } if (StartDelivDate.Length != 0) { hash ^= StartDelivDate.GetHashCode(); } if (EndDelivDate.Length != 0) { hash ^= EndDelivDate.GetHashCode(); } if (IsTrading != false) { hash ^= IsTrading.GetHashCode(); } if (UnderlyingMultiple != 0) { hash ^= UnderlyingMultiple.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public override string ToString() { var completion = GetObjectiveCompletionPercents(); var subobjecivesString = new StringBuilder(); foreach (var item in Subobjectives) { subobjecivesString.Append($"|\n|______Subobjective {Subobjectives.IndexOf(item) + 1}. {item.ToString()}"); } return($"{Title}. Formulation date: {ObjectiveFormulationDate.ToShortDateString()} Expire date: {ExpireDate.ToShortDateString()} - {completion}%\n" + $"{subobjecivesString.ToString()}"); }