当前位置: 首页>>代码示例>>C#>>正文


C# Orders类代码示例

本文整理汇总了C#中Orders的典型用法代码示例。如果您正苦于以下问题:C# Orders类的具体用法?C# Orders怎么用?C# Orders使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Orders类属于命名空间,在下文中一共展示了Orders类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Get

 public OrdersResponse Get(Orders request)
 {
     return new OrdersResponse { Orders = new List<OrdersDto>
         {
             new OrdersDto {CustomerName="Test", CountItems = 10, TotalCost = 100}
         }};
 }
开发者ID:paaschpa,项目名称:ServiceStackPlayGround,代码行数:7,代码来源:OrdersService.cs

示例2: OrderDetails

        public void OrderDetails()
        {
            var conn = new NHibernateConnection();
            var orderRepo = new OrdersRepository(conn);
            var productRepo = new ProductsRepository(conn);
            var userRepo = new UserRepository(conn);
            var deliveryRepo = new DeliveryTypesRepository(conn);
            Users user = userRepo.Get("[email protected]");
            var orderDetailsRepo = new OrderDetailsRepository(conn);
            Products product = productRepo.GetAll().First();

            var delivetyType = deliveryRepo.GetAll().First();

            if (delivetyType == null)
            {
                delivetyType = new DeliveryTypes("Poczta Polska", Convert.ToDecimal(8.99));
                deliveryRepo.Save(delivetyType);
            }

            var order = new Orders(user, DateTime.Now,
                Convert.ToDecimal(299.99),delivetyType);

            orderRepo.Save(order);

            var orderDetails = new OrderDetails(order, product, 2, Convert.ToDecimal(29.99));
            orderDetailsRepo.Save(orderDetails);

            var fromDB = orderDetailsRepo.Get(orderDetails.ID);

            Assert.IsNotNull(fromDB);
        }
开发者ID:gpierzchala,项目名称:InternetStore,代码行数:31,代码来源:DataAccessTests.cs

示例3: OrderReceived

 public void OrderReceived(Orders.Order order, MerchantTribeApplication app)
 {
     if (OnOrderReceived != null)
     {
         OnOrderReceived(this, order, app);
     }
 }
开发者ID:KimRossey,项目名称:MerchantTribe,代码行数:7,代码来源:Integration.cs

示例4: TryMatchOrder

        public static bool TryMatchOrder(Order order, Orders orders, Trades trades)
        {
            List<Order> candidateOrders = order.BuySell == Order.BuyOrSell.Buy
                                              ? new List<Order>(orders.FindAll(o => o.Price <= order.Price))
                                              : new List<Order>(orders.FindAll(o => o.Price >= order.Price));
            if (candidateOrders.Count == 0)
                return false;

            foreach (Order candidateOrder in candidateOrders)
            {
                //once an order has been filled completely our job is done
                if (order.Quantity == 0)
                    break;

                ulong quantity = (candidateOrder.Quantity >= order.Quantity
                                      ? order.Quantity
                                      : candidateOrder.Quantity);

                candidateOrder.Quantity -= quantity;
                order.Quantity -= quantity;

                if (candidateOrder.Quantity == 0)
                    orders.Remove(candidateOrder);

                trades.AddTrade(new Trade(order.Instrument, quantity, candidateOrder.Price));
            }
            return true;
        }
开发者ID:sql-migrate,项目名称:OrderMatchingEngine,代码行数:28,代码来源:OrderProcessor.cs

示例5: Customer

 public Customer(Guid id, AddressBook addresses, Orders orderHistory, PaymentDetails paymentDetails, LoyaltySummary loyalty)
 {
     this.Id = id;
     this.Addresses = addresses;
     this.OrderHistory = orderHistory;
     this.PaymentDetails = paymentDetails;
     this.Loyalty = loyalty;
 }
开发者ID:elbandit,项目名称:PPPDDD,代码行数:8,代码来源:Customer.cs

示例6: Init

        public void Init()
        {
            _orders = new Orders();
            _items = new Items();

            _items.Delete();
            _orders.Delete();
        }
开发者ID:jhuerta,项目名称:MVC3_ExploringNewFeatures,代码行数:8,代码来源:ShopifyTests.cs

