Esempio n. 1
0
 public ICommand CreateSendAcceptNewOrder(FixSessionID sessionID,
                                          IOrder order)
 {
     return new SendAcceptNewOrder(_sessionMediator,
                                   sessionID,
                                   order);
 }
Esempio n. 2
0
        /// <summary>
        /// This method sets the route on an order
        /// </summary>
        /// <param name="order">The specific order</param>
        /// <returns>The new route for the order</returns>
        public IRoute GetRoute(IOrder order)
        {
            IRoute route = null;

            if (order == null)
                throw new ApplicationException("Order can not be null when retrieving the route");

            if (order.IsAggregateOrder)
            {
                if (!order.IsMonetary) // Security Order
                {
                    IInstrument instrument = ((ISecurityOrder)order).TradedInstrument;
                    if (instrument == null)
                        throw new ApplicationException("Traded instrument on the Order can not be null when retrieving the route");

                    // Get the route from the instrument
                    if (instrument.IsTradeable)
                        route = ((ITradeableInstrument)instrument).DefaultRoute;

                    if (route == null)
                    {
                        // Get the default route
                        route = mapper.getDefaultRoute();
                    }
                }
                else
                {
                    // order is monetary order
                    // send the order to money desk
                    route = mapper.getSpecificRoute(RouteTypes.MoneyDesk);
                }
            }

            return route;
        }
 private IEnumerable<CreditCardTransaction> Generate(IOrder order, ICreditCard[] cards)
 {
     if (cards.IsNullOrEmpty()) yield break;
     var countCard = cards.Count();
     foreach (var card in cards)
     {
         var transaction = new CreditCardTransaction
         {
             /*Divide o total da compra pelo número de cartões enviados*/
             AmountInCents = order.AmountInCents / countCard,
             TransactionReference = order.TransactionReference,
             InstallmentCount = card.InstallmentCount
         };
         if (card.InstantBuyKey.HasValue && card.InstantBuyKey.Value != Guid.Empty)
         {
             transaction.CreditCard = new CreditCard()
             {
                 InstantBuyKey = card.InstantBuyKey.Value
             };
             yield return transaction;
             continue;
         }
         transaction.CreditCard = card.Copiar<ICreditCard, CreditCard>();
         Contract.Assert(card.CreditCardBrand.HasValue);
         GatewayApiClient.DataContracts.EnumTypes.CreditCardBrandEnum brand;
         Enum.TryParse(card.CreditCardBrand.GetValueOrDefault().ToString(), true, out brand);
         transaction.CreditCard.CreditCardBrand = brand;
         yield return transaction;
     }
 }
Esempio n. 4
0
        public static IOrder OffsetOrderTimeFieldsToEasternStandard(IOrder order)
        {
            // convert sendtime to eastern
            // (since postAPI currently uses that instead of UTC like it should)
            order.SendTimeUTC = ConvertToEasternTime(order.SendTimeUTC);

            // likewise convert stop and start time to eastern
            if (order.HasProperty("StopTimeUTC"))
            {
                var prop = order.GetType().GetProperty("StopTimeUTC");
                var offsetTime = ConvertToEasternTime(Convert.ToDateTime(prop.GetValue(order, null)));
                prop.SetValue(order, offsetTime, null);
            }

            if (order.HasProperty("RestartTimeUTC"))
            {
                var prop = order.GetType().GetProperty("RestartTimeUTC");
                var offsetTime = ConvertToEasternTime(Convert.ToDateTime(prop.GetValue(order, null)));
                prop.SetValue(order, offsetTime, null);
            }

            // only on voice for now
            if (order.HasProperty("StopDateTimeUTC"))
            {
                var prop = order.GetType().GetProperty("StopDateTimeUTC");
                var offsetTime = ConvertToEasternTime(Convert.ToDateTime(prop.GetValue(order, null)));
                prop.SetValue(order, offsetTime, null);
            }

            return order;
        }
Esempio n. 5
0
        public void Cancel(IOrder order, Guid paypalGuid, string token)
        {
            var payPalOrder = this._queryDispatcher.Dispatch<PayPalPayment, GetPayPalPaymentByGuidQuery>(new GetPayPalPaymentByGuidQuery(paypalGuid));

            payPalOrder.Cancelled();
            this._commandDispatcher.Dispatch(new SavePayPalPaymentCommand(payPalOrder));
        }
Esempio n. 6
0
 public CommClient(IOrder order)
 {
     if (order == null)
         throw new ApplicationException("It is not possible to calculate the commission when the order is null.");
     this.order = order;
     type = CommClientType.Order;
 }
Esempio n. 7
0
        public Message CreateNewOrderExecutionReport(IOrder o, string execID)
        {
            var symbol = new Symbol(o.Contract.Symbol);
            var exReport = new ExecutionReport(
                new OrderID(o.ID.ToString(CultureInfo.InvariantCulture)),
                new ExecID(execID),
                new ExecType(ExecType.NEW),
                new OrdStatus(OrdStatus.NEW),
                symbol,
                TranslateFixFields.Translate(o.MarketSide),
                new LeavesQty(o.Quantity),
                new CumQty(0m),
                new AvgPx(o.Price))
                {
                    ClOrdID = new ClOrdID(o.ClOrdID),
                    Symbol = symbol,
                    OrderQty = new OrderQty(o.Quantity),
                    LastQty = new LastQty(0m)
                };

            //exReport.Set(new LastPx(o.Price));

            if (TradingAccount.IsSet(o.Account))
                exReport.SetField(new Account(o.Account.Name));

            return exReport;
        }