示例7: GetLoadUserLastOrder

 public Entities.Orders GetLoadUserLastOrder()
 {
     Orders order = LoggedUserLastOrder;
     if (order == null)
     {
         order = new Orders();
     }
     return order;
 }
开发者ID:johncoffee,项目名称:eventblock,代码行数:9,代码来源:Checkout.aspx.cs

示例8: OnOrderEvent

 public override void OnOrderEvent(Orders.OrderEvent orderEvent)
 {
     if ((orderEvent.Direction == Orders.OrderDirection.Sell) &&
         (orderEvent.Status == Orders.OrderStatus.Filled))
     {
         Log(string.Format("Trade {0} close at {1}", closeTradeCounter, Time));
         closeTradeCounter++;
     }
 }
开发者ID:bizcad,项目名称:LeanITrend,代码行数:9,代码来源:TestingTradeBuilder.cs

示例9: ListAll

 public Orders[] ListAll()
 {
     DataTable table = SqlHelper.ExecuteDataTable("select * from Orders and OrdersIsDeleted=0");
     Orders[] dt = new Orders[table.Rows.Count];
     for (int i = 0; i < table.Rows.Count; i++)
     {
         dt[i] = ToModel(table.Rows[i]);
     }
     return dt;
 }
开发者ID:hhxyzsm,项目名称:Ordering,代码行数:10,代码来源:OrdersDAL.cs

示例10: InsertOrUpdate

 public void InsertOrUpdate(Orders orders)
 {
     if (orders.Id == default(int))
     {
         context.Orders.Add(orders);
     }
     else
     {
         context.Entry(orders).State = EntityState.Modified;
     }
 }
开发者ID:jordanovski,项目名称:venus,代码行数:11,代码来源:OrdersRepository.cs

示例11: Insert

 /// <summary>
 /// 将 Orders 类型的对象插入数据库
 /// </summary>
 /// <param name="model"></param>
 public void Insert(Orders model)
 {
     SqlHelper.ExecuteNonQuery(@"insert into Orders(OrdersID,OrdersBusinessID,OrdersCustID,OrdersFoodInfoID,
                                 OrdersData,OrdersNum) values(@OrdersID,@OrdersBusinessID,@OrdersCustID,
                                 @OrdersFoodInfoID,@OrdersData,@OrdersNum)",
                     new SqlParameter("@OrdersID", model.OrdersID),
                     new SqlParameter("@OrdersBusinessID", model.OrdersBusinessID),
                     new SqlParameter("@OrdersCustID", model.OrdersCustID),
                     new SqlParameter("@OrdersFoodInfoID", model.OrdersFoodInfoID),
                     new SqlParameter("@OrdersData", model.OrdersData),
                     new SqlParameter("@OrdersNum", model.OrdersNum));
 }
开发者ID:hhxyzsm,项目名称:Ordering,代码行数:16,代码来源:OrdersDAL.cs

示例12: InsertOrder

    ///////////////////////////////////// Insert order functions /////////////////////////////////////
    public void InsertOrder()
    {
        User User = new User();
        User = GetOrderUser();

        var Order = new Orders();
        InitOrder(ref Order);
        TryUpdateModel(Order);

        //if (ModelState.IsValid && OrdersLogic.InsertOrder(Order, User, BasketList))
        //{
        //    Response.Redirect("~/checkout?success=true");
        //}
    }
开发者ID:johncoffee,项目名称:eventblock,代码行数:15,代码来源:Checkout.aspx.cs

示例13: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["OrderNumber"] != null)
         {
             var oOrder = new Orders();
             oOrder.OrdersQuickUpdate_PayStatusID(Session["OrderNumber"].ToString(), "2");
             Session["Cart"] = null;
             Session["CheckOut"] = null;
         }
         else
             Response.Redirect("~/gio-hang.aspx");
     }
 }
开发者ID:hungtien408,项目名称:web-quanaotreem,代码行数:15,代码来源:xac-nhan-don-hang.aspx.cs