Esempio n. 8
0
        /// 
        /// </summary>
        /// <param name="article"></param>
        public static void AddOrder(IOrder order)
        {
            // Create the Database object, using the default database service. The
            // default database service is determined through configuration.
            Database db = DatabaseFactory.CreateDatabase();

            string sqlCommand = "InsertOrder";
            DbCommand commentaryCommand = db.GetStoredProcCommand(sqlCommand);

            // GlobalFunctions.GetCurrentTimeInEST()

            db.AddInParameter(commentaryCommand, "UserId", DbType.String, order.UserId);
            db.AddInParameter(commentaryCommand, "UniqueOrderId", DbType.String, order.OrderReferenceId);
            db.AddInParameter(commentaryCommand, "MonthsOfSubscription", DbType.String, order.MonthsOfSubscription);
            db.AddInParameter(commentaryCommand, "PaymentDate", DbType.DateTime, order.PaymentDate);
            db.AddInParameter(commentaryCommand, "VendorReferenceId", DbType.String, order.VendorReferenceId);
            db.AddInParameter(commentaryCommand, "SubscriptionStartDate", DbType.DateTime, order.SubscriptionStartDate);
            db.AddInParameter(commentaryCommand, "SubscriptionEndDate", DbType.DateTime, order.SubscriptionEndDate);

            using (DbConnection connection = db.CreateConnection())
            {
                connection.Open();
                db.ExecuteNonQuery(commentaryCommand);
                connection.Close();
            }
        }
        public void FromNT_OnOrderUpdate(IOrder order, IExecution exec)
        {
            try
            {
                if (order == null)
                    return;

                OrderFixBridge nt7fb;
                ExecStatus current_exec_status;
                lock (locker_)
                {
                    nt7fb = m_orders.AddOrGet(order, string.Empty, null);
                    if (exec != null)
                        nt7fb.AddExec(exec);
                    current_exec_status = nt7fb.GetExecStatus();
                }
                if (exec == null)
                    SendExecutionReport(nt7fb, order.Instrument.FullName, double.NaN, double.NaN, "execution on order occured");
                else
                    SendExecutionReport(nt7fb, order.Instrument.FullName, exec.Quantity, exec.Price, "execution on order occured");
            }catch(Exception e)
            {
                m_logger.Info("[QuickFixApp.FromNT_OnOrderUpdate]", e.ToString());
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="RemoveShipmentOrderItemsFromInventoryAndPersistShipmentTask"/> class.
 /// </summary>
 /// <param name="merchelloContext">
 /// The merchello context.
 /// </param>
 /// <param name="order">
 /// The order.
 /// </param>
 /// <param name="keysToShip">
 /// The keys to ship.
 /// </param>
 public RemoveShipmentOrderItemsFromInventoryAndPersistShipmentTask(IMerchelloContext merchelloContext, IOrder order, IEnumerable<Guid> keysToShip) 
     : base(merchelloContext, order, keysToShip)
 {
     _productVariantService = MerchelloContext.Services.ProductVariantService;
     _shipmentService = MerchelloContext.Services.ShipmentService;
     _orderService = MerchelloContext.Services.OrderService;
 }
        public OrderEditControl(int cislo)
        {
            InitializeComponent();
            this._temp=Settings.Config.getOrders().FirstOrDefault(x => x.id == cislo);
            setUpValues();

        }
Esempio n. 12
0
        public PaymentResult CompletePayment(IOrder order, string accessCode)
        {
            string url = string.Format("{0}/AccessCode/{1}", this._ewayUrl, accessCode);
            var headers = new Dictionary<HttpRequestHeader, string>();
            headers.Add(HttpRequestHeader.Authorization, this._authorisation);

            var response = this._httpWebUtility.Get<EwayPaymentResponse>(url, 30000, headers);

            if (response.StatusCode == HttpStatusCode.OK)
            {
                this._commandDispatcher.Dispatch(new EwayPaymentProcessedCommand(order, response.Response));

            IList<string> validResponseCodes = new List<string>() { "00", "08", "10", "11", "16" };
                if (validResponseCodes.Contains(response.Response.ResponseCode))
                {
                    this._messageService.AddMessage(new PaymentCompleteMessage(order, PaymentMethod.CreditCard));

                    return PaymentResult.Success();
                }

                return PaymentResult.Error(this.GetError(response.Response));
            }
            else
            {
                this._logger.Log(LogType.Error, "unable to complete payment: " + response.StatusCode.ToString());
            }

            return PaymentResult.Error("Sorry there was a problem processing your payment details. Please try again.");
        }
        public void CalculateOrderPrice_should_return_0_if_order_is_empty()
        {
            _order = new Order();

            decimal actual = _calculatorService.CalculateOrderPrice(_order);

            actual.Should().Be(0m);
        }
 public void FromFIX_CancelOrder(IOrder p_order)
 {
     ThreadPool.QueueUserWorkItem(new WaitCallback(obj =>
     {
         lock (locker_)
             CancelOrder(p_order);
     }));
 }
 public NewExecution(IOrder buySideOrder, IOrder sellSideOrder, int matchedQuantity, double matchedPrice, DateTimeOffset executionTime)
 {
     BuySideOrder = buySideOrder;
     SellSideOrder = sellSideOrder;
     MatchedPrice = matchedPrice;
     MatchedQuantity = matchedQuantity;
     ExecutionTime = executionTime;
 }
Esempio n. 16
0
 public void NewOrderAccepted(FixSessionID ownerSessionID, IOrder order)
 {
     var orders = new List<IOrder> {order};
     foreach (var sessionID in GetAllLoggedInSessions())
     {
         SendOrders(sessionID, orders);
     }
 }
Esempio n. 17
0
 public IOrderEditView CreateOrderEditView(IOrder order)
 {
     var presenter = new OrderEditPresenter(_orderEditDataBinder, this);
     var view = new OrderEditForm(presenter);
     presenter.Order = order;
     presenter.View = view;
     return view;
 }
Esempio n. 18
0
 //create a Charge method which will do only authcatpure
 //change ITransaction to TransactionType and make it protected
 public Response Charge(IProfileAttributes profileAttributes, IPaymentProfileAttributes paymentProfileAttributes, IOrder order)
 {
     var chargeAttributes = new Dictionary<string, object>();
     chargeAttributes.Add("profile", profileAttributes);
     chargeAttributes.Add("paymentProfile", paymentProfileAttributes);
     chargeAttributes.Add("order", order);
     return GetResponse(chargeAttributes, "createCustomerProfileTransactionRequestAuthCapture.spark", new CreateCustomerProfileTransactionParser());
 }
Esempio n. 19
0
 public CrumbleTransaction(IOrder order, ICrumbleAccount acctA, IAccount acctB,
         InstrumentSize valueSize, Price price, decimal exRate, DateTime transactionDate,
         DateTime transactionDateTime, Decimal ServiceChargePercentage, Side txSide, ITradingJournalEntry tradingJournalEntry,
         IGLLookupRecords lookups, ListOfTransactionComponents[] components)
     : base(order, acctA, acctB, valueSize, price, exRate, transactionDate, transactionDateTime, ServiceChargePercentage,
         txSide, tradingJournalEntry, lookups, components)
 {
 }
Esempio n. 20
0
 public SendAcceptNewOrder(SessionMediator sessionMediator,
                           FixSessionID sessionID,
                           IOrder order)
 {
     _sessionMediator = sessionMediator;
     _sessionID = sessionID;
     _order = order;
 }
Esempio n. 21
0
 protected override void OnOrderUpdate(IOrder order)
 {
     if (_latestSubmittedOrder != null && _latestSubmittedOrder == order)
     {
         Print(order.ToString());
         if (order.OrderState == OrderState.Filled)
             _latestSubmittedOrder = null;
     }
 }
Esempio n. 22
0
        //override is mandatory to use event in derived class
        //public override event EventHandler<BasePayment.ConfirmEventArgs> OnConfirm;
        public override void Submit(IOrder order, NameValueCollection data = null)
        {
            //submit and redir to banktransfer summary page
            var fields = new NameValueCollection();
            fields.Add("p", "bank-transfer");
            fields.Add("item_number", order.OrderRef);

            RedirHelper.RedirectAndPOST(base.Page, base.PaymentData.PaySubmitUrl, fields);
        }
Esempio n. 23
0
 public GetAll(
     ISkip<Filter.Simple.Data.Filter> skip,
     ILimit<Filter.Simple.Data.Filter> limit,
     IOrder<Filter.Simple.Data.Filter, ObjectReference> order)
 {
     _skip = skip;
     _limit = limit;
     _order = order;
 }
Esempio n. 24
0
        public void RemoveProduct(IProduct product, IOrder order)
        {
            order.List.Remove(product);

            if(order.List.Count == 0)
            {
                order.State = new EmptyState();
            }
        }
Esempio n. 25
0
        public static bool HasBetterPriceThan(this IOrder x, IOrder y)
        {
            if (x.MarketSide != y.MarketSide)
                throw new DomainException(
                    "Trying to compare prices for orders on different market sides");

            return x.MarketSide == MarketSide.Ask
                       ? x.Price < y.Price
                       : x.Price > y.Price;
        }
Esempio n. 26
0
        public void AddOrder(IOrder order)
        {
            lock (list)
            {

                //Get(deal.Symbol).Value += (int)deal.BuySell * deal.Value;
                throw new NotImplementedException();

            }
        }
        IOrderFulfillmentSaga GetSaga(IOrder order)
        {
            if (!_sagas.Keys.Exists(k => k == order.Id))
            {
                _sagas.Add(order.Id, _sagaFactory.Create(order));
            }

            var saga = _sagas[order.Id];
            return saga;
        }
Esempio n. 28
0
        public decimal CalculateTotal(IOrder order)
        {
            decimal itemTotal = order.GetItemTotal();
            decimal discountAmount = DiscountCalculator.CalculateDiscount(order);
            decimal taxAmount = 0.0M;
            taxAmount = FindTaxAmount(order);

            decimal total = itemTotal - discountAmount + taxAmount;
            return total;
        }
Esempio n. 29
0
        public override void Init()
        {
            base.Init();

            PreTestDataWorker.DeleteAllOrders();
            PreTestDataWorker.DeleteAllShipments();
            var invoice = SalePreparationMock.PrepareInvoice();
            PreTestDataWorker.InvoiceService.Save(invoice);
            _order = invoice.PrepareOrder(MerchelloContext);
            PreTestDataWorker.OrderService.Save(_order);
        }
Esempio n. 30
0
        public OrdersProxy(IOrder order, Dispatcher dispatcher)
        {
            System.Diagnostics.Contracts.Contract.Requires(order != null);
            System.Diagnostics.Contracts.Contract.Requires(dispatcher != null);

            this.order = order;
            this.dispatcher = dispatcher;

            this.order.OrderChanged += this.OnOrderChanged;
            this.orderChangedEvent = this.dispatcher.RegisterEvent();
        }
Esempio n. 31
0
        protected override void OnCalculate()
        {
            string   ocoId;
            double   StopForShowGapTrade;
            DateTime ts_Einstieg;


            if (_testlauf == false)
            {
                ts_Einstieg = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 09, 15, 0);
            }
            else
            {
                ts_Einstieg = new DateTime(Bars[0].Time.Year, Bars[0].Time.Month, Bars[0].Time.Day, Bars[0].Time.Hour, Bars[0].Time.Minute, 0);
            }

            //todo Close before end of trading day - please check it!
            //if (this.oEnter != null)
            //{
            //    DateTime ts_Ausstieg;
            //    if (_testlauf == false)
            //    {
            //        ts_Ausstieg = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 09, 30, 0);
            //    }
            //    else
            //    {
            //        ts_Ausstieg = DateTime.Now.AddMinutes(1);
            //    }

            //    if (Bars[0].Timestamp >= ts_Ausstieg)
            //    {
            //        if (this.oEnter.Direction == OrderDirection.Buy)
            //        {
            //            CloseLongTrade(new StrategyOrderParameters {Type = OrderType.Market, Quantity = this.oEnter.Quantity, SignalName =  "EOD", FromEntrySignal =  this.oEnter.Name, Instrument =  this.oEnter.Instrument, TimeFrame =  this.oEnter.TimeFrame});
            //        }
            //        else if (this.oEnter.Direction == OrderDirection.Sell)
            //        {
            //            CloseShortTrade(new StrategyOrderParameters {Type = OrderType.Market, Quantity = this.oEnter.Quantity, SignalName =  "EOD", FromEntrySignal =  this.oEnter.Name, Instrument =  this.oEnter.Instrument, TimeFrame =  this.oEnter.TimeFrame});
            //        }
            //    }
            //}


            if (!IsProcessingBarIndexLast || oEnter != null)
            {
                return;
            }
            //Heute 09.15
            else if (Bars[0].Time == ts_Einstieg)
            {
                if (_testlauf == false)
                {
                    //ShowGap Indikator aufrufen. Dieser liefert 100 für Long Einstieg und -100 für Short Einstieg. Liefert 0 für kein Einstiegssignal
                    ShowGap_Indicator_Value = ShowGap_Indicator(PunkteGapMin, PunkteGapMax)[0];
                    StopForShowGapTrade     = ShowGap_Indicator(PunkteGapMin, PunkteGapMax).StopForShowGapTrade;
                }
                else
                {
                    ShowGap_Indicator_Value = 100;
                    StopForShowGapTrade     = (Bars[0].Close - 50 * TickSize);
                }
                if (ShowGap_Indicator_Value == 100)
                {
                    //Long
                    SignalNameEnter = "ShowGapLong" + Bars[0].Time;
                    SignalNameStop  = "ShowGapStop" + Bars[0].Time;
                    ocoId           = "ShowGapLong_ocoID" + Bars[0].Time;
                    oEnter          = SubmitOrder(0, OrderDirection.Buy, OrderType.Market, 3, 0, 0, ocoId, SignalNameEnter);
                    oStop           = SubmitOrder(0, OrderDirection.Sell, OrderType.Stop, 3, 0, StopForShowGapTrade, ocoId, SignalNameStop);
                }
                else if (ShowGap_Indicator_Value == -100)
                {
                    //Short
                    SignalNameEnter = "ShowGapShort" + Bars[0].Time;
                    SignalNameStop  = "ShowGapStop" + Bars[0].Time;
                    ocoId           = "ShowGapShort_ocoID" + Bars[0].Time;
                    oEnter          = SubmitOrder(0, OrderDirection.Sell, OrderType.Market, 3, 0, 0, ocoId, SignalNameEnter);
                    oStop           = SubmitOrder(0, OrderDirection.Buy, OrderType.Stop, 3, 0, StopForShowGapTrade, ocoId, SignalNameStop);
                }
                else
                {
                    //keine Aktion
                    return;
                }
                CreateIfDoneGroup(new List <IOrder> {
                    oEnter, oStop
                });
                oEnter.ConfirmOrder();
            }
        }
 public override void Generate(IOrder order)
 {
     Console.WriteLine(GenerateStringInvoice(order));
 }
Esempio n. 33
0
 void IOrderList.SetOrder(IOrder order)
 {
     this.order = order;
 }
Esempio n. 34
0
 public PremiumOrder(IOrder order) : base(order)
 {
     _cost = 10;
 }
Esempio n. 35
0
        void IOrder.Save()
        {
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //
                if (txt_BranchOut.Text.Trim().Contains("/") == false)
                {
                    MsgForm.ShowFrom("供应商必填!");
                    return;
                }
                if (txtBranchIn.Text.Trim().Contains("/") == false)
                {
                    MsgForm.ShowFrom("机构必填!");
                    return;
                }
                if (txtoper_date.Text.Trim() == "")
                {
                    MsgForm.ShowFrom("单据日期必填!");
                    return;
                }

                ic_t_inout_store_master        ord   = new ic_t_inout_store_master();
                List <ic_t_inout_store_detail> lines = new List <ic_t_inout_store_detail>();
                ord.sheet_no     = txtsheet_no.Text.Trim();
                ord.trans_no     = "G";
                ord.branch_no    = txt_BranchOut.Text.Trim().Split('/')[0];
                ord.d_branch_no  = txtBranchIn.Text.Trim().Split('/')[0];
                ord.pay_way      = "";
                ord.discount     = 1;
                ord.coin_no      = "RMB";
                ord.tax_amount   = 0;
                ord.oper_date    = Helper.Conv.ToDateTime(txtoper_date.Text.Trim());
                ord.oper_id      = txtoper_man.Text.Split('/')[0];
                ord.cm_branch    = "00";
                ord.other1       = txt_other1.Text.Trim();
                ord.other2       = "";
                ord.num1         = 0;
                ord.num2         = 0;
                ord.num3         = 0;
                ord.approve_flag = "0";
                ord.approve_man  = txtapprove_man.Text.Split('/')[0];
                ord.approve_date = System.DateTime.MinValue;
                ord.update_time  = update_time;

                int     flag      = 0;
                int     index     = 0;
                decimal total_amt = 0;
                foreach (DataRow row in editGrid1.DataSource.Rows)
                {
                    ++index;
                    if (row["item_no"].ToString() != "")
                    {
                        ic_t_inout_store_detail line = new ic_t_inout_store_detail();
                        lines.Add(line);
                        line.sheet_no    = ord.sheet_no;
                        line.item_no     = row["item_no"].ToString();
                        line.item_name   = row["item_name"].ToString();
                        line.unit_no     = row["unit_no"].ToString();
                        line.barcode     = row["barcode"].ToString();
                        line.unit_factor = 1;
                        line.in_qty      = Helper.Conv.ToDecimal(row["in_qty"].ToString());
                        line.orgi_price  = 0;
                        line.valid_price = Helper.Conv.ToDecimal(row["valid_price"].ToString());
                        line.cost_price  = Helper.Conv.ToDecimal(row["cost_price"].ToString());
                        line.sub_amount  = Helper.Conv.ToDecimal(row["sub_amount"].ToString());
                        line.discount    = 1;
                        line.tax         = 0;
                        line.is_tax      = "0";
                        line.other1      = "";
                        line.other2      = "";
                        line.other3      = "";
                        line.voucher_no  = "";
                        line.sheet_sort  = index;
                        line.num1        = Helper.Conv.ToDecimal(row["num1"].ToString());
                        line.num2        = 0;
                        line.num3        = 0;
                        line.num4        = 0;
                        line.num5        = 0;
                        line.num6        = 0;
                        line.ret_qnty    = Helper.Conv.ToDecimal(row["ret_qnty"].ToString());
                        line.cost_notax  = 0;
                        line.packqty     = 0;
                        line.sgqty       = 0;
                        flag             = 1;
                        total_amt       += line.in_qty * line.valid_price;
                    }
                }
                if (flag == 0)
                {
                    MsgForm.ShowFrom("请输入表单明细");
                    return;
                }
                ord.inout_amount = total_amt;
                ord.total_amount = total_amt;
                IBLL.IInOutBLL bll = new BLL.InOutBLL();
                if (runType == 1)
                {
                    var sheet_no = "";
                    bll.AddInOut(ord, lines, out sheet_no);
                    IOrder ins = this;
                    ins.ShowOrder(sheet_no);
                }
                else if (runType == 2)
                {
                    bll.ChangeInOut(ord, lines);
                    IOrder ins = this;
                    ins.ShowOrder(ord.sheet_no);
                }

                Dictionary <string, object> dic = this.Tag as Dictionary <string, object>;
                this.Tag = Helper.Conv.ControlsAdds(this, dic);

                IBLL.ISys sys       = new BLL.SysBLL();
                string    isApprove = sys.Read("approve_at_ones");
                if ("1".Equals(isApprove))
                {
                    if (YesNoForm.ShowFrom("保存成功!是否立即审核") == DialogResult.Yes)
                    {
                        tsbCheck_Click(new object(), new EventArgs());
                    }
                }
            }
            catch (Exception ex)
            {
                Helper.LogHelper.writeLog("frmIOMaster->Save()", ex.ToString(), txtsheet_no.Text);
                MsgForm.ShowFrom("采购入库单保存异常[" + ex.Message + "]");
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
Esempio n. 36
0
 /// <summary>
 /// Returns a constructed order number (including it's invoice number prefix - if any)
 /// </summary>
 /// <param name="order">The <see cref="IOrder"/></param>
 /// <returns>The prefixed order number</returns>
 public static string PrefixedOrderNumber(this IOrder order)
 {
     return(string.IsNullOrEmpty(order.OrderNumberPrefix)
         ? order.OrderNumber.ToString(CultureInfo.InvariantCulture)
         : string.Format("{0}-{1}", order.OrderNumberPrefix, order.OrderNumber));
 }
Esempio n. 37
0
 /// <summary>
 /// Gets a collection of unfulfilled (unshipped) line items
 /// </summary>
 /// <param name="order">The <see cref="IOrder"/></param>
 /// <param name="merchelloContext">The <see cref="IMerchelloContext"/></param>
 /// <returns>A collection of <see cref="IOrderLineItem"/></returns>
 public static IEnumerable <IOrderLineItem> UnfulfilledItems(this IOrder order, IMerchelloContext merchelloContext)
 {
     return(order.UnfulfilledItems(merchelloContext, order.Items.Select(x => x as OrderLineItem)));
 }
Esempio n. 38
0
 protected override void SetOrder(IOrder order)
 {
     Order = (CAWOrder)order;
 }
Esempio n. 39
0
 public OrderDecorator(IOrder order)
 {
     Order = order;
 }
Esempio n. 40
0
 public DashboardController(IMovie movie, IShow show, IOrder order)
 {
     this.movierepository = movie;
     this.showrepository  = show;
     this.orderrepository = order;
 }
Esempio n. 41
0
 public GroupOrderTemplate(IUserProfile UserProfileObj, IOrder OrderObj)
 {
     this.UserProfileObj = UserProfileObj;
     this.OrderObj       = OrderObj;
     this.OrderObj.SetOrderType("Group");
 }
Esempio n. 42
0
 public void AskForDeliveryTime(IOrder order)
 {
     Console.WriteLine("Delivery in: " + order.NumberOfWeeks);
 }
Esempio n. 43
0
 public abstract void CancelOrder(IOrder order, ICustomer customer);
Esempio n. 44
0
 public OrderController(IOrder orderManager, Cart cart)
 {
     this.cart         = cart;
     this.orderManager = orderManager;
 }
Esempio n. 45
0
 /// <summary>
 /// Gets a collection of unfulfilled (unshipped) line items
 /// </summary>
 /// <param name="order">The <see cref="IOrder"/></param>
 /// <param name="items">A collection of <see cref="IOrderLineItem"/></param>
 /// <returns>The collection of <see cref="IOrderLineItem"/></returns>
 public static IEnumerable <IOrderLineItem> UnfulfilledItems(this IOrder order, IEnumerable <IOrderLineItem> items)
 {
     return(order.UnfulfilledItems(MerchelloContext.Current, items));
 }
Esempio n. 46
0
 public OrderController(IOrder order)
 {
     m_order = order;
 }
Esempio n. 47
0
        public frmIOMaster()
        {
            InitializeComponent();
            //
            Helper.GlobalData.InitForm(this);
            //
            var tb = new DataTable();

            tb.Columns.Add("item_no");
            tb.Columns.Add("item_subno");
            tb.Columns.Add("barcode");
            tb.Columns.Add("item_name");
            tb.Columns.Add("unit_no");
            tb.Columns.Add("item_size");
            tb.Columns.Add("in_qty", typeof(decimal));
            tb.Columns.Add("valid_price", typeof(decimal));
            tb.Columns.Add("ret_qnty", typeof(decimal));
            tb.Columns.Add("sub_amount", typeof(decimal));
            tb.Columns.Add("cost_price", typeof(decimal));
            tb.Columns.Add("num1", typeof(decimal));//参考进价

            editGrid1.AddColumn("item_subno", "货号", "", 100, 1, "", true);
            editGrid1.AddColumn("item_name", "商品名称", "", 150, 1, "", false);
            editGrid1.AddColumn("unit_no", "单位", "", 60, 2, "", false);
            editGrid1.AddColumn("item_size", "规格", "", 80, 1, "", false);
            editGrid1.AddColumn("in_qty", "数量", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("ret_qnty", "实拣数", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("valid_price", "调拨价", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("sub_amount", "调拨金额", "", 100, 3, "0.00", false);
            editGrid1.AddColumn("cost_price", "调出价", "", 150, 3, "0.00", false);
            editGrid1.AddColumn("num1", "调出金额", "", 100, 3, "0.00", false);
            editGrid1.SetTotalColumn("in_qty,ret_qnty,sub_amount,num1");//合计项
            editGrid1.DataSource = tb;

            //
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //
                System.Threading.Thread th = new System.Threading.Thread(() =>
                {
                    Cursor.Current = Cursors.WaitCursor;
                    Helper.GlobalData.windows.ShowLoad(this);
                    try
                    {
                        IBLL.ICommonBLL bll2 = new BLL.CommonBLL();
                        var branch           = bll2.GetBranchList();
                        this.txtBranchIn.Invoke((MethodInvoker) delegate
                        {
                            txtBranchIn.Bind(branch, 300, 200, "branch_no", "branch_no:编号:80,branch_name:名称:140", "branch_no/branch_name->Text");
                        });

                        var branchout = bll2.GetBranchList();
                        this.txt_BranchOut.Invoke((MethodInvoker) delegate
                        {
                            txt_BranchOut.Bind(branchout, 300, 200, "branch_no", "branch_no:编号:80,branch_name:名称:140", "branch_no/branch_name->Text");
                        });

                        this.Invoke((MethodInvoker) delegate
                        {
                            IOrder ins = this;
                            ins.Add();
                        });
                    }
                    catch (Exception ex)
                    {
                        IvyBack.Helper.LogHelper.writeLog("frmIOMaster", ex.ToString());
                        MsgForm.ShowFrom(ex);
                    }
                    Cursor.Current = Cursors.Default;
                    Helper.GlobalData.windows.CloseLoad(this);
                });
                th.Start();
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
                Helper.LogHelper.writeLog("frmIOMaster()", ex.ToString());
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
Esempio n. 48
0
 public OrderDecorator(IOrder order, ApplicationLog applicationLog)
 {
     _decorated      = order ?? throw new ArgumentNullException(nameof(order));
     _applicationLog = applicationLog ?? throw new ArgumentNullException(nameof(applicationLog));
 }
Esempio n. 49
0
 /// <summary>
 /// Gets a collection of items that have inventory requirements
 /// </summary>
 /// <param name="order">The <see cref="IOrder"/></param>
 /// <returns>A collection of <see cref="IOrderLineItem"/></returns>
 public static IEnumerable <IOrderLineItem> InventoryTrackedItems(this IOrder order)
 {
     return(order.Items.Where(x => x.ExtendedData.GetTrackInventoryValue() && x.ExtendedData.ContainsWarehouseCatalogKey()).Select(x => (OrderLineItem)x));
 }
Esempio n. 50
0
        private string CreateQuery(IOrder order)
        {
            var query = new StringBuilder();

            if (order.OrderId != 0)
            {
                query.Append($"WHERE OrderId={order.OrderId}");
            }

            if (order.ProductId != 0)
            {
                if (query.Length == 0)
                {
                    query.Append("WHERE ");
                }
                else
                {
                    query.Append(" AND ");
                }

                query.Append($"ProductId ={order.ProductId}");
            }

            if (order.CustomerId != 0)
            {
                if (query.Length == 0)
                {
                    query.Append("WHERE ");
                }
                else
                {
                    query.Append(" AND ");
                }

                query.Append($"CustomerId ={order.CustomerId}");
            }

            if (!order.OrderDate.Year.Equals(1))
            {
                if (query.Length == 0)
                {
                    query.Append("WHERE ");
                }
                else
                {
                    query.Append(" AND ");
                }

                query.Append($"OrderDate ='{order.OrderDate.ToString("yyyy-mm-dd")}'");
            }

            if (order.OrderType != OrderType.All)
            {
                if (query.Length == 0)
                {
                    query.Append("WHERE ");
                }
                else
                {
                    query.Append(" AND ");
                }

                query.Append($"OrderTypeId ={(int)order.OrderType}");
            }

            return(query.ToString());
        }
Esempio n. 51
0
 /// <summary>
 /// Initializes a new instanace of the <see cref="OrderController"/> class
 /// </summary>
 /// <param name="orderRepository"></param>
 public OrderController(IOrder orderRepository)
 {
     _orderRepository = orderRepository;
 }
Esempio n. 52
0
 protected OrderDecorator(IOrder order)
 {
     _order = order;
 }
Esempio n. 53
0
        public void cancelOrder(IPerson person, IOrder order)
        {
            int index = fordOrders.FindIndex(a => a.RefNumber == order.RefNumber);

            fordOrders = fordOrders[0].Cancel(fordOrders, index);
        }
Esempio n. 54
0
            /// <summary>
            /// Run the example code.
            /// </summary>
            public static void Main()
            {
                const string MerchantId   = "0";
                const string SharedSecret = "sharedSecret";
                string       orderId      = "12345";

                IConnector connector = ConnectorFactory.Create(MerchantId, SharedSecret, Client.EuTestBaseUrl);

                Client   client  = new Client(connector);
                IOrder   order   = client.NewOrder(orderId);
                ICapture capture = client.NewCapture(order.Location);

                ShippingInfo shippingInfo = new ShippingInfo
                {
                    ShippingCompany       = "DHL",
                    ShippingMethod        = "Home",
                    TrackingUri           = new Uri("http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=1234567890"),
                    TrackingNumber        = "1234567890",
                    ReturnTrackingNumber  = "E-55-KL",
                    ReturnShippingCompany = "DHL",
                    ReturnTrackingUri     = new Uri("http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=98389222")
                };
                List <OrderLine> lines = new List <OrderLine>();

                lines.Add(new OrderLine()
                {
                    Type           = OrderLineType.Physical,
                    Reference      = "123050",
                    Name           = "Tomatoes",
                    Quantity       = 10,
                    QuantityUnit   = "kg",
                    UnitPrice      = 600,
                    TaxRate        = 2500,
                    TotalAmount    = 6000,
                    TotalTaxAmount = 1200
                });

                CaptureData captureData = new CaptureData()
                {
                    CapturedAmount = 6000,
                    Description    = "Shipped part of the order",
                    OrderLines     = lines,
                    ShippingInfo   = new List <ShippingInfo>()
                    {
                        shippingInfo
                    }
                };

                try
                {
                    capture.Create(captureData);
                }
                catch (ApiException ex)
                {
                    Console.WriteLine(ex.ErrorMessage.ErrorCode);
                    Console.WriteLine(ex.ErrorMessage.ErrorMessages);
                    Console.WriteLine(ex.ErrorMessage.CorrelationId);
                }
                catch (WebException ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
Esempio n. 55
0
        public frmSaleInSheet()
        {
            InitializeComponent();
            //
            Helper.GlobalData.InitForm(this);
            //
            var tb = new DataTable();

            tb.Columns.Add("item_no");
            tb.Columns.Add("item_subno");
            tb.Columns.Add("barcode");
            tb.Columns.Add("item_name");
            tb.Columns.Add("unit_no");
            tb.Columns.Add("item_size");
            tb.Columns.Add("in_qty", typeof(decimal));
            tb.Columns.Add("valid_price", typeof(decimal));
            tb.Columns.Add("sub_amount", typeof(decimal));
            tb.Columns.Add("other1");
            tb.Columns.Add("valid_date", typeof(DateTime));
            tb.Columns.Add("price", typeof(decimal));//参考进价

            editGrid1.AddColumn("item_subno", "货号", "", 100, 1, "", true);
            editGrid1.AddColumn("item_name", "商品名称", "", 150, 1, "", false);
            editGrid1.AddColumn("unit_no", "单位", "", 60, 2, "", false);
            editGrid1.AddColumn("item_size", "规格", "", 80, 1, "", false);
            editGrid1.AddColumn("in_qty", "数量", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("valid_price", "单价", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("sub_amount", "金额", "", 100, 3, "0.00", false);
            editGrid1.AddColumn("other1", "备注", "", 150, 1, "", true);
            editGrid1.AddColumn("price", "参考进价", "", 100, 3, "0.00", false);
            editGrid1.SetTotalColumn("in_qty,sub_amount");//合计项
            editGrid1.DataSource = tb;

            //
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //


                System.Threading.Thread th = new System.Threading.Thread(() =>
                {
                    Cursor.Current = Cursors.WaitCursor;
                    Helper.GlobalData.windows.ShowLoad(this);
                    try
                    {
                        IBLL.ICommonBLL bll2 = new BLL.CommonBLL();

                        var branch = bll2.GetBranchList();
                        this.txtbranch.Invoke((MethodInvoker) delegate
                        {
                            txtbranch.Bind(branch, 300, 200, "branch_no", "branch_no:编号:80,branch_name:名称:140", "branch_no/branch_name->Text");
                        });

                        var cust = bll2.GetAllCustList();
                        this.txt_cust.Invoke((MethodInvoker) delegate
                        {
                            txt_cust.Bind(cust, 350, 200, "supcust_no", "supcust_no:编号:80,sup_name:名称:200", "supcust_no/sup_name->Text");
                        });

                        var deal = bll2.GetPeopleList();
                        this.txt_deal_man.Invoke((MethodInvoker) delegate
                        {
                            txt_deal_man.Bind(deal, 250, 200, "oper_id", "oper_id:编号:80,oper_name:姓名:100", "oper_id/oper_name->Text");
                        });

                        this.Invoke((MethodInvoker) delegate
                        {
                            IOrder ins = this;
                            ins.Add();
                        });
                    }
                    catch (Exception ex)
                    {
                        IvyBack.Helper.LogHelper.writeLog("frmSaleInSheet", ex.ToString());
                        MsgForm.ShowFrom(ex);
                    }
                    Cursor.Current = Cursors.Default;
                    Helper.GlobalData.windows.CloseLoad(this);
                });
                th.Start();
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
                Helper.LogHelper.writeLog("frmSaleInSheet()", ex.ToString());
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
Esempio n. 56
0
 public OrderService(IOrder iOrder)
 {
     this._iOrder = iOrder;
 }
    public Manipulator(IOrder order)
    {
        Expression <Func <IOrder, object[]> > exp = o => new object[0];

        order.AttachAsModifiedToOrders(order, exp);
    }
Esempio n. 58
0
 internal static bool CancelAndVerify(OrderBook orderBook, IOrder order, OrderState expectedState)
 {
     orderBook.Cancel(order);
     return((order as SimpleOrder)?.State == expectedState);
 }
Esempio n. 59
0
 public abstract void ProcessOrder(IOrder order, ICustomer customer);
Esempio n. 60
0
 public Calc(IOrder order, IDealItem item)
 {
     _order = order;
     _item  = item;
 }