示例14: RenderLatestTrackerAndTransaction

        public static string RenderLatestTrackerAndTransaction(string googleId, Orders.Order o, string storeName, string categoryName)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("<script type=\"text/javascript\">\n");
            sb.Append("var _gaq = _gaq || [];\n");
            sb.Append("_gaq.push(['_setAccount', '" + googleId + "']);\n");
            sb.Append("_gaq.push(['_trackPageview']);\n");

            if (o != null)
            {
                sb.Append("_gaq.push(['_addTrans',\n");
                sb.Append("'" + GoogleSafeString(o.OrderNumber) + "',\n");           // order ID - required
                sb.Append("'" + GoogleSafeString(storeName) + "',\n");  // affiliation or store name
                sb.Append("'" + o.TotalGrand + "',\n");          // total - required
                sb.Append("'" + o.TotalTax + "',\n");           // tax
                sb.Append("'" + o.TotalShippingAfterDiscounts + "',\n");              // shipping
                sb.Append("'" + GoogleSafeString(o.ShippingAddress.City) + "',\n");       // city
                sb.Append("'" + GoogleSafeString(o.ShippingAddress.RegionName) + "',\n");     // state or province
                sb.Append("'" + GoogleSafeString(o.ShippingAddress.CountyName) + "'\n");             // country
                sb.Append("]);\n");

                foreach(Orders.LineItem li in o.Items)
                {
                    // add item might be called for every item in the shopping cart
                    // where your ecommerce engine loops through each item in the cart and
                    // prints out _addItem for each
                    sb.Append("_gaq.push(['_addItem',\n");
                    sb.Append("'" + GoogleSafeString(o.OrderNumber) + "',\n");           // order ID - required
                    sb.Append("'" + GoogleSafeString(li.ProductSku) + "',\n");           // SKU/code - required
                    sb.Append("'" + GoogleSafeString(li.ProductName) + "',\n");        // product name
                    sb.Append("'" + GoogleSafeString(categoryName) + "',\n");   // category or variation
                    sb.Append("'" + li.AdjustedPricePerItem + "',\n");          // unit price - required
                    sb.Append("'" + li.Quantity + "'\n");               // quantity - required
                    sb.Append("]);\n");
                }
   
                sb.Append("_gaq.push(['_trackTrans']);\n"); //submits transaction to the Analytics servers
            }

            sb.Append("(function() {\n");
            sb.Append("var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n");
            sb.Append("ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n");
            sb.Append("var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n");
            sb.Append("})();\n");
            sb.Append("</script>\n");

            return sb.ToString();
        }
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:48,代码来源:GoogleAnalytics.cs

示例15: PlanSuccess

        /// <summary>
        /// 此方法用于客户开发成功
        /// </summary>
        /// <param name="cus">要添加的客户对象</param>
        /// <param name="lm">要添加的联系人对象</param>
        /// <param name="od">要添加的订单对象</param>
        /// <param name="act">要添加的交往记录对象</param>
        /// <returns></returns>
        public static bool PlanSuccess(int chanID)
        {
            Chances chan = ChancesBLL.ChanFindById(chanID);
            //判断销售机会是否修改成功
            if (null == chan)
            {
                return false;
            }

            List<Plans> plList = PlansDAL.PlanFindByID(chanID);
            //判断客户开发计划是否为空
            if (null == plList)
            {
                return false;
            }

            //给要添加的客户初始化值
            Customers cus = new Customers();
            cus.CusID = CustomersBLL.GetCusID();
            cus.UserID = chan.ChanDueMan;
            cus.CusName = chan.ChanName;

            //给要添加的联系人初始化值
            LinkMans lm = new LinkMans();
            lm.CusID = cus.CusID;
            lm.LMName = chan.ChanName;
            lm.LMMobileNo = lm.LMOfficeNo = chan.ChanLinkTel;

            //给要添加的订单初始化值
            Orders od = new Orders();
            od.CusID = cus.CusID;
            od.OrderDate = "getdate()";

            //给要添加的交往记录初始化值
            List<Activitys> actList = new List<Activitys>();
            for (int i = 0; i < plList.Count; i++)
            {
                Activitys act = new Activitys();
                act.CusID = cus.CusID;
                act.ActDate = plList[i].PlanResultDate;
                act.ActTitle = plList[i].PlanResult;
                actList.Add(act);
            }

            return CustomersBLL.CustomerAddNew(cus) && LinkMansBLL.LinkManAddNew(lm) && OrdersBLL.OrderAddNew(od) && ActivitysBLL.ActivityAddNew(actList) && ChancesBLL.PlanSuccess(chanID);
        }
开发者ID:BensterS,项目名称:CRM,代码行数:54,代码来源:PlansBLL.cs


注:本文中的Orders类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。